@alain57 wrote:
Hello,
i have a motion detector that is not working like i was expected and I did a bit of automation
Indeed somehow it detects motion every 5 seconds, but goes to the off status after 90 secondsSo my plan is to store the timestamp of the last motion it received and when the current time - stored time > 30, turn off the light
basically this is what i did :
if motion detected, publish the current timestamp to an mqtt topic
and i added a sensor (test) that has the value of the mqtt topicbut i didn’t found a way to automate the end of the process :’(
I tried something like this
trigger: - above: '30' entity_id: sensor.test platform: numeric_state value_template: '{{ now().strftime("%s")| int - states(sensor.test) | int }}' condition: [] action: - entity_id: light.lumiere_salle_de_bain_du_bas service: light.turn_off
any clue what i’m missing ?
Thanks a lot in advance
Posts: 1
Participants: 1