Firstly, say you have a light with a .default profile in light_profiles.csv. The default is applied when the light is turned on - even if the light is already on. I discovered this when I mistakenly asked a voice assistant to turn on a light that was already on, and the light changed back from my manual setting to the default.
I think it would be preferable for the .default profile to be applied only if the light was off. It’s not just mistakes that cause the issue - it’s making some of my automations more complicated (i.e. automations that turn lights on need conditions to ensure they’re not already on)
Secondly it would be great if light_profiles.csv supported color_temp. Bulbs such as Hue Ambient don’t support x,y colours.
Not as far as I can see. I think it would need a change to light_profiles.csv to add an option for color_temp as well as x and y.
I’d like to see much more sophisticated default lighting control that would allow almost any parameters and even vary by time of day (to set, for example, a warmer light by default in the evening). I’m working around it with an AppDaemon automation that responds to lights being switched on and then basically picks values from a lookup table.
I’m trying to do that also in PYSCRIPT.
It works… but …
I trigger the light when it’s turned on and do a light.turn_on again, with my ‘default’ attributes.
so, actually, the light is turned on twice… but it works…
Turning a light off with default attributes (transition time), doesn’t work … like I can only change the transition time, and the light is turn off fully, before the “new” turn off command with another transtion time arrives I guess.
I also like to see a more sophisticated lighting control as you explain…
That’s how mine works as well. Although the second call is light.turn_on it’s probably easier to think of it as just changing the settings. If you’re listening for the turn off command, then you’re right - the second turn off will be ignored because the light is already off. Personally I don’t worry about that one - the important thing for me is to have the light change when it’s turned on.
I’ve set low brightness values in light_profiles.csv so that when the light first comes on it doesn’t matter how it was last set - the light will come on dim, and then my automation will adjust it to my chosen values.
thanks!
I program is pyscript (not python_script)… Looks “cleaner” and can do approx. the same as appdaemon…
I wish the light_profiles get changed … It’s a pitty we can no specify WHITE (color temp) colors.
For now, I’m going to make something similar as what you did…
thanks