Hue Automation

Hi,
I have changed most of my lamps to Philips Hue.
They are controlled from the standard wall switches as I don’t think it is practical to have people use an app etc.
I have setup ‘power on behaviour’ so they each room defaults to a certain colour temperature but this does not work very well.
Has anyone setup an automation to change the colour of the lamps based on when they are switched on?
e.g. When living room lamp goes from off to on the change the colour etc to XYZ, this would effectively simulate the power on behaviour set in the Hue app.

Thanks for any help.

If standard wall switches are being used to turn off the Hue lights then it implies they are not simply being turned off but are being de-powered and therefore become inaccessible on the Zigbee network (i.e. can no longer be remote-controlled). In that situation, their state appears as unavailable in Home Assistant as opposed to off.

Is that how they behave in your home?

If it is then the automation you create would use a State Trigger that detects when the light’s state changes from unavailable to on (as opposed to from off to on).

Thanks for the input and yes you have got the application spot on.

Ok, so just create the automation I suggested which triggers when any of your Hue lights changes from unavailable to on and its action simply set the light’s color state (brightness, color, etc).

If you want each light to be set differently then the action will need to use a choose to handle each one separately. Let me know if you need help composing it.

Got it working using the below automation.
I cannot seem to get it to work from a state of unavailable to on as it doesn’t seem to recognise unavailable as a state.
There is a slight delay to select the correct colour.

Thanks for the help.

id: '1620110869104'
alias: Bathroom Light Power Recovery
description: Bathroom Light Default Colour After Switched On
trigger:
  - platform: state
    entity_id: light.bathroom_1_bath
    to: 'on'
    for: '00:00:01'
condition: []
action:
  - scene: scene.bathroom_default_light_colour
mode: single