Hi,
I have a Node-red flow today to control an exhaust fan (while gluing, soldering etc) and it is connected to a NEXA (433MHz) plug controlled by a NEXA 3-channel remote and an RFXtrx to HA.
The remotes three channels is configured as three devices in HA:
ch1: direct control of the plug for the fan (on/off)
ch2: virtual - 30min timer
ch3: virtual - 4h timer
…then a complex NR flow that let me:
start continually by sending ch1=on
start 30min by hitting on for ch2
start 4h by hitting on for ch3
Repeat of ch2 or ch3 resets the timer and starts a new one.
Off switches everything off.
Now I’m working on reducing those 433MHz devices and plans to add an IKEA ZigBee plug and an IKEA ZigBee DimSwitch instead.
Trying to make a NR flow that lets me start 30min timer every time I send on by the IKEA DimSwitch and then add 30min for every additional on from the switch.
I started off with the node-red-contrib-stoptimer-varidelay node-red-contrib-stoptimer-varidelay (node) - Node-RED that can output the remaining time on third port and send that to a HA entity, so I should be able to display remaining time.
But how can I make it start on first press of the switch and then ADD 30min to current for every time I hit the switch? If it’s running and it’s 10 minutes left and I hit it twice I want 10+30+30 minutes…or If I want to start 2h I hit it 4 times…
…if that is possible, I need to figure out how to stop it by sending off and also reset the timer on off (to be able to stop and stop/restart on a shorter time).
I might have an idea for the later part, but I have tested, googled and can’t figure out how to increase (reset to current+X) the time of the running timer. My coding skills are quite…limited…I started on a function node and actually managed to add one variable to another(!). Maybe that could be a good start, , but when I thought I had something and tested, I had managed to create a never stopping loop that was counting and counting…
I need some help…please…