Lights are turned off after a few minutes without any action

Hi,
I’ve got a problem. Got 2 LSC bulbs in the garden which are turned on with this script:

alias: Tuinlamp 1 aan
description: Tuinlamp 1 aan bij zonsondergang +30m
trigger:
  - platform: sun
    event: sunset
    offset: "+00:30:00"
condition: []
action:
  - service: light.turn_on
    data:
      brightness: 10
      color_temp: 400
    target:
      device_id: df97e2c5285c8462fe31e2735024d58a
mode: single

To turn the bulbs off I use this script:

alias: Tuinlamp 1 uit
description: Tuinlamp 1 uit 02:00u
trigger:
  - platform: time
    at: "02:00:00"
condition: []
action:
  - service: light.turn_off
    data: {}
    target:
      device_id: df97e2c5285c8462fe31e2735024d58a
mode: single

Light turns on with the script but after a few minutes (between 5 and 10 minutes) they are suddenly turned off. Nothing special to find in the LOG, just that the lights are turned off. There are no other groups or something that could trigger this 2 bulbs to go off.
When I turn this bulbs on manually in HA there’s no problem. They stay on. It’s driving me crazy. :frowning:
There’s 1 other bulb in the garden with the exactly the SAME two scripts and it works perfectly!

Hi Jack - before we go any further, can you edit your post to have any logs or yaml enclosed in preformatted text tags. The </> button on the posting toolbar inserts them.

Also read this link:

:+1: thanks, I’m a newbie.

What does the Logbook say?

If it just says X turned off then HA is telling you that it detected that, not that it did it.

I’ve been searching and finally today found out a little bit more. So glad, I know now where the problem is (starting), but I didn’t found a solution for it yet. Maybe you or someone has. These 2 bulbs are starting automatically a Countdown in Tuya when using the script. Checked this on the Tuya Development website from where I can also get the local keys. In HA I’m using also LocalTuya. When the script starts to turn on the bulb(s) it also activates the Timer (there is a DP ID Timer present) in Tuya. But Why? I see this Countdown (timer entry) on Tuya Development (device log). Also see this Countdown starting in the Tuya APP on my iPhone. So strange. How can I get rid off this Countdown problem. The Countdown isn’t starting when switching on the bulb manually in HA.

That sounds then like a Tuya behaviour, and Tuya’s own docs cover countdowns and timers. You should be able to disable/remove that.

Finally found it out. The problem was that the wrong value was entered in the configure entity of both bulbs. The color temperature was set 23 value 0 and is now value 1000. In both situations the bulbs worked fine for on/off, brightness and the color temperature on my dashboard. But using the automation script in HA triggered the countdown of this bulbs. I couldn’t remove the countdown in the Tuya App, so I first had to remove the bulbs in HA en pair them again. From that moment the bulbs worked fine until I entered color temperature 23 (value 0) again. Then the countdown started again by using the script. So I found out that color temperature 23 (value 0) was the problem.