Hi,
I have been trying to work out how to make it that at a set time of day my lights change colour without affecting if they are on or not (aka, if the light is on, Keep it on, If it is off, keep it off but change the colour). So far I have tried an automation from the Hue app and it always turns the lights off if they are on instead of simply changing colour. So I have tried to use NodeRed to do that. My approach so far is to query the status of the light (if it is on or not) and when sending a request to the light to change colour I send the state too.
If the light is on I will send {"on":true, colorTemp:"hot"}
And if it is off I will send {"on":false, colorTemp:"hot"}
Both will make the lights go to a warm white (as I want them to), But if they are off at the time (Not off physically) they will change colour a few seconds after they turn back on
I am not sure this is the same kind of problem as I once had.
My story.
Similar problem.
But the reason for the light came on bright for me then went to the desired brightness/colour is the bulb was set to a POWER ON SETTINGS..... Brightness / colour.
Then - a short time after - the settings are sent to it.
The only thing you could try is to get the bulb to boot to last condition.
But - there again - if you allow changes to happen when it is REALLY TURNED OFF, you will have the same problem again.
Not sure what would happen if it is only SOFT OFF and you allow changes.
OK, the light is powered up but is not "on".
So can you clarify the second part of that please? What message are you sending that makes it turn on and then a few seconds later change colour and what colour does it change from and to?
Add a debug node showing what you are sending to it to check it is what you think it is, and to check that you are sending only one message.
I have my lights to when they get hardware powerd on (when I turn them back on in the morning) They return to "Last state", Which is also what my dimmer switch and motion sensor do
This is what im trying to do, Change the colour while they are "Soft off" (Still have power but off in software) without actually turning them on if they are off
That's not the issue, just went on a bit of a sidetrack sorry. The lights, when turned on after losing power (by intentionally being switched off or something else), will go to the "last on state".
The issue I'm facing is when the light is already on, but I want it to go to a specific colour at a set time (say at 9:15pm it will fade from cool white to warm white). Currently (using the automation in the Hue app), the light will fade off and stay off (which is annoying when I am sitting at my desk) until I trigger the motion sensor on my PC or I use my stream deck or the dimmer switch (not a physical switch, it's a remote that turns it back on in software, doesn’t control the power to the lights) to turn it back on to warm white. But if the light is already off (say I haven’t been at my PC for some time and the motion sensor turns off the lights in software, or I turned them off via my stream deck), then they will turn on and go to warm white (like in the scenario I just listed).
What I’m trying to do is make the light fade from cool white to warm white at 9:15pm. If the light was off (in software), it should stay off, but when it turns back on, it should be warm white (not cool white like it was when it was last on). And if the light is on, it should just fade to warm white (but not turn off).
The image I put at the top is what I’ve done to get it to work how I want (sorta). The node off to the right is a debug node and does indeed show it firing correctly when the light turns back on (as if it was queued). I hope this clears it up.
I am not always good at explaining things the first time around.
I think that has been discussed before.
I kind of looked at it, but the use isn't critical for me and so I didn't follow it.
Suggestion/thought:
The second last paragraph is NEARLY what you want to do, but slightly badly worded.
(no offence.)
Sit down and try to write down what you are wanting it to do.
eg:
At 21:15 (if light is on) fade from cool white to cool white.
But you aren't qualifying WHEN it is turned back on.
After 21:!5 or the next day?
You will have to really REALLY work on the details and not leave problems like the one I just mentioned.
That may go a long way to helping you getting it working better.
Alas I would offer you more time but I am up to my eyes in rewriting 8 year old code.
And the problems I am finding are not fun to find.
(Sorry, I digress.)
What I want to do is as follows
So at 9:15pm it goes to warm white as mentioned
10pm it goes from what ever brightness (usally 80%) to 10-15% over the course of 30 mins
10:30pm - 6am (next day) the lights stay at Warm white 10-15% unless set otherwise (the go to "Last state"
6am - 9:15pm lights are cool white
During these times the lights can be turnt on or off by dimmer switch/Motion sensor/stream deck/Hue app but always go to last on state.
I want it set that the automation only changes the colour of the light and ignores if it is on or off, And the Dimmer/Motion sensor/Stream deck manage that
I have a couple of Hue lights that I run with zigbee2MQTT and there is a command
Moving/stepping
Instead of setting a value (e.g. brightness) directly it is also possible to:
move: this will automatically move the value over time, to stop send value stop or 0.
step: this will increment/decrement the current value by the given one.
The direction of move and step can be either up or down, provide a negative value to move/step down, a positive value to move/step up. To do this send a payload like below to zigbee2mqtt/FRIENDLY_NAME/set
NOTE: brightness move/step will stop at the minimum brightness and won't turn on the light when it's off. In this case use brightness_move_onoff/brightness_step_onoff
Is this not available via the Hue app or the nodes you are using?
As far as I know, this is a limitation of zigbee-controlled lights. They always come up with the last setting when they were turned off, and then comply to your msg.payload. If the color is red when you turned it off, and you turn it on with "color": "blue", it will start with red color, and then turn blue.
There is no direct way to switch the color (or color_temp) as long as the device is off.
I remember I read a post somewhere where people got around that limitation using scenes. Basically it worked like:
Invoke a scene while the light is on
Turn the light off while the scene is still active
What happens if you turn the light on say to a brightness of 0, which should be pretty much off then set the color , then up the brightness. A brightness of 0 is still on but no light. This assumes you never physically turn off power i suppose
I can only go to 1% as the lowest (lights still visiblly on a tiny bit) from my stream deck and the official app. I doubt the api will be much different
I thought it would be more of a light/bridge software limitation then a zigbee, After all, Zigbee is just a wireless mesh communication protocol isnt it. It's up to the software itself if you can change the lights colour value while its off (or queue a change for next time it turns on).
I run about 12 lights and for a long time i've set brightness to 0 on my lights . Do this for various reasons using function nodes and the lights seem to respond to the command just like you'd think