Hello All
i am having trouble with a node and I don't know what is wrong. i am hoping it is a bug in my logic but it doesn't appear to be. I am using a 3rd party "stoptimer" node that I have loaded the latest version (from 3 years ago) via the pallet.
I have used it as a timer when I flip a switch it starts a timer after that timer has elapsed it turns off the light. My problem is when I flip the light on it starts the timer; within the alloted time i turn off the light manually. I have added logic to stop the countdown because i had a bug. if
I turned on a light, it started a 30 minute timer. I then turn it off manually. (timer still running) I then turn it on again within the same 30 minutes. If there is 5 minutes left on the timer it then turns off the light after 5 minutes even though it hasn't reset the timer.
To get around this bug I added logic to stop the timer but when I inject "stop" or "STOP" via msg.payload like it says in the description it doesn't actually stop the timer at all. it still displays running and it still counting down
here is the code. Can someone have a look? If this is a bug in the node can someone suggest a replacement countdown timer node?
[{"id":"e8eecae6.f82478","type":"comment","z":"18ee747c.043b6c","name":"Bathroom","info":"","x":180,"y":1700,"wires":[]},{"id":"1ca08dea.5d7e12","type":"mqtt out","z":"18ee747c.043b6c","name":"","topic":"shellies/shelly1-BCDDC277C6FC/relay/0/command","qos":"","retain":"","broker":"8482818a.01de4","x":1630,"y":1760,"wires":[]},{"id":"302c6189.948cde","type":"mqtt in","z":"18ee747c.043b6c","name":"","topic":"shellies/shelly1-BCDDC277C6FC/relay/0","qos":"2","datatype":"auto","broker":"8482818a.01de4","x":260,"y":1760,"wires":[["2954d7d8.1f62f8","d9b8c28c.34322"]]},{"id":"a09cef18.7f8d7","type":"gate","z":"18ee747c.043b6c","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":950,"y":1760,"wires":[["2d4625ce.73c5da"]]},{"id":"cf396abf.441f48","type":"stoptimer","z":"18ee747c.043b6c","duration":"30","units":"Minute","payloadtype":"str","payloadval":"off","name":"","x":1300,"y":1760,"wires":[["3cdf78d4.b020a8"],["1ca08dea.5d7e12","95ea77f5.09a0e8","3cdf78d4.b020a8"]]},{"id":"95ea77f5.09a0e8","type":"change","z":"18ee747c.043b6c","name":"Reopen Gate","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":1680,"wires":[["a09cef18.7f8d7"]]},{"id":"3d6056d0.296d3a","type":"delay","z":"18ee747c.043b6c","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":640,"y":1720,"wires":[["f29500b4.4c568"]]},{"id":"f29500b4.4c568","type":"change","z":"18ee747c.043b6c","name":"Close Gate","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":1720,"wires":[["a09cef18.7f8d7"]]},{"id":"3065edff.f15292","type":"inject","z":"18ee747c.043b6c","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":900,"y":1640,"wires":[["95ea77f5.09a0e8"]]},{"id":"2954d7d8.1f62f8","type":"rbe","z":"18ee747c.043b6c","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":510,"y":1760,"wires":[["a09cef18.7f8d7","3d6056d0.296d3a"]]},{"id":"b8dc8544.228b68","type":"inject","z":"18ee747c.043b6c","name":"","topic":"","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1290,"y":1960,"wires":[["1ca08dea.5d7e12"]]},{"id":"2762fd6e.ae6b22","type":"inject","z":"18ee747c.043b6c","name":"","topic":"","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1290,"y":2000,"wires":[["1ca08dea.5d7e12"]]},{"id":"d9b8c28c.34322","type":"ui_switch","z":"18ee747c.043b6c","name":"","label":"Bathroom Light","tooltip":"","group":"b89d9404.bb26a8","order":7,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"","style":"","onvalue":"on","onvalueType":"str","onicon":"wb_sunny","oncolor":"yellow","offvalue":"off","offvalueType":"str","officon":"wb_sunny","offcolor":"grey","x":1300,"y":1900,"wires":[["1ca08dea.5d7e12","7c80019b.ef51d","4e478870.648208"]]},{"id":"ea46a429.4f8278","type":"ui_switch","z":"18ee747c.043b6c","name":"","label":"Enable Timer","tooltip":"","group":"b89d9404.bb26a8","order":6,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"control","style":"","onvalue":"open","onvalueType":"str","onicon":"done","oncolor":"green","offvalue":"close","offvalueType":"str","officon":"highlight_off","offcolor":"red","x":970,"y":1800,"wires":[["2d4625ce.73c5da"]]},{"id":"21d06225.3a6a1e","type":"inject","z":"18ee747c.043b6c","name":"","topic":"","payload":"open","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":790,"y":1800,"wires":[["ea46a429.4f8278"]]},{"id":"2d4625ce.73c5da","type":"gate","z":"18ee747c.043b6c","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":1090,"y":1760,"wires":[["cf396abf.441f48"]]},{"id":"1694b434.ef567c","type":"ui_text","z":"18ee747c.043b6c","group":"b89d9404.bb26a8","order":5,"width":0,"height":0,"name":"","label":"Bathroom","format":"{{msg.payload}}","layout":"row-spread","x":320,"y":1700,"wires":[]},{"id":"7c80019b.ef51d","type":"switch","z":"18ee747c.043b6c","name":"check for off","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1470,"y":1840,"wires":[["9a33b8b7.e762f8","dfcc2827.db25c8"]]},{"id":"9a33b8b7.e762f8","type":"change","z":"18ee747c.043b6c","name":"set to stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1650,"y":1840,"wires":[["cf396abf.441f48","343606f2.02ddba"]]},{"id":"343606f2.02ddba","type":"debug","z":"18ee747c.043b6c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1840,"y":1860,"wires":[]},{"id":"3cdf78d4.b020a8","type":"debug","z":"18ee747c.043b6c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1520,"y":1720,"wires":[]},{"id":"dfcc2827.db25c8","type":"debug","z":"18ee747c.043b6c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1610,"y":1940,"wires":[]},{"id":"4e478870.648208","type":"debug","z":"18ee747c.043b6c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1533.01171875,"y":1993.265625,"wires":[]},{"id":"8482818a.01de4","type":"mqtt-broker","z":"","name":"MQTT","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"b89d9404.bb26a8","type":"ui_group","z":"","name":"Lights","tab":"337f4dcb.e66472","disp":true,"width":"6","collapse":false},{"id":"337f4dcb.e66472","type":"ui_tab","z":"","name":"Bathroom","icon":"fa-s15","order":4,"disabled":false,"hidden":false}]