Delay in automation is an infinite loop

Hi.

I have this automation that is suppose to publish a mqtt message after 5 minutes that I publish a message in the mqtt topic. But like this way it got crazy and publish the mqtt messages continuously with no end.

what it is wrong?

- id: '1594775184485'
  alias: Apagar Riego 5 mins despues de que se encienden
  description: ''
  trigger:
  - platform: mqtt
    topic: LV-Automation/Jardin/RiegoAutomatico
  condition: []
  action:
  - delay: 00:05:00
  - data:
      payload: Z1OFF
      topic: LV-Automation/Jardin/RiegoAutomatico
    service: mqtt.publish
  - data:
      payload: Z2OFF
      topic: LV-Automation/Jardin/RiegoAutomatico
    service: mqtt.publish

that right

you have the trigger

  trigger:
  - platform: mqtt
    topic: LV-Automation/Jardin/RiegoAutomatico

then it delay

  - delay: 00:05:00

then it send a MQTT

  - data:
      payload: Z1OFF
      topic: LV-Automation/Jardin/RiegoAutomatico

guess what it
as the topic’s are the same the trigger has just been kick off again.

fix could be put a condition so it only happens once

You have all the reason, I add the playload and it works!

thanks!

all good bro

we all still leaning getting head around this.

1 Like