linuxha / node-red-contrib-mytimeout

A dynamic count down timer for node-red
MIT License
10 stars 10 forks source link

unwanted starting of countdown #31

Closed tita2000 closed 2 years ago

tita2000 commented 3 years ago

Everytime I restart the node red server the countdown of mytimeout starts and puts a "1" on the output. I'm working with ubuntu 20.04.2 LTS, Node-RED 1.2.3 and mytimeout 3.2.0. Any help on this is appreciated. Thanks

linuxha commented 3 years ago

Sorry about the delay, I'll need to look into that. Some variable must be uninitialized or initialized incorrectly.

linuxha commented 3 years ago

Okay I setup a very simple timer, Input -> mytimeout (default settings) -> Debug (Output1), Debug (Output2). I deploy and I see no message on the debug console. I restart node-red, same result. Can I see a copy of your flow?

tita2000 commented 3 years ago

Hi,

this is a picture of the flow. https://ibb.co/C83thLX

This is the function content:

if (msg.payload == "1") { var temp = global.get('WZSSFL', "file"); msg = { "payload": "on", "timeout": temp, "warning": 0 }; return msg; } return null;

ok. what it does If I press the button 'Sonnenschutz' my windows shutters will move a defined time down. This information is provided in the variable WZSSFL. I already deleted the wire from the functions to the mytimeout nodes, but a restart of node-red started the mytimeout counter without any input.

Regards Timo

linuxha commented 2 years ago

I've not been able to reproduce the issue you saw but I have a idea. Hopefully I can test my idea this weekend, I think the issue is with the setup of the MQTT input topic. Do you have retain on? If you retain the data it will be published when you startup.

tita2000 commented 2 years ago

ok, that's a hint, as all my mqtt messages are retain messages. I will try without retain and report. Regards Timo

linuxha commented 2 years ago

I'm closing this as I've not heard anything further