Can't get the rbe node to work

So I might be doing this wrong. I have a notify when my phone reaches 80%+ charging to disconnect it (some say this can save battery life) but ofc I get spammed where I would only need one notify. So I found out about the RBE node and that it could be used to block if value is greater. So I tried with inject nodes and a debug node at the end but I can't figure it out.

Inject A value 80
Inject B value 81

rbe node in "Block if value change is greater or equal to"
I've set it to "80" and "compared to last input value"

And a debug node.

So I push the Inject A and message goes trough, I push inject B and the message also goes trough. Am I missing something?

[{"id":"8aebf30f.53c138","type":"inject","z":"e7e4820d.85adf","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"80","payloadType":"str","x":670,"y":740,"wires":[["26b409ab.f80dae"]]},{"id":"4ff87952.259528","type":"inject","z":"e7e4820d.85adf","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"81","payloadType":"str","x":670,"y":800,"wires":[["26b409ab.f80dae"]]},{"id":"40a1a7dc.1e3318","type":"debug","z":"e7e4820d.85adf","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1090,"y":760,"wires":[]},{"id":"26b409ab.f80dae","type":"rbe","z":"e7e4820d.85adf","name":"","func":"narrowbandEq","gap":"80","start":"","inout":"in","property":"payload","x":890,"y":760,"wires":[["40a1a7dc.1e3318"]]}]

EDIT: I'm on version 1.2.5 (Home Assistant)

The key word here is 'change'. You have configured it to block unless the value changes by 80 or more, so from 80 it would have to go to 160.

1 Like

Oh damn, that was not expected haha! Thank's a bunch. Is there any other way to do what I'm trying to do? When value changes to 80+ trigger once and ignore until the value goes below 80 again?

You have accidentally answered your own question.
Feed the output of your comparison node, which sends the notify, into a Trigger node set to Send Original Message, then Wait for 1 minute (for example) Then Send Nothing, and with Extend delay selected. Then when the first notify is generated it will pass it on but all the time further notifies are generated it will keep extending the delay, then when there is a gap of greater than 1 minute it will send nothing, but will reset the node so the next time a notify is generated it will send it on. Set the delay time as appropriate, obviously.

Okay I think I'm with you. This is okay for the phone charging as I would disconnect it pretty fast after the first notification. But If I would like for example notification to be sent when temp reaches a certain level on daily basis. Using a delay might be a bad idea? Yeah ofc you could set the wait to like 8h or something but some things can change by season and stuff.

Is there no better way to say if state 80+ trigger once than ignore until state > let's say 40? And repeat?

Maybe just easier to make a template binary sensor in Home Assistant. Then it would be ON/OFF rather than number changes every other minute.

I might have over complicated things but this solves what I was after.

[{"id":"63b632c3.ac3f34","type":"inject","z":"e7e4820d.85adf","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"80","payloadType":"num","x":210,"y":760,"wires":[["94c0353a.0cee98"]]},{"id":"80ec8819.81c76","type":"inject","z":"e7e4820d.85adf","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"20","payloadType":"num","x":210,"y":800,"wires":[["94c0353a.0cee98"]]},{"id":"27d899ed.101e4e","type":"inject","z":"e7e4820d.85adf","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"86","payloadType":"num","x":210,"y":720,"wires":[["94c0353a.0cee98"]]},{"id":"94c0353a.0cee98","type":"switch","z":"e7e4820d.85adf","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"80","vt":"str"},{"t":"lte","v":"20","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":430,"y":760,"wires":[["991eb57.52c06c8"],["dde80c33.7e4c58"]]},{"id":"991eb57.52c06c8","type":"change","z":"e7e4820d.85adf","name":"ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":740,"wires":[["29f049a0.cc76ce"]]},{"id":"dde80c33.7e4c58","type":"change","z":"e7e4820d.85adf","name":"OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":780,"wires":[["29f049a0.cc76ce"]]},{"id":"29f049a0.cc76ce","type":"switch","z":"e7e4820d.85adf","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":750,"y":760,"wires":[["4ae9a6a.aedb9d8"],["4ae9a6a.aedb9d8","927eaaf2.d74da8"]]},{"id":"4ae9a6a.aedb9d8","type":"trigger","z":"e7e4820d.85adf","name":"","op1":"","op2":"","op1type":"pay","op2type":"nul","duration":"0","extend":true,"overrideDelay":false,"units":"min","reset":"off","bytopic":"all","topic":"topic","outputs":1,"x":980,"y":740,"wires":[["6642930b.272d34"]]},{"id":"6642930b.272d34","type":"debug","z":"e7e4820d.85adf","name":"TRUE","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1130,"y":700,"wires":[]},{"id":"927eaaf2.d74da8","type":"debug","z":"e7e4820d.85adf","name":"FALSE","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1130,"y":800,"wires":[]}]

Well that is an entirely different question.

Only a little. You don't need the second switch, it doesn't do anything. The off output can be sent direct from the Change node output.

If you want the setpoints to be variable then have a look at node-red-contrib-ramp-thermostat which will do the on/off generation for you with variable setpoint and hysteresis. You can just ignore the ramp feature if you don't need it.

Thanks a bunch m8!

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