I have a Wyze motion sensor which definitely works because I can see it’s state in the Lovelace UI (using the Entity card).
However, I have set it as a trigger for an automation and even though the state is showing as detecting motion in the Lovelace UI, the automation will not trigger. My YAML for the automation is as follows:
alias: Hall light-automatic
description: >-
Turn hall light on and off depending on whether motion is detected between
sunset and sunrise
trigger:
- platform: state
entity_id: 'binary_sensor.wyzesense_779232e3
to: 'on'
condition:
- condition: sun
before: sunrise
after: sunset
action:
- type: turn_on
device_id: d62ab7c21b1dcb6c1ed9a50758688378
entity_id: light.04232101cc50e3ec05ae
domain: light
- delay:
hours: 0
minutes: 0
seconds: 15
milliseconds: 0
- type: turn_off
device_id: d62ab7c21b1dcb6c1ed9a50758688378
entity_id: light.04232101cc50e3ec05ae
domain: light
mode: single
Even if I remove the condition about the sun, it still fails to trigger. I can execute the actions for the automation manually.
I see other people have similar problems and the repository is no longer maintained so I would appreciate any ideas.