Run an automation every two seconds

Hello there, I’m trying to run an automation every two second but it doesn’t seem to be working because the “last_triggered” attribute is showing “null”. Here is the code:

- id: '1548790568933'
  alias: Actualizar Estados Tuya
  trigger:
  - platform: time_pattern
    hours: "00"
    minutes: "00"
    seconds: "/2"
  action:
  - alias: ''
    data: {}
    service: tuya.force_update

Am I missing something?

1 Like

try removing the hours and minutes from your automation

Not sure if it matters but I don’t think you need to use the hours and minutes lines when using the repeat like that… I think just the seconds: ‘/2’ line would suffice.

1 Like

That worked! Thank you both.

Do you really need to spam the Tuya cloud server every 2 seconds?

2 Likes

I am trying to be able to control the position of a blind by using timers and a wifi blind switch that works with the tuya app. In order to do this I need to have the state of the switch to be constantly updated, otherwise it will update every 10 seconds or so. I can’t think of a better solution.

Is this solving your issue with tuya integration?

I also see that the device status update is slow… but even if I try to put the automation to force the update every 2 seconds, the situation is not improving…