I have an automation that switches the light on when the motion sensor goes from off to on. And if it goes from on to off, another automation switches the light off. Can I do that in ONE automation?
That is:
trigger:
- entity_id: binary_sensor.sensor_motion
But how can I make the action dependend on the motion state?
Will this work:
You can’t easily combine the automations if you are setting the brightness as the light.turn_off service does not accept this data and will generate an error and halt execution of the actions.
The complexity required to overcome this limitation is not worth the effort. Use two automations.