Yes I am talking about nightlight mode.
I tried with the configuration that you see and with bslamp2 but no “extra” light appears in my devices.
Yes I am talking about nightlight mode.
Bslamp2 isn’t declared as a model in the component yet. Bslamp1 is declared so using that in config.
Same issue as @acme. No nightlight light switch appears.
Another issue I’m seeing is only two effects showing on my ceiling1 lamp. I think these are temp effects (stop and slow temp).
It doesn’t matter its not declared in component, model in component, is only used to override bulb type auto detection, in case of some weird problems. bslamp2 is declared in underlying library, so it should be able to force nightlight support ( https://gitlab.com/stavros/python-yeelight/blob/master/yeelight/main.py#L40 )
Seeing only 2 effects for ceiling1 is expected, it doesn’t support any other effects.
Tried bslamp2 with switchtype light and only got a binary sensor.
And my ceiling light has a bunch of effects in the yeelight app just like the yeelight color bulbs.
So to make nightlight switch work please try this:
install https://gitlab.com/stavros/python-yeelight and from python console:
bulb = Bulb("192.168.x.x")
bulb.get_properties()
bulb.bulb_type
And paste output. Maybe it will show something why it doesn’t register switch, but register binary sensor.
As for effects, in HA there is no built in effects, from yeelight App. The ones that are predefined, uses RGBTransition, which is not supperted by ceiling light. Yeelight app defines different effects per defive. For example color bulb uses rgb transition, while ceiling3 albo 4 uses temperature only transition. In yeelight app, both lights got effect names Sunrise, but under the hood its different effect ( using different transitions ).
You can write custom effect, and it will be shown in ceiling1 ( only HA predefined effects, are filtered, custom ones are all shown in all yeelights ).
bslamp2: looks like the library isnt detecting model correctly and defaulting to color. HASS component is not detecting device type and defaulting to white instead of color.
Could it be that this is the only color light with a nightlight and the hass component code needs to be updated? @Michal_Ciemiega
Cannot determine device type for 192.168.31.60, Bedroom Bedside Lamp. Falling back to white only
bulb.get_properties()
{‘power’: ‘off’, ‘bright’: ‘64’, ‘ct’: ‘3003’, ‘rgb’: ‘8323327’, ‘hue’: ‘270’, ‘sat’: ‘100’, ‘color_mode’: ‘1’, ‘flowing’: ‘0’, ‘delayoff’: ‘0’, ‘music_on’: ‘0’, ‘name’: None, ‘bg_power’: None, ‘bg_flowing’: None, ‘bg_ct’: None, ‘bg_bright’: None, ‘bg_hue’: None, ‘bg_sat’: None, ‘bg_rgb’: None, ‘nl_br’: ‘0’, ‘active_mode’: None, ‘current_brightness’: ‘64’}
bulb.bulb_type
<BulbType.Color: 1>
bulb.get_model_specs()
{‘color_temp’: {‘min’: 1700, ‘max’: 6500}, ‘night_light’: False, ‘background_light’: False}
flash notify:
custom_effects:
- name: 'Notify'
flow_params:
count: 6
transitions:
- TemperatureTransition: [4000, 600, 70]
- TemperatureTransition: [4000, 400, 1]
I’ve made PR with support for color lights, with nightlight mode. Please test it and report if it works. I don’t have how to test it: https://github.com/home-assistant/home-assistant/pull/30194
Download while yeelight dir, from this branch, and put it into custom_components dir. Then restart HA and verify in logs, that you are using custom version of yeelight.
https://github.com/home-assistant/home-assistant/tree/97dd9d7e00e83dc75349a98187a085eb3c740706/homeassistant/components/yeelight
The nightlight light is appearing but not behaving correctly.
Turning on works but changing brightness of nightlight results in the main light brightness changing and the nightlight turning off. Also, the nightlight turns off since night light
false doesnt change to true.
Turning off doesn’t seem to work.
Paste output from
bulb.get_properties()
While light in nightlight and in normal mode.
EDIT: I’ve pushed some changes, from previous paste, it looks like it behaves differently than ceiling light. Update all files from here are test if it works: https://github.com/zewelor/home-assistant/tree/add_support_for_color_light_with_nightlight/homeassistant/components/yeelight
Well now it works better but brightness change on nightlight still changes brightness of main light.
Turning on/off is working fine now.
Official SDK doesn’t say anything about special nightlight brightness handling for color lights. Maybe its not possible to change brightness, while in nightlight mode, for that lamp ? Is it possible do change it via official app ?
EDIT: I’ve pushed change, to remove brightness control capability for that nightlight. If its possible somehow, we can add it later. At least there will be some basic support for now. Please test if now everything works correctly.
nl_br seems to be fixed at 1 for bslamp2 when in nightlight mode. changing nightlight brightness from app (with moon icon brightness slider) sets nl_br to zero and the current brightness changes.
So it seems you are right, this lamp doesn’t support brightness change of nightlight mode in its current firmware. Could be a firmware bug since the app shows ability to change moonlight brightness.
Thanks for checking. Can you test latest code, from link above and confirm everything works fine and it can be merged into HA?
Looks good to me.
Is there any way to limit requests to a ceiling light?
I press button 3-5 times and I get
2020-01-15 21:41:43 ERROR (SyncWorker_9) [custom_components.yeelight] Unable to update device 192.168.1.182, yeelight_ceiling1_7c49ebb38056: {'code': -1, 'message': 'client quota exceeded'}
Weird. Yeelight forums says that the limit is 60command/minute.
My script:
'1579119183994':
alias: Ikea Remote - ColorTemp cold Group 1
sequence:
service: light.turn_on
data_template:
entity_id: light.yeelight_lights_1
transition: '1'
color_temp: "{% if not state_attr('light.yeelight_lights_1', 'color_temp') ==\
\ None %} {% set n = state_attr('light.yeelight_lights_1', 'color_temp') -\
\ 25 %} {% if n > 370 %}\n 370\n{% else %}\n {{ n }}\n{% endif %} {% else\
\ %} 153 {% endif %}"
Hi just got YLXD01YL any update on how to best integrate?
@ Klagio
i tried it also but the integration didn’t discover it.
I add to the configuration.yaml the following and HA “found” it
yeelight:
devices:
192.168.1.46:
name: Bedroom Ceiling Light
Hi with a restart it worked without mod in configuration.
Sometimes works only putting in the single ip host address