Hey there,
I startet out with Home Assistant a week ago. So far I got a couple of homemade esp8266 sensors and a zigbee2mqtt bridge with some lightbulbs and sensors connected to it running. Now I wanted to get my first automation working.
All I wanna do, is switch a Tradfri lightbulb on when I detect occupancy withe the Auara Motion sensor.
The binary sensor is already working, in the WebUI, i can see its state change. But I guess i messed up something with the automation. Can you guys help?
look in the âstatesâ section (<>) of the dev-tools on side panel and see what the state of the motion detector is. Specifically, check if the state is reported in capital letters or lower case.
If itâs lower case then switch to that in your automation.
Also, just as an FYI, you donât need to add the "from: " in the trigger if there are only two states possible with your device. Since youâre using a binary sensor then by definition it only has two states.
In general, yes, I would agree. But itâs still possible for a binary_sensorâs state to also be âunknownâ or âunavailableâ, too. Depends on the sensor. If the sensor ever went from âunknownâ or âunavailableâ to âonâ, then to: 'on' would trigger, whereas to: 'on'andfrom: 'off' would not. Youâd have to decide which would work better for you in that case.