PLCHome / node-red-contrib-velux

Provides nodes to talk to Velux® KLF-200 io-homecontrol® Gateway
9 stars 2 forks source link

Activate 2 scenes with delay #9

Closed CannyDuck closed 3 years ago

CannyDuck commented 3 years ago

I try to open an window and close it after a defined delay. If I connect the node for scene 1 and scene 2 with a delay, only scene 1 is performed. With a manual injector for scene 1 and scene 2 the execution works, but not automaticlly after each other with the delay. Any ideas so solve it?

[{"id":"54b7854c.baf744","type":"Velux Scenes","z":"77c194d3.b496ec","name":"","datasource":"1b4948e7.d44d07","index":"0","velocity":"DEFAULT","topic":"velux:id:1","x":640,"y":1080,"wires":[["499d6cd2.cf7f3c"]]},{"id":"499d6cd2.cf7f3c","type":"delay","z":"77c194d3.b496ec","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":840,"y":1080,"wires":[["9d093885.ceb288"]]},{"id":"9d093885.ceb288","type":"Velux Scenes","z":"77c194d3.b496ec","name":"","datasource":"1b4948e7.d44d07","index":"1","velocity":"DEFAULT","topic":"velux:id:2","x":1060,"y":1080,"wires":[[]]},{"id":"49c53e8e.840f38","type":"inject","z":"77c194d3.b496ec","name":"Fenster öffnen & schließen","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":400,"y":1080,"wires":[["54b7854c.baf744"]]},{"id":"3454a259.3ff65e","type":"inject","z":"77c194d3.b496ec","name":"Fenster schließen","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":870,"y":1140,"wires":[["9d093885.ceb288"]]},{"id":"1b4948e7.d44d07","type":"velux-connection","z":"","host":"192.168.1.28","password":"xxx","monitor":"MONITOR"}]

CannyDuck commented 3 years ago

It seems like the Velux Scene node properties defined in the second node are not used during the delay execution. The properties of the first node was send again.

PLCHome commented 3 years ago

The nodes can be parameterized via the web or via the message. That the node also gives its parameterize as a response, the 2nd node executes this because it is in the message.

You need to delete some information in the message. Can you look at it with debug node. There was an error lately when there is no scene. So I don't have a scene right now. But that's how it should go. But there are 1000 other solutions.


[{"id":"54b7854c.baf744","type":"Velux Scenes","z":"44335a32.a89404","name":"","datasource":"bd55d695.1dcf18","index":"0","velocity":"DEFAULT","topic":"velux:id:1","x":460,"y":180,"wires":[["d9cd8b6c.45db18","d13afad4.8a9018"]]},{"id":"499d6cd2.cf7f3c","type":"delay","z":"44335a32.a89404","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":840,"y":180,"wires":[["9d093885.ceb288","2a901946.ee78a6"]]},{"id":"9d093885.ceb288","type":"Velux Scenes","z":"44335a32.a89404","name":"","datasource":"bd55d695.1dcf18","index":"1","velocity":"DEFAULT","topic":"velux:id:2","x":1080,"y":180,"wires":[[]]},{"id":"49c53e8e.840f38","type":"inject","z":"44335a32.a89404","name":"Fenster öffnen & schließen","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":180,"wires":[["54b7854c.baf744"]]},{"id":"3454a259.3ff65e","type":"inject","z":"44335a32.a89404","name":"Fenster schließen","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":850,"y":240,"wires":[["9d093885.ceb288"]]},{"id":"d9cd8b6c.45db18","type":"function","z":"44335a32.a89404","name":"","func":"msg = {payload: true}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":660,"y":180,"wires":[["499d6cd2.cf7f3c"]]},{"id":"d13afad4.8a9018","type":"debug","z":"44335a32.a89404","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":120,"wires":[]},{"id":"2a901946.ee78a6","type":"debug","z":"44335a32.a89404","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1040,"y":120,"wires":[]}]```