BLAST! I'm not out of the woods yet.
standard periodic telemetry updates from the sensor are triggering my change node before desired trigger time has elapsed.
my goal is for the bathroom fan to run for at least 10min any time it's manually engaged, and then query the humidity every 2.5min after that. the problem that I'm seeing is that any time the sensors publishes its data, whether automatically or via some other request, its turning off the fan.
I'm sure there's some way to grab a timestamp from the initial "wait 10min" trigger, and challenge executions based on that?
here's a visual:
and here's the flow:
[{"id":"1d522e8c.dab4f9","type":"tab","label":"Fan and Light Timers","disabled":false,"info":""},{"id":"ca74f378.77eb08","type":"mqtt in","z":"1d522e8c.dab4f9","name":"","topic":"stat/utility/bathfan/RESULT","qos":"0","datatype":"auto","broker":"c76d5418.e16138","x":210,"y":180,"wires":[["2ea164a7.5e41fc"]]},{"id":"91f04c4e.3585b","type":"debug","z":"1d522e8c.dab4f9","name":"DEBUG TURN OFF","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1030,"y":240,"wires":[]},{"id":"2ea164a7.5e41fc","type":"switch","z":"1d522e8c.dab4f9","name":"IF ON","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"ON","vt":"str"},{"t":"neq","v":"ON","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":390,"y":180,"wires":[["3ab1fe61.c3492a","546c95cf.83e964"],[]]},{"id":"3ab1fe61.c3492a","type":"trigger","z":"1d522e8c.dab4f9","name":"WAIT 45MIN","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"45","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":530,"y":180,"wires":[["e8c473ed.40eb5"]]},{"id":"e8c473ed.40eb5","type":"change","z":"1d522e8c.dab4f9","name":"CHANGE TO OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":180,"wires":[["91f04c4e.3585b","10f7c310.311295"]]},{"id":"10f7c310.311295","type":"mqtt out","z":"1d522e8c.dab4f9","name":"","topic":"cmnd/utility/bathfan/POWER","qos":"0","retain":"","broker":"c76d5418.e16138","x":1060,"y":180,"wires":[]},{"id":"7113f564.b3eaac","type":"mqtt in","z":"1d522e8c.dab4f9","name":"","topic":"stat/utility/mbathfan/RESULT","qos":"0","datatype":"auto","broker":"c76d5418.e16138","x":200,"y":300,"wires":[["7ce6f847.e70468"]]},{"id":"7ce6f847.e70468","type":"switch","z":"1d522e8c.dab4f9","name":"IF ON","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"ON","vt":"str"},{"t":"neq","v":"ON","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":390,"y":300,"wires":[["c742b691.fc6b88","546c95cf.83e964"],[]]},{"id":"c742b691.fc6b88","type":"trigger","z":"1d522e8c.dab4f9","name":"WAIT 10MIN","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"10","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":530,"y":300,"wires":[["d5a27873.5c6d58"]]},{"id":"5fed3067.31aeb","type":"change","z":"1d522e8c.dab4f9","name":"CHANGE TO OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":300,"wires":[["e66f9783.39936","91f04c4e.3585b"]]},{"id":"e66f9783.39936","type":"mqtt out","z":"1d522e8c.dab4f9","name":"","topic":"cmnd/utility/mbathfan/POWER","qos":"0","retain":"","broker":"c76d5418.e16138","x":1070,"y":300,"wires":[]},{"id":"b6e2aad5.50bf38","type":"comment","z":"1d522e8c.dab4f9","name":"UPSTAIRS BATHROOM AUTO OFF TIMER","info":"","x":260,"y":140,"wires":[]},{"id":"d13fac57.cf8ca8","type":"comment","z":"1d522e8c.dab4f9","name":"MASTER BATHROOM AUTO OFF TIMER","info":"","x":260,"y":260,"wires":[]},{"id":"a230a8a1.863688","type":"mqtt in","z":"1d522e8c.dab4f9","name":"","topic":"stat/lighting/mastercloset/RESULT","qos":"0","datatype":"auto","broker":"c76d5418.e16138","x":180,"y":600,"wires":[["1655960f.133e02"]]},{"id":"63d6ed1.9487094","type":"debug","z":"1d522e8c.dab4f9","name":"DEBUG TURN OFF","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1030,"y":560,"wires":[]},{"id":"1655960f.133e02","type":"switch","z":"1d522e8c.dab4f9","name":"IF ON","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"ON","vt":"str"},{"t":"neq","v":"ON","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":390,"y":600,"wires":[["3de7de3.8a2c422","96f5e6ad.f133b8"],[]]},{"id":"3de7de3.8a2c422","type":"trigger","z":"1d522e8c.dab4f9","name":"WAIT 5MIN","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"5","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":530,"y":600,"wires":[["a0e661c1.761cf"]]},{"id":"a0e661c1.761cf","type":"change","z":"1d522e8c.dab4f9","name":"CHANGE TO OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":600,"wires":[["63d6ed1.9487094","5911993a.0dac1"]]},{"id":"5911993a.0dac1","type":"mqtt out","z":"1d522e8c.dab4f9","name":"","topic":"cmnd/lighting/mastercloset/POWER","qos":"0","retain":"","broker":"c76d5418.e16138","x":1090,"y":600,"wires":[]},{"id":"8ba0f324.2069e","type":"comment","z":"1d522e8c.dab4f9","name":"MASTER CLOSET AUTO OFF TIMER","info":"","x":250,"y":560,"wires":[]},{"id":"546c95cf.83e964","type":"debug","z":"1d522e8c.dab4f9","name":"DEBUG IF ON","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":540,"y":240,"wires":[]},{"id":"96f5e6ad.f133b8","type":"debug","z":"1d522e8c.dab4f9","name":"DEBUG IF ON","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":540,"y":660,"wires":[]},{"id":"dec85c20.8e4bb8","type":"mqtt out","z":"1d522e8c.dab4f9","name":"","topic":"cmnd/sensors/mbathsensor/status","qos":"","retain":"","broker":"c76d5418.e16138","x":820,"y":1000,"wires":[]},{"id":"1931c779.795f89","type":"inject","z":"1d522e8c.dab4f9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":330,"y":1000,"wires":[["1f708777.4443c1"]]},{"id":"1f708777.4443c1","type":"change","z":"1d522e8c.dab4f9","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"10","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":1000,"wires":[["dec85c20.8e4bb8","bbccbad9.314c2"]]},{"id":"bbccbad9.314c2","type":"debug","z":"1d522e8c.dab4f9","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":740,"y":1080,"wires":[]},{"id":"d5a27873.5c6d58","type":"trigger","z":"1d522e8c.dab4f9","name":"CHECK EVERY 2.5MIN","op1":"","op2":"","op1type":"pay","op2type":"pay","duration":"2.5","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":570,"y":360,"wires":[["31476e4d.fa5172"]]},{"id":"323444d6.c2a984","type":"mqtt in","z":"1d522e8c.dab4f9","name":"RECEIVE HUMIDITY","topic":"+/sensors/mbathsensor/+","qos":"0","datatype":"auto","broker":"c76d5418.e16138","x":230,"y":420,"wires":[["416aeaf1.83ef1c"]]},{"id":"416aeaf1.83ef1c","type":"json","z":"1d522e8c.dab4f9","name":"PARSE","property":"payload","action":"","pretty":true,"x":420,"y":420,"wires":[["4778b3b9.3a639c"]]},{"id":"4778b3b9.3a639c","type":"change","z":"1d522e8c.dab4f9","name":"CROP HUMIDITY","rules":[{"t":"delete","p":"payload.StatusSNS.AM2301.Temperature","pt":"msg"},{"t":"delete","p":"payload.StatusSNS.AM2301.DewPoint","pt":"msg"},{"t":"move","p":"payload.StatusSNS.AM2301.Humidity","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":420,"wires":[["7b10834a.806ac4"]]},{"id":"7b10834a.806ac4","type":"switch","z":"1d522e8c.dab4f9","name":"DELTA 55","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"55","vt":"str"},{"t":"lte","v":"55","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":800,"y":420,"wires":[["d5a27873.5c6d58"],["5fed3067.31aeb"]]},{"id":"727ed7f6.d43c18","type":"mqtt out","z":"1d522e8c.dab4f9","name":"EXECUTE QUERY","topic":"cmnd/sensors/mbathsensor/status","qos":"","retain":"","broker":"c76d5418.e16138","x":1030,"y":360,"wires":[]},{"id":"31476e4d.fa5172","type":"change","z":"1d522e8c.dab4f9","name":"LOAD QUERY","rules":[{"t":"set","p":"payload","pt":"msg","to":"10","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":360,"wires":[["727ed7f6.d43c18","b5973542.208768"]]},{"id":"c942160a.067408","type":"comment","z":"1d522e8c.dab4f9","name":"HUMIDITY CHECK","info":"","x":190,"y":380,"wires":[]},{"id":"b5973542.208768","type":"debug","z":"1d522e8c.dab4f9","name":"DEBUG QUERY","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1020,"y":420,"wires":[]},{"id":"cdef13fb.5a8a28","type":"comment","z":"1d522e8c.dab4f9","name":"TRIGGER HUMIDITY CHECK","info":"","x":600,"y":960,"wires":[]},{"id":"c76d5418.e16138","type":"mqtt-broker","name":"MOSQUITTO","broker":"192.168.5.196","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""}]