What happens if you flip the light switch manually during the transition or if you send another command to the light during the transition?
Not sure.
Keep in mind that not lights implement the transition:
parameter. There’s a pretty lengthy thread about it here:
I ask because the popular GE Z-wave wall switches do not implement the transisitoon:
parameter, so the only way to do a slow fade is to do something like in my post above or what I actually ended up doing is through a python script.
I want my bedroom lights to fade-on over 30 min when I have to wake up before sunrise. However, sometimes I wake up before the fade is done or I decide not to get up and shut off the light - so I had to do some special handling that if the light was changed in any way outside the script, the script would abort.
Yes, not all lights might support the transition feature. Note on that thread that @ha_steve linked to, there’s also a reply about using a delay for it to work:
oh, cross posted. See my reply above. That might be the reason.
The delay that is talked about there is part of the z-wave config parameters for the device, so if you wanted to do it that way, you’d have to send z-wave commands to configure the switch, then send them again afterwards to put it back to normal. Otherwise it will keep doing all turn on turn offs slow.
The slowest you can do is 99 steps at 2.55 seconds per step or just over 4 min.
HOWEVER, all of this is moot with the GE switches because… they respond to the brightness:
parameter immediately regardless of the delay/step settings. So you can’t specify a brightness and have it “fade” to that, it will immediately jump.
In any case, I would recommend to the OP, if they have the inclination, to do it programmatically as it avoids any limitations of the particular switch/light manufacturer’s implementation
Hmm have a Little problem with the light increase
I have buy a Nexa EYCR-201 (I running 433Mhz Tellstick) and what I have read it have 8 level of the dim.
So if I do 255/8 it give me about 32 so if I do 8 settings of Brightness like 0,32,64,96,128,160,192,255 and a delay about 10 sec, is that a good idea?
I don’t think anyone can answer that for you… just try it.
rsuplido:
I did do that you show but it feel that the light go up and down all the time.
LIke my Turn on Schedule is sending ON and ON and ON.
I created a workflow in Node Red that works well and you can set it up as you wish, such as;
- Set maximum brightness
- How long it takes from 0% brightness to maximum% brightness
- With smaller steps the transition goes smoother, with a higher value in steps the transition becomes less smooth
The message (flow) stops when maximum value is reached.
Copy and import:
[{"id":"679982.70cd368","type":"api-call-service","z":"39fbc49a.b7c3dc","name":"","server":"8e9ec046.8c74c","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.achtertuin","data":"{\"brightness\":\"{{count}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":870,"y":945,"wires":[[]]},{"id":"a2a12bec.9bad88","type":"inject","z":"39fbc49a.b7c3dc","name":"Start Trigger","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":265,"y":855,"wires":[["58a8653d.e2420c"]]},{"id":"58a8653d.e2420c","type":"counter","z":"39fbc49a.b7c3dc","name":"Step = % Brightness","init":"0","step":"5","lower":"0","upper":"100","mode":"increment","outputs":"1","x":490,"y":870,"wires":[["570bc7d1.a59968"]]},{"id":"4158e8e7.92cb48","type":"stoptimer","z":"39fbc49a.b7c3dc","duration":"2","units":"Second","payloadtype":"num","payloadval":"0","name":"Transition time also depends on the step value.","x":555,"y":945,"wires":[["58a8653d.e2420c","679982.70cd368"],[]]},{"id":"570bc7d1.a59968","type":"switch","z":"39fbc49a.b7c3dc","name":"Brightess Maximum","property":"count","propertyType":"msg","rules":[{"t":"lte","v":"100","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":720,"y":870,"wires":[["4158e8e7.92cb48"]]},{"id":"6d383a33.5f8274","type":"inject","z":"39fbc49a.b7c3dc","name":"Stop Trigger","topic":"","payload":"STOP","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":265,"y":900,"wires":[["58a8653d.e2420c"]]},{"id":"8e9ec046.8c74c","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]
@xx_Nexus_xx Thanks for that one. I had seen it, but it seems that it only works with a certain start and end time (given hour:minute) or do I not understand correctly?
Great stuff, works. Still not sure if I like it but that has nothing to do with your implementation.
And yet another solution:
Easy to adjust the brightness steps, start/end value and duration per loop:
“step”:“5”,“lower”:“0”,“upper”:“100”
“duration”:“0.05”,“maxloops”:“20”
Hello there, I want to stop a transition mid way when someone click a switch. Is there a way a msg or something I can send to stop a service that is runing (light transition).
Basically I want a light to transition to OFF in 30 min. But if someone presses the ligth switch I want the transition to stop.
Thanks in advance!
I did something like this, Check after sleeping a bit check if the brightness is where it is supposed to be and if it isn’t stop the loop, someone must have been using a switch. Note I couldn’t check exact value for brightness, it seems that when I set it it didn’t always come back exact, but within a range of 5 or so from the set value.
Code for that brightness in set range function:
var set_brightness = msg.brightness
var light_brightness = msg.data.attributes.brightness
var brightness_max = set_brightness + 5
var brightness_min = set_brightness - 5
if (brightness_max > light_brightness) {
if (brightness_min < light_brightness) {
return [ msg, null ];
}
}
return [ null, msg ];
Hy and thank you for your flow coen17st!
I took your flow and expanded by a function. This sets the timer to 0 and stops it
[{"id":"7aadd669.33ee88","type":"function","z":"a1629472.776fd8","name":"","func":"myCount = msg.countUpperLimitReached; \nvar newMsg = { payload: \"STOP\", reset: true}\n\nif (myCount == true) {\n return [newMsg, null];\n \n} else {\n return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":160,"y":1640,"wires":[["637ed21c.c6444c","d73f9e10.c886"]]},{"id":"192df8.a212e208","type":"api-call-service","z":"a1629472.776fd8","name":"","server":"dc4a800c.88fbb","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.wohnzimmer","data":"{\"brightness\":\"{{count}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":950,"y":1580,"wires":[[]]},{"id":"637ed21c.c6444c","type":"debug","z":"a1629472.776fd8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":550,"y":1700,"wires":[]},{"id":"62a11774.061d58","type":"inject","z":"a1629472.776fd8","name":"Start Trigger","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":165,"y":1450,"wires":[["d73f9e10.c886"]]},{"id":"d73f9e10.c886","type":"counter","z":"a1629472.776fd8","name":"Step = % Brightness","init":"0","step":"5","lower":"0","upper":"255","mode":"increment","outputs":"1","x":390,"y":1465,"wires":[["8480134.09905f"]]},{"id":"46ff3be7.7cd1b4","type":"stoptimer","z":"a1629472.776fd8","duration":"2","units":"Second","payloadtype":"num","payloadval":"0","name":"Transition time also depends on the step value.","x":580,"y":1580,"wires":[["d73f9e10.c886","7aadd669.33ee88","192df8.a212e208"],[]]},{"id":"8480134.09905f","type":"switch","z":"a1629472.776fd8","name":"Brightess Maximum","property":"count","propertyType":"msg","rules":[{"t":"lte","v":"255","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":620,"y":1465,"wires":[["46ff3be7.7cd1b4"]]},{"id":"37f3baf3.515b36","type":"inject","z":"a1629472.776fd8","name":"Stop Trigger","props":[{"p":"payload"},{"p":"reset","v":"true","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"STOP","payloadType":"str","x":150,"y":1520,"wires":[["d73f9e10.c886"]]},{"id":"dc4a800c.88fbb","type":"server","name":"Home Assistant"}]
good flow, thank you)