This automation turn off all lights after 2min, but I wanted to reset the timer if there is any new MQTT trigger, is it possible?
This is the code:
alias: Turn On Garagem
description: ""
trigger:
- platform: mqtt
topic: garagem
payload: garagem
condition:
- condition: sun
before: sunrise
after: sunset
action:
- type: turn_on
device_id: 94cd9df7c88224c98f13715eca8a403b
entity_id: light.garagem_light_2
domain: light
flash: short
- type: turn_on
device_id: 94cd9df7c88224c98f13715eca8a403b
entity_id: light.garagem_light
domain: light
flash: short
- type: turn_on
device_id: 754631f8f210927c9f51a81f5f90cc56
entity_id: light.lavanderia_porta_light
domain: light
flash: short
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- type: turn_off
device_id: 94cd9df7c88224c98f13715eca8a403b
entity_id: light.garagem_light
domain: light
- type: turn_off
device_id: 94cd9df7c88224c98f13715eca8a403b
entity_id: light.garagem_light_2
domain: light
- type: turn_off
device_id: 754631f8f210927c9f51a81f5f90cc56
entity_id: light.lavanderia_porta_light
domain: light
mode: single