Yeelight / Xiaomi lamp 2 full brightness

So, long time reader, first time poster… I have myself Home Assistant 0.106.5 running on a RPi 4. I also have 2 Xiaomi bedside lamps (amongst other things).

Here’s the thing: can never get the Xiaomi beside lamps (appearing as bslamp2 via yeelight integration in HA) to reach the full brightness when controlled via HA. The slider on the front of the lamp go to their fullest extent, BUT the lamps are not to the fullest brightness that they can get.

I know this because when directly controlling the lamps using the Yeelight App on the iPhone, I can get them to go much brighter than HA allows.

Here is a simple automation that I am using. This is triggered by a button press from another device:

device_id: da4xxxxxxxxxxxxxxxxxxxxxxxxxxxx
domain: light
entity_id: light.mibedsidelamp2_xxxx
type: brightness_increase

Now, to be clear, the button to brighten works… it just never gets as bright as it can be.

Any pointers to address this would be appreciated.

are you using the the built in automation editor? Where is “brightness_increase” coming from?
It looks like you are using the built in automation editor - can you show the ‘service’ and parameters the action calls. I suspect you are setting brightness to ‘100’ rather than brightness_pct to to 100…

The following automation would turn on your light to 100% brightness at sunset for example:

- alias: 'LIGHT: Turn on 45 mins before sunset'
  initial_state: true
  trigger:
    platform: sun
    event: sunset
    offset: -00:45:00
  action:
    service: light.turn_on
    data:
      entity_id: light.mibedsidelamp2_xxxx
      brightness: 255

Hi Jon,

Thanks for the reply. I am using the automation editor (just beginning on automations here).

So the trigger to the automation is a button press from a Philips Hue Dimmer switch (the 4 button rectangular). This Zigbee switch is connected via Deconz. The nice thing is that HA automation sees the Hue switch as a device and also knows the available button-press types, meaning I did not need to map Deconz events.

The automation triggered by a single DIM_UP press is as follows:

- id: '1583805736009'
  alias: SWT - BTN - DIM_UP - Bedside lamps
  description: ''
  trigger:
  - device_id: 0dbfxxxxxxxxxxxxxxxxxxxc8b
    domain: deconz
    platform: device
    subtype: dim_up
    type: remote_button_short_press
  condition: []
  action:
  - device_id: da41xxxxxxxxxxxxxxxxxxxcfdf
    domain: light
    entity_id: light.mibedsidelamp2_xxxx
    type: brightness_increase
  - device_id: 108cxxxxxxxxxxxxxxxxxxxda1
    domain: light
    entity_id: light.mibedsidelamp2_xxxx
    type: brightness_increase

I can see how the code you gave will set it to fullest brightness, but how can I incrementally get it there via DIM_UP button presses?

BTW, I do have a scene that does something similar to the code you presented:

- id: '1583805820933'
  name: Bright white - Bedside lamps
  entities:
    light.mibedsidelamp2_xxxx:
      state: 'on'
      brightness: 255
      friendly_name: Bedside Lamp 2

And this still does not give the fullest brightness that the lamps are capable of producing if controlled via the Yee app and not HA.

Thank you again.

Are you sure bslamp 2 is the right model? Accourding to the docs “If model is not specified, it will be guessed”. If you’re not sure try if changing the model helps.

Hi sjee,

Yes. I am fairly certain that the correct model is specified.

As far as I know HA added the lamps automatically after correctly identifying them.

If its of any consequence, HA added/identified the lamps as a HomeKit accessory. I typed in the HomeKIt code from each lamp.

Cheers.

HA adds the lamps after guessing the model which is something different as “correctly identifying”. Just give it a try.

Isn’t that something different as:

Ok… I found the way to get the lamps to full brightness … by combining both responses and changing a data point on the service call.

@sjee - I create a new entity for each of the lamps in my yeelight.yaml file. Declaring the IP address and model as ‘bslamp1’ for each.

  192.168.86.205:
    name: Bedside lamp 1
    model: bslamp1
  192.168.86.206:
    name: Bedside lamp 2
    model: bslamp1

I used these self-declared entities in the service calls… these calls had to be very close to what @walaj has suggested. But brightness: 255 was not enough to get it to the full white brightness I was after (and possible through the Yeelight app).

To do that, I had to declare kelvin as a service data attribute.

This is the service call that gets me the fullest brightness:

  action:
    service: light.turn_on
    data:
      entity_id: light.bedside_lamp_1 #the new entity created by declaring in yaml
      kelvin: 4000 #the only service data attribute that would give the fullest brightness

Thank you very much for your responses and help.

I think you are confusing color temperature and brightness.

Yup - a 4000 kelvin light will look “brighter” than a 2000 K light - because is it a colder/whiter/bluer light. But is actually the same optical brightness.

I hadn’t considered that HA might be detecting it as the wrong model.

Hey @sjee and @walaj . No I’m not confusing those two concepts. I understand them very well. I work in an industry that counts those two terms as trade words.

There certainly is a difference in the brightness output when declaring a white point or temperature change (kelvin: 4000) with these lamps rather than merely using a brightness change (brightness: 255).

I can get the same colour temperature when declaring brightness: 255 (roughly at least), but it seems like not all LEDs in the lamp are on. kelvin: 4000 seems to turn on all LEDs and keep it at roughly that same temperature as what brightness: 255 brings.

fair enough :slight_smile:
I suspect the output of the leds isn’t maximal until they are driven at the higher temperature.

Be aware there are also differences in the firmware that yeelight supply - although most of the differences are at low brightness (poor colour fidelity/redering)

The lamp has both RGB and white LED’s so is makes sense brigthness is related to color temperature.

Please set the topic to solved as it might help others facing the same issue.

Thanks, this helped me with my Yeelight YLDP02YL E27 9W RGBW bulbs as well, HA couldn’t set them to max brightness with the ‘brightness: 255’ option only, the Kelvin parameter helped.

Hello, I am having the exact same problem with the Yeelights being to too dim and the problem being related to setting Kelvin.

How did you manage to resolve this? I have read that you set it within the yeelight.yaml, but I dont seem able to find such a file. Really could do with some advice.

Thank you.

By the way, don’t you get a problem with Xiaomi Yeelight lamps that they get offline every few days/weeks?
This is not a HA issue because Xiaomi Home app reports the lamp as offline.