I have a switch in my system that, due to its mechanical features, must toggle it’s state when it receives an on or off from HA. I have a scene defined that turns off all of the lights except this one in that area and I would like to trigger an automation routine to toggle it’s state if it is currently “On” but not if it is off.
I have the following scene defined: scene.upstairs_off
I have an automation that was built using the HA automation editor that is defined as:
Make sure that the automation is on/enabled from the states page. Secondly, does the light turn off if you trigger the automation from the services page? Lastly, the condition state more than likely needs to be lowercase.
- id: '1556942237223'
alias: Stairwell Test
trigger:
- event_data:
domain: scene
service: turn_on
service_data:
entity_id: scene.upstairs_off
event_type: call_service
platform: event
condition:
- condition: state
entity_id: switch.upstairs_stairway_lights
state: 'on' <---- should probably be lowercase
action:
- data:
entity_id: switch.upstairs_stairway_lights
service: switch.turn_off
yes, if I trigger the automation manually, the light changes state
I’ve tried the automation with the condition in lowercase, and mixed case and neither affects the automation. I also removed the condition altogether and there was no change - the automation was not triggered by activating the scene.
Yep, I don’t think I made that clear. I rested the automation with and without the condition and with the condition variable lower case and mixed case via activating the scene.
I tested the action of the automation with the manual trigger.