Automation randomly turns one of my lights off?

i have an automation for our holiday lights that has worked perfectly since black friday, when i turned it on…however, tonight, something very strange happened.

i’ve got two groups of lights that the automation turns on: our “holiday lights” and our “holiday security lights” (which is a smaller subset of our usual security lights out front that come on at sunset). every day since we enabled the automation, the lights come on as planned. today, however, it turned everything in our holiday lights group on…then, a second later, turned our “holiday lights” switch off. we didn’t notice it until several hours later, when my wife noticed that only half of the lights were on…

yesterday (same as every other day all month):

today:

the switch itself also reports being turned OFF by the automation that should be doing nothing but turning it ON:

here’s the automation. as you can see, there’s nothing in the automation that should be turning the switch back off.

alias: holiday ON
description: ""
trigger:
  - platform: sun
    event: sunset
    offset: 0
    enabled: false
  - platform: numeric_state
    entity_id: sun.sun
    attribute: elevation
    below: -4
condition:
  - condition: state
    entity_id: input_boolean.holiday_automations
    state: "on"
action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id:
        - switch.holiday_front
        - switch.holiday_security
mode: single

i have no idea what caused this or any idea where to start debugging it…any ideas?

Could it be that some other automation is interfering with this automation (check under integrations and the switches if another automation is also using switch.zwjs_holiday_lights)

I had a similar issue but I changed from switch.turn_on to scene.turn_on - never had a problem since (maybe as a workaround)

Just to be clear, you can’t use the scene services to turn on switch entities directly, only scene entities that may contain switches.

I thought this might be the issue but the fact the switch is saying that the holiday automation is what turned it off (and the automation itself says the same thing) seems to indicate otherwise, no?

I do have another automation that controls the holiday light switch at certain times of day, but that wasn’t triggered at all any time near this. I did double check it at first to make sure.

I’m not sure I follow. I have two groups that contain switches, those are what I’m turning on and off here. it has worked flawlessly every night until tonight…and even tonight it was only an issue with that one switch out of seven.

I generated a scene with several switches / lights an this I turned on – instead of turning the switches / lights on in the automation – It seems that this approach was more reliable - sorry for the confusion I caused

I was just clarifying Thorn’s advice. Not saying it is good advice, or relevant.

okay then. any idea why this would be happening, or how i can fix it? or where to even start troubleshooting it? clearly based on the automation, it should not be doing this, but it did…

automation just ran for tonight, and as it has every other night this holiday season turned everything on without incident. it did not for some reason turn the holiday light switch off, as it did randomly last night.

I had an issue with Wemo devices where one device completely unrelated to the automation at hand would turn on or off. The integration evidently paid attention not to their mac addresses but to their IP’s and they were swapping each other’s IP’s (mean swapping IPs) whenever my router rebooted. I made every device in my home have a static assigned IP by my router - and my weird problems went away as well… Maybe something similar here? Did you reboot your router in between?

these are zwave devices, so I don’t think that would be a possibility here based on how zwave works. right? unless I’m misunderstanding how zwjs works (and zwave in general)…which is always possible.

I don’t have zwave devices -

anyone have any ideas on this? haven’t seen it happen since, so just that one time this entire holiday season…but still obviously something that I’d like to figure out why it happened and help get it fixed if it’s a bug.