Node-Red Flow Samples/Sharing

It's a bit of a mystery right now but my stuff still appears to be working so maybe give it a shot? I think there are a few others who have done this as well. Be sure to update from the CLI not the Palette manager - see my earlier post.

2 Likes

I just went into the alexa-remote directory and replace/pasted the replacement files. Is that what you mean by using the CLI

1 Like

No you need to do it via NPM like this:

edit: If you manually updated files in your Alexa-Remote2 you might have issues trying to uninstall it, dunno. Let us know how it worked out.

1 Like

Further note: After adding via the CLI you can access an update via the palette manager like normal. There seems to be a 4.02 update - just ran it and my Alexa stuff is still working.

TIP: Showing the status in a sub-flow - Thought this may help someone.

I wanted to see the status from my sub-flow like some regular nodes do it. Turns out it's really simple as shown below:

6 Likes

Wanted to share a quick sequence if anyone's interested - using the "node-red-contrib-timed-counter" node was able to give my Lutron picos a double-tap feature (even triple tap potentially).

The node simply increments a msg.count property if messages come in within a certain definable time limit and resets if not. Something like this:

It works great if you set the timing properly.. just recently went "live" and waiting on WAF :crossed_fingers: so still early in the game. Possibly replacing smartthings single button... The Pico is using the "Fast Pico" driver in HE.

5 Likes

Uber cool! I'm going to use it for a few Picos and my solitary Lutron CBR, to use Double Tap to raise/lower CT (button 1 vs 5, or 1 vs 4 for CBR).

1 Like

Not really the right place for this, but the Node Red experts will watch here. I am just getting started with Node Red on a pi4, and something is corrupt. I installed a bravia tool on the palette, and when I tried to remove it it all went south.

Now I cannot install or uninstall anything in the palette. Errors look like this. Any suggestions? Thanks


2021-02-09T01:19:08.298Z Install : neutrinos-sentiment-engine 1.0.0

2021-02-09T01:19:08.264Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production neutrinos-sentiment-engine@1.0.0
2021-02-09T01:19:15.614Z [err] npm
2021-02-09T01:19:15.614Z [err] ERR! code Unknown system error -117
2021-02-09T01:19:15.614Z [err] npm
2021-02-09T01:19:15.614Z [err] ERR! syscall
2021-02-09T01:19:15.614Z [err] unlink
2021-02-09T01:19:15.614Z [err] npm ERR!

You might start node red in safe mode from the command line. That allows you to delete the offending flows/nodes and then deploy.

FYI - If you tag your posts, people interested/experts in said topic, will likely respond. :wink:

1 Like

Wanted to report back that the Lutron (or other fast responding devices) "triple tap" detection does in fact work!

4 Likes

That is just brilliantly awesome!

1 Like

Does this method have the same latency as the non-fast driver since it has to wait to see if you are doing a double, triple, etc tap?

Yes but you can control how long the total wait is thanks to the Timed-Counter Node. Use the fast pico driver in HE and then this.. works very well. I have it set to about 450 milliseconds but you could go faster depends on what you are comfortable with.

3 Likes

@jason.melara

Here you go:

Motion lighting sequence

