How to tackle this one

Guys,

When my heatpump is in standby mode (i.e not water being pumped through it) - one of the registers (DPS ids) is updated on a 30 second basis and flips between two values.

What would be the best way to capture this "flip flopping" and essentially output a value to my dashboard of "in Standby" ?

I was thinking of using a trigger node but can not really see how that will work - any ideas for a general node before i write a small function ?

Craig

Sorry for the short reply, but wouldn't that be in the realm of RBE?

Or switch and have it switch if value 1 to one output and if value 2 it switches to the other output and they are then connected to change nodes that alter the message to control .... an LED?
(as in node)

Yeah tried RBE and could not get it to work .

Whilst in Standby - the value continually changes between 0 and 4

When running the value is always 0

So i set an RBE and said - ignore first value, - worked fine whilst running - then when it went into Standby - the RBE was continually passing values

Just looking at the Boolean Ultimate collection at the moment to see if there is anything there.

Craig

Here is the current logic (using a switch and RBE - but not working) - just connect two input nodes injecting a 0 and a 4 to see what happens

[{"id":"8ba79ed9.cfd13","type":"rbe","z":"9ca52a8a.d12d48","name":"Check for Standby (Flip Flop)","func":"rbei","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":1180,"y":540,"wires":[["e7144c41.5704"]]},{"id":"e7144c41.5704","type":"ui_text","z":"9ca52a8a.d12d48","group":"624acab0.30b154","order":3,"width":"3","height":"1","name":"","label":"Operating mode","format":"{{msg.payload}}","layout":"col-center","x":1140,"y":380,"wires":[]},{"id":"a103947e.6d33b8","type":"switch","z":"9ca52a8a.d12d48","name":"Check for Operating Mode","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"4","vt":"num"}],"checkall":"false","repair":false,"outputs":2,"x":820,"y":440,"wires":[["3785ae39.8eab92"],["80f655f9.07cd98"]]},{"id":"3785ae39.8eab92","type":"change","z":"9ca52a8a.d12d48","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Running","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":520,"wires":[["8ba79ed9.cfd13"]]},{"id":"80f655f9.07cd98","type":"change","z":"9ca52a8a.d12d48","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Standby","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":580,"wires":[["8ba79ed9.cfd13"]]},{"id":"624acab0.30b154","type":"ui_group","z":"","name":"Heat Pump Reporting","tab":"720f2dcc.ee59b4","order":5,"disp":true,"width":"18","collapse":true},{"id":"720f2dcc.ee59b4","type":"ui_tab","z":"","name":"Heating Controls","icon":"dashboard","order":7,"disabled":false,"hidden":false}]

I'm confused. :wink:

So when in "standby" mode, what does it send? Values from 0 - 4.... Yeah?

What about when running?

Yep so when running it continually sends a 0 in this register/object

When in standby - it send a 0 (in the same register) and then 10 seconds later a 4 (in the same register)
and repeats this over and over
Craig

Sorry!

Ok, so when in standby it is 0 4 0 4 0 4 at 10 second intervals. But when running it is just always 0.

Is that right?

Yep - thats it

(I love puzzles.) :wink:

Yeah i have spent a couple of hours on it today and got nowhere !! Hence throwing it out to the brains trust.

I am sure someone like Dave or SteveMcl will go SNAP and have the answer

Craig

Hey, that's what the forum is for... Look at me. I do it a lot. :wink: hang on I'm working on it now.

yep and thanks !

Sounds like an rbe followed by a trigger with allow extend should do it.

hmm,

Ok will keep trying then and report back !

Craig

Yep - my brain must not be wired right !!!

@dceejay got me there with his hint - this is not perfect yet - have not tested for all edge cases - but initial quick testing seems to do what i want

[{"id":"de300696.a44928","type":"inject","z":"9782d4a7.3e09f8","name":"Zero","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":360,"y":500,"wires":[["e29f364a.48f7e8"]]},{"id":"f00cc2e4.7d2cc","type":"inject","z":"9782d4a7.3e09f8","name":"Four","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"4","payloadType":"num","x":360,"y":540,"wires":[["e29f364a.48f7e8"]]},{"id":"cd98c80e.80a978","type":"trigger","z":"9782d4a7.3e09f8","name":"","op1":"Standby","op2":"Standby","op1type":"str","op2type":"str","duration":"15","extend":true,"overrideDelay":false,"units":"s","reset":"0","bytopic":"all","topic":"topic","outputs":2,"x":830,"y":520,"wires":[["713aa727.e49278"],["fd8bfa81.9d3938"]]},{"id":"e29f364a.48f7e8","type":"rbe","z":"9782d4a7.3e09f8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":610,"y":520,"wires":[["cd98c80e.80a978"]]},{"id":"713aa727.e49278","type":"debug","z":"9782d4a7.3e09f8","name":"Standby","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1060,"y":440,"wires":[]},{"id":"fd8bfa81.9d3938","type":"debug","z":"9782d4a7.3e09f8","name":"Running","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1040,"y":560,"wires":[]}]

Thanks

Craig

Argh!

How about this:

[{"id":"19c34f22.1b1c29","type":"inject","z":"fc6fbf47.86d3e8","name":"Reset","props":[{"p":"reset","v":"true","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":100,"y":70,"wires":[["37176db4.a7f91a"]]},{"id":"37176db4.a7f91a","type":"trigger","z":"fc6fbf47.86d3e8","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"-4","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":320,"y":120,"wires":[["a432b8a8.5d82f8","3d921823.47e428"]]},{"id":"b4da3c74.87be","type":"inject","z":"fc6fbf47.86d3e8","name":"Start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":120,"wires":[["37176db4.a7f91a"]]},{"id":"ee8f2dd5.12e408","type":"debug","z":"fc6fbf47.86d3e8","name":"Toggle","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":620,"y":60,"wires":[]},{"id":"a432b8a8.5d82f8","type":"function","z":"fc6fbf47.86d3e8","name":"","func":"var x = context.get(\"toggle\") || 0;\n\nx = x + 1;\ncontext.set(\"toggle\",x);\n\nx = x%2;\n\nmsg.payload = x;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":500,"y":120,"wires":[["ee8f2dd5.12e408","ee454ba6.42219"]]},{"id":"ee454ba6.42219","type":"change","z":"fc6fbf47.86d3e8","name":"From sensor","rules":[{"t":"set","p":"state","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":120,"wires":[[]]},{"id":"35f098ff.4fb488","type":"inject","z":"fc6fbf47.86d3e8","name":"ON","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"ON","payloadType":"str","x":160,"y":430,"wires":[["b28cf4b.2c00488","fed734ce.1e307"]]},{"id":"f5718044.5024b8","type":"inject","z":"fc6fbf47.86d3e8","name":"STANDBY","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"SB","payloadType":"str","x":170,"y":480,"wires":[["b28cf4b.2c00488"]]},{"id":"6c2170b7.e9e3b8","type":"comment","z":"fc6fbf47.86d3e8","name":"Standby output simulation","info":"","x":390,"y":80,"wires":[]},{"id":"3d921823.47e428","type":"link out","z":"fc6fbf47.86d3e8","name":"CLOCK","links":["b9d287f.affa178","985ea4bd.4fa2c"],"x":315,"y":170,"wires":[]},{"id":"b9d287f.affa178","type":"link in","z":"fc6fbf47.86d3e8","name":"CLOCK","links":["3d921823.47e428"],"x":75,"y":300,"wires":[["e13828e9.c4d01"]]},{"id":"e13828e9.c4d01","type":"change","z":"fc6fbf47.86d3e8","name":"get flow.mode","rules":[{"t":"set","p":"payload","pt":"msg","to":"mode","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":190,"y":300,"wires":[["3c8ab0e3.681ca","cc0ca5de.84be78"]]},{"id":"b28cf4b.2c00488","type":"change","z":"fc6fbf47.86d3e8","name":"set flow.mode","rules":[{"t":"set","p":"mode","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":460,"wires":[[]]},{"id":"3c8ab0e3.681ca","type":"switch","z":"fc6fbf47.86d3e8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"eq","v":"SB","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":340,"y":300,"wires":[["bd7a1ca4.678a8"],["8cd6ae25.5b20c"]]},{"id":"985ea4bd.4fa2c","type":"link in","z":"fc6fbf47.86d3e8","name":"CLOCK","links":["3d921823.47e428"],"x":605,"y":180,"wires":[[]]},{"id":"fed734ce.1e307","type":"change","z":"fc6fbf47.86d3e8","name":"SET ON","rules":[{"t":"set","p":"state","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":420,"wires":[[]]},{"id":"cc0ca5de.84be78","type":"debug","z":"fc6fbf47.86d3e8","name":"MODE","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":190,"y":350,"wires":[]},{"id":"bd7a1ca4.678a8","type":"delay","z":"fc6fbf47.86d3e8","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":480,"y":270,"wires":[["7064a5d7.dd19b4"]]},{"id":"f745622e.2022d","type":"change","z":"fc6fbf47.86d3e8","name":"Reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":340,"wires":[["bd7a1ca4.678a8"]]},{"id":"8cd6ae25.5b20c","type":"switch","z":"fc6fbf47.86d3e8","name":"SB?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"SB","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":470,"y":340,"wires":[["f745622e.2022d","2cbf2225.cba0b6"]]},{"id":"a110a4c1.746968","type":"debug","z":"fc6fbf47.86d3e8","name":"Output","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":900,"y":290,"wires":[]},{"id":"2cbf2225.cba0b6","type":"change","z":"fc6fbf47.86d3e8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"SB","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":380,"wires":[["7064a5d7.dd19b4"]]},{"id":"7064a5d7.dd19b4","type":"rbe","z":"fc6fbf47.86d3e8","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":750,"y":290,"wires":[["a110a4c1.746968"]]}]

Oh, "how to use)

Press start to get things going.

Then use the standy or ON button to select what the mode is.

Oh, and the times in the trigger and delay need to be adjusted.

That never sends an "ON" signal though.

Yeah i just reversed the number in the Trigger node - so instead of looking for Zero - i set it to look for 4 - seems to work based on my testing - still playng now.

WIll download yours and see what you came up with as well

Thanks for the time on it - will let you know

Craig

Oh to get it working you need to set it in standby.

Then it works fine.

Sorry. Last minute thing I noticed.

Yep here is my final one i think (still to play with yours)

So it is running all day receiving Zeros - so outputs Running

Then gos into Standby when solar drops - so it starts seeing 4 which the RBE passes

This then resets the trigger which keeps getting reset by the ongoing stream of 0 and 4 allowed through whilst in standby, then it starts back up again and sees only 0 which the RBE does not pass - and hence the trigger times out and sends the Running command to the dashboard.

Seems to work OK

[{"id":"de300696.a44928","type":"inject","z":"9782d4a7.3e09f8","name":"Zero","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":360,"y":500,"wires":[["e29f364a.48f7e8"]]},{"id":"f00cc2e4.7d2cc","type":"inject","z":"9782d4a7.3e09f8","name":"Four","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"4","payloadType":"num","x":360,"y":540,"wires":[["e29f364a.48f7e8"]]},{"id":"cd98c80e.80a978","type":"trigger","z":"9782d4a7.3e09f8","name":"","op1":"Standby","op2":"Running","op1type":"str","op2type":"str","duration":"15","extend":true,"overrideDelay":false,"units":"s","reset":"4","bytopic":"all","topic":"topic","outputs":2,"x":830,"y":520,"wires":[["713aa727.e49278"],["fd8bfa81.9d3938"]]},{"id":"e29f364a.48f7e8","type":"rbe","z":"9782d4a7.3e09f8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":610,"y":520,"wires":[["cd98c80e.80a978"]]},{"id":"713aa727.e49278","type":"debug","z":"9782d4a7.3e09f8","name":"Standby","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1060,"y":440,"wires":[]},{"id":"fd8bfa81.9d3938","type":"debug","z":"9782d4a7.3e09f8","name":"Running","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1040,"y":560,"wires":[]}]

Craig

1 Like