I’m having an issue where I need to call light.turn_on
with a colour profile twice for the correct profile to be applied. This is using a TP-Link LB130 bulb. I can’t figure out whether I’m missing something in the docs, whether it’s an issue with the integration or the hardware.
My light_profiles.csv
looks like this:
id,x,y,brightness
normal,0.323,0.329,153
night,0.701,0.299,5
security,0.323,0.329,255
Say for example the last used profile was security
and the light is now off. If I turn it on passing (only) the night
profile as a parameter, I need to call the service twice for the light profile to be applied.
My use case is to have this light turn on as a night light after bedtime when motion is detected. The problem is that if it is turned on otherwise, the normal
profile gets used. Thus, when the night time automation is triggered the light turns on with the last profile used.
I can generally find little information on light profiles and would like to ask: Are light profiles my best option here?
I know I can use scenes (and have) but I have the same issue.
Here are my scenes:
scene:
- name: Normal Foyer Light
entities:
light.foyer_light:
state: on
xy_color: [0.323, 0.329]
brightness: 153
- name: Night Foyer Light
entities:
light.foyer_light:
state: on
xy_color: [0.701, 0.299]
brightness: 5
- name: Security Foyer Light
entities:
light.foyer_light:
state: on
xy_color: [0.323, 0.329]
brightness: 255
I’ve come across David’s post that says one can only use the attributes seen on the state object.
Here is my light’s state when on:
min_mireds: 111
max_mireds: 400
supported_color_modes:
- color_temp
- hs
color_mode: hs
brightness: 255
hs_color:
- 0
- 0
rgb_color:
- 255
- 255
- 255
xy_color:
- 0.323
- 0.329
current_power_w: '1.0'
daily_energy_kwh: '0.000'
monthly_energy_kwh: '0.018'
friendly_name: Foyer Light
supported_features: 19
icon: 'mdi:dome-light'
So then I try to use only what’s stated under supported_color_modes
. I tried using light.turn_on
specifying only hue-saturation but still the same issue: I need to call the service twice.
I’ve called light.turn_on
and scene.turn_on
directly from the dev tools UI, scripts and automations. None of this seems to matter.