[{"id":"2f4558e3.3aaf7","type":"switch","z":"c2418662.65b878","name":"on/off","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":280,"wires":[["637dfb4f.8033f4"],["a35ec972.011da8"]]},{"id":"637dfb4f.8033f4","type":"switch","z":"c2418662.65b878","name":"physical","property":"payload.type","propertyType":"msg","rules":[{"t":"eq","v":"physical","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":360,"y":200,"wires":[["4092f9fe.ececf8","961fc57.0154eb8"]]},{"id":"a35ec972.011da8","type":"delay","z":"c2418662.65b878","name":"30s","pauseType":"delay","timeout":"30","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":495,"y":280,"wires":[["14a0ae95.0e0261"]],"l":false},{"id":"4092f9fe.ececf8","type":"change","z":"c2418662.65b878","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":455,"y":240,"wires":[["a35ec972.011da8"]],"l":false},{"id":"e2e15d4d.1d6c6","type":"comment","z":"c2418662.65b878","name":"set motion lighting false","info":"","x":1040,"y":200,"wires":[]},{"id":"5282a535.b44ff4","type":"comment","z":"c2418662.65b878","name":"set motion lighting true","info":"","x":1040,"y":280,"wires":[]},{"id":"80fdb293.59f918","type":"hubitat device","z":"c2418662.65b878","deviceLabel":"Guest Bedroom Light","name":"","server":"662851c4.3ccad","deviceId":"12","attribute":"","sendEvent":true,"x":160,"y":280,"wires":[["2f4558e3.3aaf7"]]},{"id":"14a0ae95.0e0261","type":"change","z":"c2418662.65b878","name":"flow.guest_motion_lighting = true","rules":[{"t":"set","p":"guest_motion_lighting","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":280,"wires":[[]]},{"id":"961fc57.0154eb8","type":"change","z":"c2418662.65b878","name":"flow.guest_motion_lighting = false","rules":[{"t":"set","p":"guest_motion_lighting","pt":"flow","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":200,"wires":[[]]},{"id":"bbfca332.dea1f","type":"switch","z":"c2418662.65b878","name":"guest_motion_lighting = true","property":"guest_motion_lighting","propertyType":"flow","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":460,"y":380,"wires":[["767832a5.465d74"]]},{"id":"767832a5.465d74","type":"switch","z":"c2418662.65b878","name":"active/inactive","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"active","vt":"str"},{"t":"eq","v":"inactive","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":700,"y":380,"wires":[["4dd186de.9f3ca8"],["571226ea.4abc3"]]},{"id":"4dd186de.9f3ca8","type":"change","z":"c2418662.65b878","name":"stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":380,"wires":[["571226ea.4abc3","51e9aa60.7c020c"]]},{"id":"571226ea.4abc3","type":"stoptimer-varidelay","z":"c2418662.65b878","duration":"3","durationType":"num","units":"Minute","payloadtype":"num","payloadval":"0","name":"3 min","reporting":"last_minute_seconds","persist":true,"x":850,"y":460,"wires":[["5d4aa07f.ad876"],[],[]]},{"id":"15ea889.ef023f7","type":"hubitat device","z":"c2418662.65b878","deviceLabel":"Motion - Guest Bedroom 1","name":"","server":"a22e0ea9.276dc8","deviceId":"1964","attribute":"motion","sendEvent":true,"x":180,"y":380,"wires":[["bbfca332.dea1f"]]},{"id":"5d4aa07f.ad876","type":"switch","z":"c2418662.65b878","name":"guest_motion_lighting = true","property":"guest_motion_lighting","propertyType":"flow","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":1060,"y":460,"wires":[["7e2e434d.ef9ffc"]]},{"id":"51e9aa60.7c020c","type":"change","z":"c2418662.65b878","name":"setLevel 100","rules":[{"t":"set","p":"command","pt":"msg","to":"setLevel","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"100","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1250,"y":380,"wires":[["77f45fee.5cfff8"]]},{"id":"7e2e434d.ef9ffc","type":"change","z":"c2418662.65b878","name":"off","rules":[{"t":"set","p":"command","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1270,"y":460,"wires":[["77f45fee.5cfff8"]]},{"id":"77f45fee.5cfff8","type":"hubitat command","z":"c2418662.65b878","deviceLabel":"Guest Bedroom Light","name":"","server":"662851c4.3ccad","deviceId":"12","command":"","commandArgs":"","x":1460,"y":420,"wires":[[]]},{"id":"662851c4.3ccad","type":"hubitat config","name":"HubitatS","usetls":false,"host":"192.168.1.36","port":"80","appId":"4489","nodeRedServer":"http://192.168.1.4:1880","webhookPath":"/hubitat/webhook2","autoRefresh":true,"useWebsocket":false,"colorEnabled":true,"color":"#51b8f0"},{"id":"a22e0ea9.276dc8","type":"hubitat config","name":"HubitatM","usetls":false,"host":"192.168.1.46","port":"80","appId":"1522","nodeRedServer":"http://192.168.1.4:1880","webhookPath":"/hubitat/webhook","autoRefresh":true,"useWebsocket":false,"colorEnabled":true,"color":"#5dd049"}]

1 Like

Thank you kindly!

1 Like

I was able to take this and make it work nicely for some ceiling fans. I ended up using regex in the first switch node to capture the phrases, since some rooms have ceiling fans I can control with speed, and others just on/off. Big thanks for this one!

Has anyone had any luck with a solution to Alexa trying to to speak afterwards - specifically something OTHER than the routine workaround? (Adding routines with 5 second waits DOES work, but I'd have to add a TON of them to capture every possible way someone might invoke the wording)

Does anyone have some good examples using node-red-contrib-boolean-logic-ultimate? I just can't seem to wrap my head around it. Here is what I'm trying to accomplish. I want to take three presence (A, B, and C) sensors and flip a switch based on the following criteria.

  1. A,B,C - all away --> Switch off
  2. A - present, B and C away --> Switch on
  3. B and/or C present, A=either --> Switch off

I realize that I could boil this down to something simpler: B+C away = off, B or C present = on, but I'm shooting for what I have above for no reason other than to learn how the boolean stuff works.

Here is a simple or using boolean, your A. Would follow the away path

flow

[{"id":"a4a3d949.b07ca8","type":"tab","label":"Mode","disabled":false,"info":""},{"id":"4e56585b.c45cb8","type":"change","z":"a4a3d949.b07ca8","name":"","rules":[{"t":"set","p":"mode","pt":"global","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":120,"wires":[["2e27dc3e.839004"]]},{"id":"2e27dc3e.839004","type":"link out","z":"a4a3d949.b07ca8","name":"Mode Changed","links":["b252f570.2a58c8","e346a1d7.ea016","95b0bf6f.cd26e","4c247ed.8c08f8","d428d3ce.7cd2c","e7996592.a4d738"],"x":485,"y":120,"wires":[]},{"id":"c790806d.43382","type":"hubitat device","z":"a4a3d949.b07ca8","deviceLabel":"Presence: Annette combined","name":"","server":"b5eb352.57bc6c8","deviceId":"35","attribute":"presence","sendEvent":true,"x":180,"y":480,"wires":[["b9bef299.d9386"]]},{"id":"b9bef299.d9386","type":"change","z":"a4a3d949.b07ca8","name":"Present to Bool","rules":[{"t":"set","p":"payload","pt":"msg","to":"msg.payload.value = "present" ? true : false","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":540,"wires":[["309fd9cd.cc6046"]]},{"id":"9edf6449.9fda48","type":"hubitat device","z":"a4a3d949.b07ca8","deviceLabel":"Presence: Craig combined","name":"","server":"b5eb352.57bc6c8","deviceId":"34","attribute":"presence","sendEvent":true,"x":180,"y":540,"wires":[["b9bef299.d9386"]]},{"id":"309fd9cd.cc6046","type":"BooleanLogicUltimate","z":"a4a3d949.b07ca8","name":"","filtertrue":"both","persist":true,"sInitializeWith":"true","triggertopic":"trigger","outputtriggeredby":"all","inputCount":2,"topic":"result","x":680,"y":540,"wires":[[],["729f6bfd.c2a784"],[]]},{"id":"729f6bfd.c2a784","type":"rbe","z":"a4a3d949.b07ca8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":850,"y":540,"wires":[["6a42856c.1fef1c"]]},{"id":"6a42856c.1fef1c","type":"switch","z":"a4a3d949.b07ca8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1000,"y":540,"wires":[["71872b2a.5fb194"],["a0ea0b54.122278"]]},{"id":"a0ea0b54.122278","type":"hubitat mode-setter","z":"a4a3d949.b07ca8","name":"Away","server":"b5eb352.57bc6c8","modeId":"4","x":1180,"y":580,"wires":[[]]},{"id":"80c595fe.de5818","type":"switch","z":"a4a3d949.b07ca8","name":"is Off","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1290,"y":500,"wires":[["c24946b9.df63c8"]]},{"id":"71872b2a.5fb194","type":"hubitat device","z":"a4a3d949.b07ca8","deviceLabel":"Nighttime","name":"","server":"b5eb352.57bc6c8","deviceId":"51","attribute":"switch","sendEvent":false,"x":1160,"y":500,"wires":[["80c595fe.de5818"]]},{"id":"c24946b9.df63c8","type":"weekday","z":"a4a3d949.b07ca8","name":"Weekday?","sun":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":false,"x":1470,"y":460,"wires":[["d7a040bf.0aec6"],["6f442860.04c418"]]},{"id":"d7a040bf.0aec6","type":"hubitat mode-setter","z":"a4a3d949.b07ca8","name":"Weekday","server":"b5eb352.57bc6c8","modeId":"1","x":1620,"y":440,"wires":[[]]},{"id":"6f442860.04c418","type":"hubitat mode-setter","z":"a4a3d949.b07ca8","name":"Weekend","server":"b5eb352.57bc6c8","modeId":"5","x":1620,"y":480,"wires":[[]]},{"id":"9963dd1b.57907","type":"hubitat device","z":"a4a3d949.b07ca8","deviceLabel":"Nighttime","name":"","server":"b5eb352.57bc6c8","deviceId":"51","attribute":"switch","sendEvent":true,"x":130,"y":380,"wires":[["f4856f9.4e6b09"]]},{"id":"f4856f9.4e6b09","type":"switch","z":"a4a3d949.b07ca8","name":"On/Off","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":300,"y":380,"wires":[["22b5027b.b2774e"],["c24946b9.df63c8"]]},{"id":"22b5027b.b2774e","type":"hubitat mode-setter","z":"a4a3d949.b07ca8","name":"Night","server":"b5eb352.57bc6c8","modeId":"3","x":470,"y":360,"wires":[[]]},{"id":"96632e69.a4684","type":"hubitat mode","z":"a4a3d949.b07ca8","name":"","server":"b5eb352.57bc6c8","sendEvent":true,"x":160,"y":120,"wires":[["4e56585b.c45cb8"]]},{"id":"b5eb352.57bc6c8","type":"hubitat config","name":"","usetls":false,"host":"192.168.1.52","port":"80","appId":"79","nodeRedServer":"http://192.168.1.53:1880","webhookPath":"/hubitat/webhook","autoRefresh":true,"useWebsocket":false}]

3 Likes

Something like this maybe?

Example Logic..

[{"id":"649bc136.24086","type":"inject","z":"af91369d.586338","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"A","payload":"true","payloadType":"bool","x":270,"y":1960,"wires":[["5923c7d1.fd82e8"]]},{"id":"8397fcaf.f502c","type":"inject","z":"af91369d.586338","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"A","payload":"false","payloadType":"bool","x":270,"y":2000,"wires":[["5923c7d1.fd82e8"]]},{"id":"c186675a.cd93f8","type":"inject","z":"af91369d.586338","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"B","payload":"true","payloadType":"bool","x":270,"y":2060,"wires":[["5923c7d1.fd82e8"]]},{"id":"52b6069b.b7eda8","type":"inject","z":"af91369d.586338","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"B","payload":"false","payloadType":"bool","x":270,"y":2100,"wires":[["5923c7d1.fd82e8"]]},{"id":"df0673e.72ae79","type":"inject","z":"af91369d.586338","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"C","payload":"true","payloadType":"bool","x":270,"y":2160,"wires":[["5923c7d1.fd82e8"]]},{"id":"a1cf9dfd.71d85","type":"inject","z":"af91369d.586338","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"C","payload":"false","payloadType":"bool","x":270,"y":2200,"wires":[["5923c7d1.fd82e8"]]},{"id":"f487e325.fe627","type":"debug","z":"af91369d.586338","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":770,"y":2060,"wires":[]},{"id":"5923c7d1.fd82e8","type":"BooleanLogicUltimate","z":"af91369d.586338","name":"","filtertrue":"both","persist":true,"sInitializeWith":"WaitForPayload","triggertopic":"trigger","outputtriggeredby":"all","inputCount":"3","topic":"result","x":560,"y":2060,"wires":[[],["f487e325.fe627"],[]]}]
1 Like