Feeling awkward about posting this as it seems to be such a simple problem but I have tried everything that I can think of to fix the issue including an exhaustive online search.
Background: I set up HA about a month ago for the first time ever since Insteon died. I’ve managed to integrate all of my sonoff, insteon, wyze, wemo, tplink, sengled, unifi, home alarm, tuya local and orbit devices as well as setting up remote access and voice control through Alexa (google integration remains an issue but I’ll save that for a different post!) I’ve scoured all sorts of videos, read blogs and anything else I can find. In the process, I’ve learned about flashing my Wyze camera firmware to RTSP and so forth. I’ve also set up many automations to replace the routines in Alexa as they tend to trigger faster and it removes information from Amazon.
Problem: I am having difficulties with simple IF binary_sensor_xxx turns on THEN turn light.xxx or switch.xxx on. I’ve debugged the automation but it just won’t trigger.
Here is a sample of the yaml code:
alias: ‘Automation_door_opened: Garage door triggers garage lights’
description: ‘’
trigger:
- platform: state
entity_id:- binary_sensor.garage_door
to: ‘On’
from: ‘Off’
condition: []
action:
- binary_sensor.garage_door
- service: switch.turn_on
data: {}
target:
entity_id: switch.switchlinc_relay_garage - delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0 - service: switch.turn_off
data: {}
target:
entity_id: switch.switchlinc_relay_garage
mode: single
Things that I’ve tried:
- I’ve tried playing around with the triggers so that it just lists To: ‘On’ or just lists From: ‘Off’ even though I don’t think this should matter
- I’ve tried using the device action instead of call service even though I think the call service is the standard protocol
- I’ve tried changing the automation mode to “parallel” instead of a single action
Other information:
- I can confirm that the state of the binary_sensor does change to on in the developer tools
- I have a separate automation that sends me a notification whenever the binary_sensor is triggered and this automation works perfectly every time
- this door trigger issue applies to other automations that I’ve tried to implement so clearly there is a problem with the syntax that I’m using
I’m totally stumped and would appreciate any feedback. Thanks in advance.