Setting Hue light to default brightness

Hello there,

I’m trying to get my son’s Hue to power-on at default value 10% instead of 100% at night. Problem here is that he’s used to switching it on and off via the lamp switch and not the Philips remote.

I’ve been trying to get it to work via this automation but it does not seem to work, what am I doing wrong ?

- id: a_lights_settings_lohann
  alias: Lights Settings Lohann
  trigger:
  - platform: state
    entity_id: group.lumieres_lohann
    from: 'off'
    to: 'on'
  action:
  - service: light.turn_on
    entity_id: light.hue_ambiance_candle_1
    data:
      brightness: 10

For infos, I have a RP3 with hass.io installed via Docker.

Any help is appreciated !

I think the problem you’ll have here (I’ll happily stand corrected) is that when you switch a hue bulb off at the mains it will always come back at 100% when the power is reconnected.

So regardless of what you do in HA it will be on at 100% initially, and then I suspect that with your method described above HA is sending the signal to dim it as soon as it’s being switched on, but that the bulb is still initialising and doesn’t accept the command.

You could add a short delay, so that it does dim after being switched on, but I don’t think you’ll be able to stop it going to 100% for a second or so when first switched on.

Reconfiguring your son is the best solution for this one :smile:

You can’t program a default brightness directly in the lamps with hue when flipping the switch for power. But as you’re doing with your automation you should be able to turn it on with HASS at 10%. Have you searched the forums?

Is ut the trigger or action that doesn’t work?

Stick a dash button over the top of the real switch.

Thanks for all the feedback, I think I will try the delay first and test it. I already have a Philips remote but it’s too many buttons for my 6 years old son especially when he’s switching it on half asleep.

I’ll post feedback on the results of the delay if it works!

It takes some time for a light to reconnect to bridge after the power is on.
It takes 30 seconds between polls for hass to know when a hue light has gone live.

So if your automation is based on any light in the group turning on after power has come back to that light, I think you need another solution. Because it will take up to 30 seconds to trigger the automation.

Or am I misunderstanding the whole thread? :slight_smile:

No, you are right, it takes time for Hass to reconnect the lights so I does not work. If it was 1 second I could do with ith but 30 secs is too much.

A dash button might do the trick after all.

I’ve read about the dash button and there’s also a slight delay that might be a bit too much afterall…

Has anyone got any ideas of an alternative that might work ?

I think you can use set scan_interval to speed up the reconnecting issue and trigger at brightness level. This way the automation will trigger as soon as HA reconnect to the light.

Change gateway to something that doesn’t require polling updates. But you won’t get away from the initial issue of delay from powered off devices takes some time to reconnect as well

Perfect, I’ve changed the scan_interval value to 10 secs and it’s fine. The default brightness is not that much for a few seconds and the automation triggers as soon HA reconnect without adding any additional delays.

Thanks for the feedback !

looking for exactly that i was wondering if you could share your automation? I have an outside light that is taken off the grid by a light sensor, and it always starts 100% when it gets reconnected. I have a customization to nit show it when unavailable, but would like to adjust as you’ve described when powering on.

thanks!
Marius

—edit-----

fwiw, this made it working correctly, although the original automation set the light when triggered manually, I’ve changed it to be in line with the documentation and have entity_id under data:, and, what i suppose to be the reason for succes now, is a longer wait time:

  - id: Set Driveway light
    alias: "Set Driveway light"
    initial_state: 'on'
    trigger:
      platform: state
      entity_id: sensor.driveway_reachable
      to: 'True'
      for:
        seconds: 20
    condition: []
    action:
      - service: light.turn_on
        data:
          entity_id: light.driveway
          hs_color: [36,66]
          brightness: 130
          transition: 5
      - condition: state
        entity_id: input_boolean.notify_notify
        state: 'on'
      - service: notify.notify
        data_template:
         message: '{{as_timestamp(now()) | timestamp_custom("%X") }}: Driveway is safely lit.'

---- end edit----

ive been testing with this, but the light isnt set accordingly, and set to full brightness at start and stays like that. I am making any obvious mistakes here:

  - id: Set Driveway light
    alias: "Set Driveway light"
    initial_state: 'on'
    trigger:
      platform: state
      entity_id: sensor.driveway_reachable
      to: 'True'
      for:
        seconds: 5
    condition: []
    action:
      - service: light.turn_on
        entity_id: light.driveway
        data_template:
          hs_color: [36,66]
          brightness: 130
          transition: 5
      - condition: state
        entity_id: input_boolean.notify_notify
        state: 'on'
      - service: notify.notify
        data_template:
         message: '{{as_timestamp(now()) | timestamp_custom("%X") }}: Driveway is safely lit.'

the trigger sensor is actually working and set to True or False

Check this out it should do the trick…

thanks, will have a look!

in the mean time I have adapted my automation to a longer timespan for the lights to be reachable, and also, added a condition the light itself had to be on, which was a bit of an issue in the implementation of Hue lately…
this way I am sure al is ok (checking the sensor is a rest_sensor reading of the Hub directly, the on-check is for the lamp in the Hassio setup) , and the automation kicks in:

 - id: Set Driveway light
    alias: "Set Driveway light"
    initial_state: 'on'
    trigger:
      platform: state
      entity_id: sensor.driveway_reachable
      to: 'True'
      for:
        seconds: 30
    condition:
      condition: state
      entity_id: light.driveway
      state: 'on'
    action:
      - service: light.turn_on
        data:
          entity_id: light.driveway
          hs_color: [36,66]
          brightness: 130
          transition: 5
      - condition: state
        entity_id: input_boolean.notify_notify
        state: 'on'
      - service: notify.notify
        data_template:
         message: '{{as_timestamp(now()) | timestamp_custom("%X") }}: Driveway is safely lit.'

other bulbs are capable of this (I had the same issue and came across this post via google)
So this doesn’t solve your problem directly (also looking at the thread age) but might give some input for others who also find this thread.

By chance I got hold of the following lamps from a German “quality light manufacturer” (even though these lights seemed to be bought in / are made in China…)… But they have this feature out of the box that after power loss (in my case using “normal” light switches ) they restore to the last set value. This really is a game changer in real world scenarios.

BEGA LED-Leuchtmittel · BEGA
Bega 13557 LED-Leuchtmittel für E27 2700K-6500K . - Tandmore.de