Ikea lights set brightness 0% when turned off, makes them remember that as last state when turned on again

Lately, I think since HA 105, many of my Ikea lights dont use the last brightness setting when turned on (either by the motion sensor/switch or Ha interface) in the morning. They now turn on with brightness 0%… which is really annoying when you expect your bathroom to be safely lit ;-((

I am completely puzzled, since I havent changed anything in my Ha settings, and don’t believe the Ikea hub/software has changed settings on this functionality.

Could it be HA changed something when turning off lights? Could it be somehow now HA sets brightness to 0% when turning off, making the last recorded brightness 0% when turning on again?

for full disclosure, this is my script I use when set to sleep mode:

slapen_lighting:
  alias: Slapen lighting
  sequence:
    service: light.turn_off
    data_template:
      entity_id: >
        {% if states('group.h') == 'not_home' %} group.all_inside_lights
        {% else %} group.all_main_inside_lights, group.plafond_spots_woonkamer
        {% endif %}
      transition: 6

would it make a difference if I used this scene instead:

- name: Slapen
  entities:
    group.all_inside_lights: off

Sorry for the long topic title, but I would hope this to catch best what is happening. If anyone has a useful tip, Id appreciate it. Thanks!

edit

just thinking, could it be that the transition to ‘off’ makes the lights record the last brightness to be 0%? I used to have the transition in the scenes, but since that functionality unfortunately was taken from us, had to rewrite all my scene into scripts with transition.

By setting transition of 6, you are telling it to dim from current brightness down to 0% in 6 seconds.

Oh, yeah…your edit is right.

ok, but then how to go forward with this…

If I don’t want to cut the lights off immediately, but also want them to simply turn on in the morning…this would warrant the re-introduction of transition for scenes alone!

DEFAULT TURN-ON VALUES

To set the default color and brightness values when the light is turned on, create a custom light_profiles.csv (as described below in the profile attribute of light.turn_on ).

The .default suffix should be added to the entity identifier of each light to define a default value, e.g., for light.ceiling_2 the id field is light.ceiling_2.default . To define a default for all lights, the identifier group.all_lights.default can be used. Individual settings always supercede the all_lights default setting.

I think you should do this.

You can still override the defaults for times when you don’t want to turn them on to full brightness with the service call, but if you want the lights to turn on to a known state when you simply say “light.turn_on”, try this.

yeah I can try that, but this wont work when the Ikea motion sensor to which the light is coupled turns the light…It is a direct Ikea communication, and has nothing to do with the ha settings

remembering this 0.101: Airly, Apprise, Sinch, Solar-Log, Microsoft Teams when Balloob mentioned the transition would maybe come back. Please @balloob, forgive the tag, but could my issue here be caused by this? Im perfectly willing to issue this as a bug if must be, but rather be sure before I do so.

Hue lights are triggered from the Hub with a specific brightness setting so dont suffer from this. Ikea lights are not, and simply turn-on with the last brightness setting. Which is 0% if turned down with a transition in the script.

before the transition in the scene didn’t cause this to happen.
Thanks for having a look.

Hmm, fair enough.

How many of those motion/light combos do you have? You could move them to a different group and just have them turn off. Or remove the bathroom light from the main group…I assume you have that one turning off automatically anyway?

I’d have to think of a good way. You could set an automation that triggers when the bathroom light turns on and set the brightness to 100%…but that would remove your ability to turn it on to any other brightness.

But these all sound like janky workarounds to me and not ideal.

many… all my rooms with Ikea lights have a motion sensor (some even 2) and a remote switch. They all use the last brightness.

sure, but simply turning them off is not what I want, I want the transition, (and not kill the turn-on brightness)

yeah, agree :wink:
it did work flawlessly though…remarkable thing is, many of these lights are not even ‘on’ when this script is used. Apparently, while being ‘off’, this transition sets their brightness to 0% too? Maybe it isn’t the change in Scene integration after all, and has something else changed that could cause this.

@ggravlingen would you know of a way to get this working again? We’ve talked before about remote resetting the Hub , but this is an issue of a different kind.

remarkable thing is, many of these lights are not even ‘on’ when this script is used. Apparently, while being ‘off’, this transition sets their brightness to 0% too

You can fix that part at least by only selecting lights that are on…but that wont fix your real problem.

slapen_lighting:
  alias: Slapen lighting
  sequence:
  # Only bother if there is at least one light on.
  - condition: template
    value_template: "{{ expand(states.group.all_main_inside_lights) | selectattr('state','eq', 'on') | list | count > 0}}"
  -  service: light.turn_off
     data_template:
       entity_id: >
         {% set ns = namespace(group=[]) %}
         {% if is_state('group.h', 'not_home') %}
           {% set ns.group = expand(states.group.all_inside_lights) %}
         {% else %}
           {% set ns.group = expand(states.group.all_main_inside_lights) + expand(states.group.plafond_spots_woonkamer) %}
         {% endif %}
         {% set all_lights = 
         {{ ns.group | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list | join(',') }}
       transition: 6

yeah, I thought about that, and although it wont solve the real issue, it wont hurt to do it anyway, thanks for the suggestion and template!

Changed it a bit like this:

slapen_lighting:
  alias: Slapen lighting
  sequence:
    service: light.turn_off
    data_template:
      entity_id: >
        {% set ns = namespace(group=[]) %}
        {% if is_state('group.hanna', 'not_home') %}
          {% set ns.group = expand(states.group.all_inside_lights) %}
        {% else %}
          {% set ns.group = expand(states.group.all_main_inside_lights) + expand(states.group.plafond_spots_woonkamer) %}
        {% endif %}
        {% set all_lights_on =
         ns.group | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list | join(',')  %}
        {{all_lights_on}}
      transition: 6

(select ‘on’ instead of your ‘off’, and solve an issue at the end with the set all_lights_on)

Time to buy a conbee?

no. wouldn’t know why… Had one and returned it, too much issues and trouble configuring.

I found the IKEA hub far to limiting and slow, very very slow

limiting maybe (they dont allow for default brightness/color settings like the Hue, but speed is fine here, and I have many lights so really use the hub to its full extent

I thought there was a limit of 50 devices, I found it slow to react before I got that limit.

getting back to this, what would this file light_profiles.csv contain?
eg:

group.all_inside_lights.default:
  brightness: 144

or what Ive read elsewhere, like:

group.all_inside_lights.default,0.5119,0.4147,219

It is a CSV with the following (id,x,y,brightness)

group.all_inside_lights.default,0.5119,0.4147,219

Where x and y are

xy_color yes A list containing two floats representing the xy color you want the light to be. Two comma-separated floats that represent the color in XY. You can find a great chart here: Hue Color Chart.

1 Like

thanks! that looks identical :wink:

would it be safer to use

group.all_inside_lights.default,0,0,219

since not all lights support colors? This being a generic default it needs to fit both colored, warm white, and white lights

Yeah, whatever you want the default. I just copied the ‘relax’ profile from the defaults lol.

one more to help please:

if I set it for the group.all_inside_lights.default, will it also work if I turn on an individual light, which is a member of that group?

Or would I have to set it for all lights individually also.
I tried it just now, but it didn’t yet work as expected…even worse:

2020-02-21 23:11:08 ERROR (SyncWorker_1) [homeassistant.components.light] Error parsing light profile from /config/light_profiles.csv: None
2020-02-21 23:11:08 INFO (MainThread) [homeassistant.setup] Setup of domain light took 8.6 seconds.
2020-02-21 23:11:08 ERROR (MainThread) [homeassistant.setup] Setup failed for light: Integration failed to initialize.