I am trying to setup a trigger, condition and action for an automation and not sure how to go about doing it. Here is a list of the rules I am trying to implement.
- An entity’s state will change from off to on at some random time.
- I want to perform the action but only during the time period of 8:30AM to 5:30PM.
- If the entity’s state changes outside this time period, then I want it queued up and action performed at 8:30AM.
- If the entity’s state changes during this time period, then I want the action performed immediately.
Any ideas on how to implement? Here is sample code I tried and I know it doesn’t work because it’s only looking for the trigger to occur only during the hours of 8:30AM to 5:30PM.
alias: Automation Name trigger: - platform: state entity_id: binary_sensor.pool to: 'on' condition: - condition: time after: '08:30:00' before: '17:30:00' action: "action will be placed here"
I appreciate any help or tips!!!