Hue lights will not transition to on but will to off

Hi,

First post so please take it easy :slight_smile:

I have a basic HASS setup which is connected to my Philips Hue set up - v2 bridge with some white only bulbs.

I have set up some automation as per the HASS example to power on my lights an hour before sunset. This works fine.

automation:
alias: Turn on light when sun sets
trigger:
platform: sun
event: sunset
offset: ā€œ-01:00:00ā€
action:
service: light.turn_on
entity_id: group.living_room
data:
# 900 seconds = 10 minutes
transition: 600

I have added the example code line to add a transition time to on but this does not work - the lights come on to full brightness straight away. I have tried changing this to various times with no change in result.

I have tested the transition using the following JSON:

{
ā€œentity_idā€: ā€œgroup.living_roomā€,
ā€œtransitionā€: ā€œ30ā€
}

This works fine for Light/turn_off but for Light/turn_on turns the lights on to full brightness with no transition.

I know the bulbs support transitioning to on as if I set this up as a routine in the Hue app it works as expected.

Any suggestions will be greatly welcomed!

not sure if this affects this but thinking about your problem I came up with the following:

Maybe its overwritten by the hue bridge because it turns on the lights on with last known state (brightness) which most likely was 100%.

You should try and play with the brightness a bit, see if that works.

The problem is that light.turn_on automatically takes it to the last state when it was on. Just like if you had switched it on in the Hue app.
One workaround would be to create a script that turns the light on at minimum brightness and than transitions to the desired value. You would then call the script with script.turn_on in your automation. It would look something like this:

script:
  wakeup:
    alias: sunset on
    sequence:
      - alias: Living Room Lights On
        service: light.turn_on
        data:
          entity_id: group.livingroom
          brightness: 1
     - alias: Living Room Light Transition
        service: light.turn_on
        data:
          entity_id: group.livingroom
          brightness: 200
          transition: 600

IĀ“m using a scene where I donĀ“t have to turn them on with lowest brightness first.

name: "Licht einfaden"
entities:
  light.hue_color_lamp_1:
    state: on
    transition: 900
    xy_color: [0.4586, 0.3824]
    brightness: 254
  light.sideboard_led_streifen:
    state: on
    transition: 900
    xy_color: [0.1295, 0.0492]
    brightness: 254
  light.hue_iris_1:
    state: on
    transition: 900
    xy_color: [0.1444, 0.1494]
    brightness: 254

If the lights are off, does it transition from off to those scenes? My experience has been that transition only works if they are already on and you want to transition to another state.

1 Like

Thanks for the suggestions here.

The explanation that Hue revertst o the last used brightness seems to apply to me as if I set the brightness at 50% via the Hue app and then test my automation it switches the ligths straight on to 50% brightness.

Let me have a play with a script when I get some time and I will report backā€¦

IĀ“m not quiet sure since iĀ“ve been tinkering around with this a while ago. IĀ“m using the scene above to slowly turn on my light every evening. To be honestā€¦ IĀ“m not quiet sure if it actually use the transition. IĀ“ll check this later :wink:

EDIT: Working fine :slight_smile:

Hi,

So I finally found some time to play with this and added a script as below. Sadly, this has the same behaviour - lights come on an hour before sunset, but at the last set brightness with no transition to full brightness.

I also tested FallenLeaves config where I added a specific brightness to my previous config and that also did not work for the transition.

My current configuration looks as follows, any further ideas would be appreciated.

Thanks!

script:
   wakeup:
    alias: sunset on
    sequence:
      - alias: Living Room Lights On
        service: light.turn_on
        data:
          entity_id: group.living_room
          brightness: 1
     - alias: Living Room Light Transition
        service: light.turn_on
        data:
          entity_id: group.living_room
          brightness: 200
          transition: 600

automation:
  alias: Turn on light when sun sets
   trigger:
    platform: sun
    event: sunset
     offset: "-01:00:00"  
  action:
    service: script.turn_on
    entity_id: script.wakeup

THe lights are turned on via the hue api, so please check the settings for each bulb in the offical hue app, there you can change the amount of brightness each bulb should have when turned on. Try to put that low, and use transition in your action.

Maybe that works, just a try I dont know for sure

Thanks again. I had checked that and tried setting that at various levels, but the automation always then brings the lights straight on to that level of brightness ignoring the transition. If my script is correct that should force the brightness to level 1 and then fade up over time.

Iā€™ll park this for now until I have some more time to check. I now have a bigger issue in that I upgraded my all-in-one pi Hass today and now canā€™t confirm it is running or access the front end!

Hi,

Just checking back to say I managed to resolve this by using a scene setting that has the required transition and then calling that as part of the automation.

My config looks a little like this:

    scene:
  - name: Livingroom fadeon
    entities:
        light.Living_Floor_Lamp:
            state: on
            transition: 300
            brightness: 255
        light.Living_Room_Unit:
            state: on
            transition: 300
            brightness: 255            

automation:
  alias: Turn on light when sun sets
  trigger:
    platform: sun
    event: sunset
    offset: "-01:00:00"  
  action:
    service: scene.turn_on
    entity_id: scene.livingroom_fadeon

Hope this might help someone else in the futureā€¦

2 Likes

brilliant, just what i was looking for thank you!

Here is what I ended up using

  alias: 'morning sun wakeup'
  trigger:
    platform: time
    at: "05:30:00"
  action:
    - service: light.turn_on
      entity_id: light.bedroom
      data:
        brightness: 4
        color_temp: 454
    - delay: "00:00:01"
    - service: light.turn_on
      entity_id: light.bedroom
      data:
        brightness: 211
        color_temp: 332
        transition: 900