Light status wrongly reported after switching by automation

Home assistant keeps reporting the state of several lights wrongly after being switched by an automation.
I have 6 lights that are being switched by a simple automation that triggers after sunset and sunrise.
After sunset the lights are switched on by an automation, home assistant changes the state from “off” to “on” correctly, after sunrise another automation switches the lights off but home assistant keeps showing the lights as “on”. Even though the lights are physically off. If I manually switch the lights off the state is correct again.
Weird thing is that one of those six lights does not show this issue.

This is the sunset automation;

alias: Outside lights - switch on at sunset
description: ""
trigger:
  - platform: sun
    event: sunset
condition: []
action:
  - type: turn_on
    device_id: 828fda7378c7dd1aa353999264167360
    entity_id: light.outside_lights_path
    domain: light
    brightness_pct: 85
  - type: turn_on
    device_id: bc36ff10eb8ca416cec50d31f6c9a41c
    entity_id: light.outside_lights_front
    domain: light
    brightness_pct: 85
  - type: turn_on
    device_id: 170b2469e9b81e115e2f1a9c00d5f509
    entity_id: light.outside_lights_driveway
    domain: light
    brightness_pct: 85
  - type: turn_on
    device_id: 09119ece5b928381dabe8bbf5895302a
    entity_id: light.outside_lights_back
    domain: light
    brightness_pct: 85
mode: single

And this is the sunrise automation;

alias: Outside lights - switch off at sunrise
description: ""
trigger:
  - platform: sun
    event: sunrise
condition: []
action:
  - type: turn_off
    device_id: 828fda7378c7dd1aa353999264167360
    entity_id: switch.outside_lights_path
    domain: switch
  - type: turn_off
    device_id: bc36ff10eb8ca416cec50d31f6c9a41c
    entity_id: switch.outside_lights_front
    domain: switch
  - type: turn_off
    device_id: 170b2469e9b81e115e2f1a9c00d5f509
    entity_id: switch.outside_lights_driveway
    domain: switch
  - type: turn_off
    device_id: 09119ece5b928381dabe8bbf5895302a
    entity_id: light.outside_lights_back
    domain: light
mode: single

This issue does not affect the functionality of the lights, they physically switch on and off perfectly each day but it does mess up my dashboard making it an annoying issue.
Did anyone have this same issue and is there a solution?

How come you are switching on a light entity but switch off a switch entity? The one that works is probably the one where you actually switch off the light entity?

Wow, how could I have missed that :scream:. I see that now to, and the one light that does report the right status is being switched off as a light entity indeed.
I’ll update the automations and let you know tomorrow if that solved it.

I assume these are created using the GUI and not by hand - that unfortunately means weird things like this can happen. Once you get your head around things you may find manually creating automations better.

True, I created these automations through the GUI when I started working with Home Assistant over 1,5 years ago.
Anyway, all automations ran their course throughout yesterday evening and this morning and I’m finally freed of the faulty status. Thanks for the help