Rpi infput Delayed off whitch is discarded when rpi returns high before timeout

Hi, Well still playing with Node-red today i have a simple problem where i cannot find the node-red solution...
I have a RPI input going high controlling something..
Whenever its going low i need to delay the off state by a fixed few seconds and if the input gets high within these few seconds the off state needs to be forgotten...

Nothing a simple elco would do but i need now the node-red way..Either a function blok or the right delay node would be great...

Benno

A combination of a trigger node and a switch node should do what you require.

[{"id":"43a98d75.8a242c","type":"inject","z":"b779de97.b1b46","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":190,"y":4300,"wires":[["cac2538d.f24ac8","a9fb506d.06d008"]]},{"id":"cac2538d.f24ac8","type":"trigger","z":"b779de97.b1b46","name":"","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"3","extend":false,"overrideDelay":false,"units":"s","reset":"1","bytopic":"all","topic":"topic","outputs":1,"x":380,"y":4320,"wires":[["6ed73c6e.0d1e1c"]]},{"id":"a9fb506d.06d008","type":"switch","z":"b779de97.b1b46","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":380,"y":4280,"wires":[["6ed73c6e.0d1e1c"]]},{"id":"b8a49dd7.ae362","type":"inject","z":"b779de97.b1b46","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":190,"y":4340,"wires":[["cac2538d.f24ac8","a9fb506d.06d008"]]},{"id":"6ed73c6e.0d1e1c","type":"debug","z":"b779de97.b1b46","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":650,"y":4320,"wires":[]}]

Whoooo.. Like i thought shouldn't be difficult but was stugguling allready a few days..

In this light i might have a different problem witch one would solve...
RPI has no clock and will loose the date after a reset.
I use the date to secdule my lights...
I can update the date using the date command and i know Node red can issue commands.
Now how to create a button updating the date in the rpi from my local time .
Or even make this do automatic every so often...

Thanks in advance..

Not a RPI user, but a quick google may help you,
https://www.google.com/search?q=setting+rpi+time+after+reboot

Does your pi have an internet connection? If so then it should set the date/time automatically.

Yes i know.. but due to firewall and remote vpn operation, i was not able to get that working...
So your answer is yes but not directly..

benno

Better to fix that then. The fact that you are connecting via VPN should have no effect on the time sync. What is it in the firewall that is stopping access to the time server?

Network and internet connection is a different department. Its beyond my controll.. tried allready that path but no luck so far.
Will do extra try.

I have a node-red widget creating the time in my dashboard witch is extracted from the clients machine.. Ik was thinking using that extraction to use updating the system time. but offcause if client time is off, i would be lost...

Client is use connecting the dashboard...

Benno

OK, I understand, I think. You want to configure a dashboard button that when you click it sends the client browser time in the message.

I don't know how to do that. I suggest you start a new thread with something like "How to configure a dashboard button to send the client browser time in the message". Then someone who knows how to write the client side javascript to do that will no doubt help.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.