I have an AQARA presence detection. I want to poweron a light when it detects movement.
I can do it at first try, but if I poweroff the light manually and I re-trigger the device, it doesn’t re-light and not retrigger cause for next minute state is on.
How can I trigger the light when state is on? I noticed that Zigbee2Mqtt re-send a payload if presence detection is re-triggered.
Thank you
- id: '1610904943967'
alias: Luci - Corridoio - ON
description: ''
trigger:
- platform: state
entity_id: binary_sensor.0x00158d00032c28fb_occupancy
from: 'off'
to: 'on'
- platform: template
value_template: '{{ states("binary_sensor.0x00158d00032c28fb_occupancy") == "on" }}'
condition: []
action:
- service: light.turn_on
data: {}
entity_id: light.84cca8a5aec7
mode: single