I want to trigger an start action when an entity changes state to ON -- call a webhook and save the contents of the response (contains event_id)
Once start action is done, I want to wait until that entity goes back to OFF, and stays OFF for 10 seconds. If it turns back ON I do no want to do the start action but just restart my 10-second timer. And this may happen many times.
Eventually when it stays OFF for 10 seconds, I want to trigger another webhook action (using the same event_id I had gotten in start action)
How do I do this?