Philips hue lights not becoming unnavailable after cutting power to them

Helly, im having an issue where my lights won’t become unavailable if I cut power to them using a light switch, this is a problem for me because I want to make one or two automations to set the lights to off, if they are turned off with the switch (for statistic purposes, no other reason), and for them to set to a scene once they are given power again…

I have 3 light bulbs attached to one switch and am running the latest version of home assistant.

any help is very appreciated!

edit: I meant it wont become unavailable, I think this because I can still control them with home assistant even though they’re not getting any power and are off. Also the fact that my automation code trigger won’t work.

this is my automation code:

alias: Lights on
trigger:
  - platform: state
    entity_id: light.hue_color_lamp_1
    from: "on"
    to: unavailable
  - platform: state
    entity_id: light.hue_color_lamp_1
    from: "on"
    to: unknown
action:
  - type: turn_off
    device_id: 156650fdfe58ba998a82592215b0f269
    entity_id: light.hue_color_lamp_1
    domain: light
  - type: turn_off
    device_id: 9273fe8f26808e76e95c441a5a619b3a
    entity_id: light.hue_color_lamp_3
    domain: light
  - type: turn_off
    device_id: 58263e9aa35cbc945e44abf5742b3d8f
    entity_id: light.hue_color_lamp_4
    domain: light