I have an automation that is triggered by schedule to turn on and off. It’s working properly, not the issue here.
I would like to create another automation that is triggered by other entity (for example: open/closing a door) that also checks if this happens during a the scheduled time. If within schedule, take action. If outside of schedule, do nothing.
trigger:
- platform: state
entity_id: binary_sensor.door
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: schedule.my_schedule
state: 'on'
action:
- do you action here.
If you’re using the UI, then it’s as simple as Add Condition / Entity, then select your entity and the desired state. Here, “Cheap Rate” is actually schedule.cheap_rate:
Three dots / Edit in YAML then shows exactly as Tom’s condition above:
condition: state
entity_id: schedule.cheap_rate
state: "on"