Node-Red Flow Samples/Sharing

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

If I had to guess, the reason it is giving you trouble is because you are trying to solve a relatively complex boolean expression with only a single "gate". Given your requirements I would generate at least 3 boolean expressions, maybe 4 since that last one has "and/or" and then generate truth tables or simplify them down into a single expression, or do something else like a K-map. Then you can implement that new expression with as many gates as you need.

Here is a decent resource for boolean simplification:
https://grace.bluegrass.kctcs.edu/~kdunn0001/files/Simplification/4_Simplification_print.html

You could also do it by assigning a 1 = "present" or 0 = "away" and adding them up. Anything greater than 0 is "present". No UB node required.. but certainly a bit more complex looking. Something like this maybe:

edit: first set of device nodes has the "send events" checked, the second set unchecked,

3 Likes

Wow thanks for all the great ideas everyone! I've got plenty of reading and experimenting to do :slight_smile:

1 Like

This is my most recent update to the CT flow I have in my house. I bought another dozen CT/Full Color bulbs this week and the old fan-out style of setting CT seemed like it was starting to lag. Now that the Node-Red supports more generic configurations, I put this "universal CT management" together.

Coupled with the CT calculation, which is stored in a flow variable:

Previously, my config looked like this. It required manually adding a node for each bulb, and it scaled traffic per CT update too aggressively.

Here's the code for the universal CT updater:

[{"id":"58e0ec60.bafb94","type":"hubitat event","z":"f9337f21.0eab78","name":"All Events","server":"252d4ef4.c14b6a","x":140,"y":260,"wires":[["94dde739.518ef8"]]},{"id":"94dde739.518ef8","type":"switch","z":"f9337f21.0eab78","name":"== switch","property":"payload.name","propertyType":"msg","rules":[{"t":"eq","v":"switch","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":280,"y":260,"wires":[["9c7a6454.dc21f"]]},{"id":"9c7a6454.dc21f","type":"switch","z":"f9337f21.0eab78","name":"== on","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":410,"y":260,"wires":[["c8190e0a.7f7a48"]]},{"id":"bccb5224.c91e6","type":"hubitat device","z":"f9337f21.0eab78","deviceLabel":"","name":"","server":"252d4ef4.c14b6a","deviceId":"","attribute":"","sendEvent":false,"x":750,"y":260,"wires":[["e473965f.8a5b68"]]},{"id":"c8190e0a.7f7a48","type":"change","z":"f9337f21.0eab78","name":"","rules":[{"t":"set","p":"deviceId","pt":"msg","to":"payload.deviceId","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":260,"wires":[["bccb5224.c91e6"]]},{"id":"60321171.83d2c8","type":"comment","z":"f9337f21.0eab78","name":"When a device is turned on, check if it's a CT bulb","info":"","x":270,"y":200,"wires":[]},{"id":"e473965f.8a5b68","type":"switch","z":"f9337f21.0eab78","name":"CT Bulb?","property":"payload","propertyType":"msg","rules":[{"t":"hask","v":"colorTemperature","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":890,"y":260,"wires":[["33ed496c.3b1f1e"]]},{"id":"10420ba7.156514","type":"change","z":"f9337f21.0eab78","name":"Set Color Temp","rules":[{"t":"set","p":"arguments","pt":"msg","to":"color_temperature","tot":"flow"},{"t":"set","p":"command","pt":"msg","to":"setColorTemperature","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":220,"y":580,"wires":[["c1b27dbf.a11668"]]},{"id":"c1b27dbf.a11668","type":"hubitat command","z":"f9337f21.0eab78","deviceLabel":"","name":"","server":"252d4ef4.c14b6a","deviceId":"","command":"","commandArgs":"","x":400,"y":580,"wires":[[]]},{"id":"33ed496c.3b1f1e","type":"link out","z":"f9337f21.0eab78","name":"Bulb turned on","links":["950cba8b.112ef8"],"x":995,"y":260,"wires":[]},{"id":"950cba8b.112ef8","type":"link in","z":"f9337f21.0eab78","name":"Bulb CT Update","links":["33ed496c.3b1f1e","a197e4e7.48a7c"],"x":95,"y":580,"wires":[["10420ba7.156514"]]},{"id":"b3231329.c6083","type":"hubitat request","z":"f9337f21.0eab78","name":"Fetch all devices","server":"252d4ef4.c14b6a","path":"/devices/all","x":230,"y":400,"wires":[["21b8a5fd.7a31d2"]]},{"id":"21b8a5fd.7a31d2","type":"split","z":"f9337f21.0eab78","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":375,"y":400,"wires":[["7bc998fc.ab71a"]],"l":false},{"id":"7bc998fc.ab71a","type":"switch","z":"f9337f21.0eab78","name":"CT Bulb?","property":"payload.capabilities","propertyType":"msg","rules":[{"t":"cont","v":"ColorTemperature","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":480,"y":400,"wires":[["37a242c8.10feb6"]]},{"id":"37a242c8.10feb6","type":"switch","z":"f9337f21.0eab78","name":"On?","property":"payload.attributes.switch","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":630,"y":400,"wires":[["65f9e584.babbf4"]]},{"id":"a197e4e7.48a7c","type":"link out","z":"f9337f21.0eab78","name":"","links":["950cba8b.112ef8"],"x":1195,"y":400,"wires":[]},{"id":"dc311cbd.e678c8","type":"link in","z":"f9337f21.0eab78","name":"Update All Bulbs CT","links":["b0c8d31a.f0e56"],"x":95,"y":400,"wires":[["b3231329.c6083"]]},{"id":"6c75f0cf.aaaf68","type":"comment","z":"f9337f21.0eab78","name":"When the CT target is updated, pull and update all active bulbs","info":"","x":310,"y":340,"wires":[]},{"id":"eef4c6a1.ea14a","type":"comment","z":"f9337f21.0eab78","name":"Update a single bulb","info":"","x":170,"y":500,"wires":[]},{"id":"145e840c.2ed744","type":"delay","z":"f9337f21.0eab78","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1050,"y":400,"wires":[["a197e4e7.48a7c"]]},{"id":"d820eb75.8fe88","type":"change","z":"f9337f21.0eab78","name":"Set Device ID","rules":[{"t":"set","p":"deviceId","pt":"msg","to":"payload.id","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":935,"y":400,"wires":[["145e840c.2ed744"]],"l":false},{"id":"65f9e584.babbf4","type":"switch","z":"f9337f21.0eab78","name":"CT is Wrong?","property":"payload.attributes.colorTemperature","propertyType":"msg","rules":[{"t":"btwn","v":"$flowContext(\"color_temperature\")-25","vt":"jsonata","v2":"$flowContext(\"color_temperature\")+25","v2t":"jsonata"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":800,"y":400,"wires":[[],["d820eb75.8fe88"]]},{"id":"252d4ef4.c14b6a","type":"hubitat config","name":"Hubitat","usetls":false,"host":"172.16.0.27","port":"80","appId":"501","nodeRedServer":"http://172.16.0.25:1880","webhookPath":"/hubitat/webhook","autoRefresh":false,"useWebsocket":false}]

And for the CT engine:

[{"id":"78d27aa4.3a922c","type":"change","z":"f9337f21.0eab78","name":"","rules":[{"t":"set","p":"color_temperature","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1540,"y":920,"wires":[["acfe6604.b0ebd","b0c8d31a.f0e56"]]},{"id":"e1e38786.f7807","type":"inject","z":"f9337f21.0eab78","name":"Every 15 minutes","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"string"}],"repeat":"900","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":860,"wires":[["7a1e014f.2d5688"]]},{"id":"e19e918a.2851d","type":"hubitat mode","z":"f9337f21.0eab78","name":"","server":"252d4ef4.c14b6a","sendEvent":true,"x":130,"y":920,"wires":[["7a1e014f.2d5688"]]},{"id":"7a1e014f.2d5688","type":"delay","z":"f9337f21.0eab78","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":415,"y":920,"wires":[["82929842.1531"]],"l":false},{"id":"b0c8d31a.f0e56","type":"link out","z":"f9337f21.0eab78","name":"Color Temperature Updated","links":["ac7411a0.a83e9","dc311cbd.e678c8"],"x":1715,"y":980,"wires":[]},{"id":"c5d2e3b6.bd6a4","type":"link in","z":"f9337f21.0eab78","name":"","links":["b7421877.47f01","910d19f9.d725e8","de178a7c.7f5e38"],"x":95,"y":1020,"wires":[["8fa8cca6.3c39b8"]]},{"id":"8fa8cca6.3c39b8","type":"delay","z":"f9337f21.0eab78","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"30","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":220,"y":1020,"wires":[["7a1e014f.2d5688"]]},{"id":"9a110e75.82802","type":"range","z":"f9337f21.0eab78","minin":"0","maxin":"100","minout":"2500","maxout":"4200","action":"clamp","round":true,"property":"payload","name":"percent to kelvin range","x":1260,"y":920,"wires":[["78d27aa4.3a922c"]]},{"id":"17a47889.a03a2f","type":"sun-position","z":"f9337f21.0eab78","name":"","positionConfig":"96c207ac.2237a8","rules":[],"onlyOnChange":"true","topic":"","outputs":1,"start":"","startType":"none","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"end":"","endType":"none","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"x":790,"y":940,"wires":[["f183b6f5.423ec"]]},{"id":"f183b6f5.423ec","type":"change","z":"f9337f21.0eab78","name":"Set Auto Color Temp","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.altitudePercent","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":940,"wires":[["9a110e75.82802"]]},{"id":"82929842.1531","type":"switch","z":"f9337f21.0eab78","name":"","property":"manual_ct.enabled","propertyType":"flow","rules":[{"t":"true"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":630,"y":920,"wires":[["d992f052.6d2dd8"],["17a47889.a03a2f"]]},{"id":"d992f052.6d2dd8","type":"change","z":"f9337f21.0eab78","name":"Set Manual CT","rules":[{"t":"set","p":"payload","pt":"msg","to":"manual_ct.value","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":900,"wires":[["9a110e75.82802"]]},{"id":"c0cc2888.9c36f8","type":"link in","z":"f9337f21.0eab78","name":"","links":["24b1694e.8d6176"],"x":95,"y":980,"wires":[["7a1e014f.2d5688"]]},{"id":"e834d70c.0d45a8","type":"comment","z":"f9337f21.0eab78","name":"Set the target color temperature for the house","info":"","x":250,"y":800,"wires":[]},{"id":"252d4ef4.c14b6a","type":"hubitat config","name":"Hubitat","usetls":false,"host":"172.16.0.27","port":"80","appId":"501","nodeRedServer":"http://172.16.0.25:1880","webhookPath":"/hubitat/webhook","autoRefresh":false,"useWebsocket":false},{"id":"96c207ac.2237a8","type":"position-config","name":"Home","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timeZoneOffset":"99","timeZoneDST":"0","stateTimeFormat":"3","stateDateFormat":"12"}]

I try to do as much as possible without third party nodes, but used the CT work from the node-red-contrib-sun-position library.

Hope you find this useful or enjoyable.

2 Likes

In response to @Shaneb's earlier post/issue with Mode Manager here is a very simple way to set HE modes in NR thanks to the "Set Mode" node... Wanted to post it here so as not to derail that thread which was more HE app centric. If using multiple HE Hubs you can either sync them directly here (my preference) or use HubMesh "Follow Another" feature.

For this you need the BigTimer Node found here:

For each Big Timer Node your "On Msg" must contain the proper mode name as appears in HE. Make sure you have your Lat/Long set for each BT node as well.

Change Modes in NR

[{"id":"1d66bfbd.33291","type":"bigtimer","z":"af91369d.586338","outtopic":"","outpayload1":"Morning","outpayload2":"","name":"Morning","comment":"","lat":"","lon":"","starttime":"5003","endtime":"720","starttime2":0,"endtime2":0,"startoff":0,"endoff":0,"startoff2":0,"endoff2":0,"offs":0,"outtext1":"","outtext2":"","timeout":1440,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":0,"month1":0,"day2":0,"month2":0,"day3":0,"month3":0,"day4":0,"month4":0,"day5":0,"month5":0,"day6":0,"month6":0,"day7":0,"month7":0,"day8":0,"month8":0,"day9":0,"month9":0,"day10":0,"month10":0,"day11":0,"month11":0,"day12":0,"month12":0,"d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"d6":0,"w6":0,"xday1":0,"xmonth1":0,"xday2":0,"xmonth2":0,"xday3":0,"xmonth3":0,"xday4":0,"xmonth4":0,"xday5":0,"xmonth5":0,"xday6":0,"xmonth6":0,"xday7":"","xmonth7":"","xday8":"","xmonth8":"","xday9":"","xmonth9":"","xday10":"","xmonth10":"","xday11":"","xmonth11":"","xday12":"","xmonth12":"","xd1":0,"xw1":0,"xd2":0,"xw2":0,"xd3":0,"xw3":0,"xd4":0,"xw4":0,"xd5":0,"xw5":0,"xd6":0,"xw6":0,"suspend":false,"random":false,"randon1":false,"randoff1":false,"randon2":false,"randoff2":false,"repeat":false,"atstart":true,"odd":false,"even":false,"x":440,"y":2340,"wires":[["7de303d2.4810dc"],[],[]]},{"id":"1c9e643e.7a0ecc","type":"bigtimer","z":"af91369d.586338","outtopic":"","outpayload1":"Afternoon","outpayload2":"","name":"Afternoon","comment":"","lat":"","lon":"","starttime":"720","endtime":"5001","starttime2":0,"endtime2":0,"startoff":0,"endoff":0,"startoff2":0,"endoff2":0,"offs":0,"outtext1":"","outtext2":"","timeout":1440,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":0,"month1":0,"day2":0,"month2":0,"day3":0,"month3":0,"day4":0,"month4":0,"day5":0,"month5":0,"day6":0,"month6":0,"day7":0,"month7":0,"day8":0,"month8":0,"day9":0,"month9":0,"day10":0,"month10":0,"day11":0,"month11":0,"day12":0,"month12":0,"d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"d6":0,"w6":0,"xday1":0,"xmonth1":0,"xday2":0,"xmonth2":0,"xday3":0,"xmonth3":0,"xday4":0,"xmonth4":0,"xday5":0,"xmonth5":0,"xday6":0,"xmonth6":0,"xday7":"","xmonth7":"","xday8":"","xmonth8":"","xday9":"","xmonth9":"","xday10":"","xmonth10":"","xday11":"","xmonth11":"","xday12":"","xmonth12":"","xd1":0,"xw1":0,"xd2":0,"xw2":0,"xd3":0,"xw3":0,"xd4":0,"xw4":0,"xd5":0,"xw5":0,"xd6":0,"xw6":0,"suspend":false,"random":false,"randon1":false,"randoff1":false,"randon2":false,"randoff2":false,"repeat":false,"atstart":true,"odd":false,"even":false,"x":440,"y":2420,"wires":[["7de303d2.4810dc"],[],[]]},{"id":"1544d82a.62c1c8","type":"bigtimer","z":"af91369d.586338","outtopic":"","outpayload1":"Evening","outpayload2":"","name":"Evening","comment":"","lat":"","lon":"","starttime":"5001","endtime":"5005","starttime2":0,"endtime2":0,"startoff":0,"endoff":0,"startoff2":0,"endoff2":0,"offs":0,"outtext1":"","outtext2":"","timeout":1440,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":0,"month1":0,"day2":0,"month2":0,"day3":0,"month3":0,"day4":0,"month4":0,"day5":0,"month5":0,"day6":0,"month6":0,"day7":0,"month7":0,"day8":0,"month8":0,"day9":0,"month9":0,"day10":0,"month10":0,"day11":0,"month11":0,"day12":0,"month12":0,"d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"d6":0,"w6":0,"xday1":0,"xmonth1":0,"xday2":0,"xmonth2":0,"xday3":0,"xmonth3":0,"xday4":0,"xmonth4":0,"xday5":0,"xmonth5":0,"xday6":0,"xmonth6":0,"xday7":"","xmonth7":"","xday8":"","xmonth8":"","xday9":"","xmonth9":"","xday10":"","xmonth10":"","xday11":"","xmonth11":"","xday12":"","xmonth12":"","xd1":0,"xw1":0,"xd2":0,"xw2":0,"xd3":0,"xw3":0,"xd4":0,"xw4":0,"xd5":0,"xw5":0,"xd6":0,"xw6":0,"suspend":false,"random":false,"randon1":false,"randoff1":false,"randon2":false,"randoff2":false,"repeat":false,"atstart":true,"odd":false,"even":false,"x":440,"y":2500,"wires":[["7de303d2.4810dc"],[],[]]},{"id":"8e228910.624158","type":"bigtimer","z":"af91369d.586338","outtopic":"","outpayload1":"Night","outpayload2":"","name":"Night","comment":"","lat":"","lon":"","starttime":"5005","endtime":"5006","starttime2":0,"endtime2":0,"startoff":0,"endoff":0,"startoff2":0,"endoff2":0,"offs":0,"outtext1":"","outtext2":"","timeout":1440,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":0,"month1":0,"day2":0,"month2":0,"day3":0,"month3":0,"day4":0,"month4":0,"day5":0,"month5":0,"day6":0,"month6":0,"day7":0,"month7":0,"day8":0,"month8":0,"day9":0,"month9":0,"day10":0,"month10":0,"day11":0,"month11":0,"day12":0,"month12":0,"d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"d6":0,"w6":0,"xday1":0,"xmonth1":0,"xday2":0,"xmonth2":0,"xday3":0,"xmonth3":0,"xday4":0,"xmonth4":0,"xday5":0,"xmonth5":0,"xday6":0,"xmonth6":0,"xday7":"","xmonth7":"","xday8":"","xmonth8":"","xday9":"","xmonth9":"","xday10":"","xmonth10":"","xday11":"","xmonth11":"","xday12":"","xmonth12":"","xd1":0,"xw1":0,"xd2":0,"xw2":0,"xd3":0,"xw3":0,"xd4":0,"xw4":0,"xd5":0,"xw5":0,"xd6":0,"xw6":0,"suspend":false,"random":false,"randon1":false,"randoff1":false,"randon2":false,"randoff2":false,"repeat":false,"atstart":true,"odd":false,"even":false,"x":430,"y":2580,"wires":[["7de303d2.4810dc"],[],[]]},{"id":"7de303d2.4810dc","type":"change","z":"af91369d.586338","name":"msg.mode = msg.payload","rules":[{"t":"set","p":"mode","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":2460,"wires":[["7c1ba1fb.67e47"]]},{"id":"7c1ba1fb.67e47","type":"hubitat mode-setter","z":"af91369d.586338","name":"","server":"","modeId":"","x":1000,"y":2460,"wires":[[]]}]

Note: In earlier posts in this thread I used posted an example with a subflow I wrote that converted the mode name to it's mode id but that is now completely unnecessary unless you are into needlessly over-engineering things as I seem to be. :nerd_face:


Here's the ShaneB's post..

3 Likes

I've got a sequence that I've been using to push weather alerts to our phones and generate Alexa announcements. I switched to @bptworld's weather.gov app from the Openweather alerts app since it can split out multiple alerts if more than one is issued at a time and allow me to prioritize messaging for each alert. One thing that I can't seem to figure out, and maybe I'm missing something simple, is the Alexa announcement for the base alert doesn't work (everything else works exactly as intended so far). Sequence:

[{"id":"83145f42.4888a","type":"subflow","name":"Notification Handler","info":"","category":"","in":[{"x":60,"y":80,"wires":[{"id":"7cdac718.2ce508"}]}],"out":[],"env":[],"color":"#DDAA99"},{"id":"7cdac718.2ce508","type":"pushover","z":"83145f42.4888a","name":"","device":"","title":"","priority":0,"sound":"","url":"","url_title":"","html":false,"x":180,"y":80,"wires":[]},{"id":"8ab89531.7b8a18","type":"inject","z":"d8914092.480f3","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":2260,"wires":[["cda19404.3e4438"]]},{"id":"5c0de06e.f4c1e","type":"subflow:83145f42.4888a","z":"d8914092.480f3","name":"","x":1290,"y":2080,"wires":[]},{"id":"a9f721e4.9d4d1","type":"inject","z":"d8914092.480f3","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":2140,"wires":[["14e20b9.de134f4"]]},{"id":"f5f249c0.4880d8","type":"join","z":"d8914092.480f3","name":"","mode":"custom","build":"object","property":"payload.value","propertyType":"msg","key":"payload.name","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"5","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":530,"y":2200,"wires":[["cef0afeb.11618"]]},{"id":"b2c99b7a.44ee78","type":"function","z":"d8914092.480f3","name":"Set regular message","func":"//Set error message\nvar message = msg.payload.value.alertDescription_0;\nvar topic = msg.payload.value.alertHeadline_0;\nvar priority = 0; //values are -2,-1,0,1,2\nvar device = \"\"; //Blank device = All\nvar url = \"\"; // url to be included in message\nvar url_title = \"\";// title of URL\nvar sound = \"\"; // notifcation sound\nvar attachmentPath = \"\"; //file path if attachment is included\n\n//Inputs for Notification Subflow\n\nmsg.payload = message;\nmsg.topic = topic;\nmsg.device = device;\nmsg.priority = priority;\nmsg.url = url;\nmsg.url_title = url_title\nmsg.attachment = attachmentPath;\nmsg.sound = sound;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":960,"y":2080,"wires":[["5c0de06e.f4c1e"]]},{"id":"cef0afeb.11618","type":"switch","z":"d8914092.480f3","name":"Alert Severity","property":"payload.value.alertHeadline_0","propertyType":"msg","rules":[{"t":"cont","v":"Wind Advisory","vt":"str"},{"t":"cont","v":"Special Weather Statement","vt":"str"},{"t":"cont","v":"Winter Weather Advisory","vt":"str"},{"t":"cont","v":"Snow Advisory","vt":"str"},{"t":"cont","v":"Flood Watch","vt":"str"},{"t":"cont","v":"Severe Thunderstorm Watch","vt":"str"},{"t":"cont","v":"High Wind Watch","vt":"str"},{"t":"cont","v":"Significant Weather Advisory","vt":"str"},{"t":"cont","v":"Winter Storm Watch","vt":"str"},{"t":"cont","v":"Tornado Watch","vt":"str"},{"t":"cont","v":"Winter Storm Warning","vt":"str"},{"t":"cont","v":"Severe Thunderstorm Warning","vt":"str"},{"t":"cont","v":"Tornado Warning","vt":"str"},{"t":"cont","v":"Wind Chill Warning","vt":"str"},{"t":"cont","v":"High Wind Warning","vt":"str"},{"t":"cont","v":"Flood Warning","vt":"str"}],"checkall":"false","repair":false,"outputs":16,"x":690,"y":2200,"wires":[["b2c99b7a.44ee78","2f342414.5f912c"],["b2c99b7a.44ee78","2f342414.5f912c"],["b2c99b7a.44ee78","2f342414.5f912c"],["2f342414.5f912c","b2c99b7a.44ee78"],["b2c99b7a.44ee78","2f342414.5f912c"],["b2c99b7a.44ee78","2f342414.5f912c"],["63b99c71.5b61b4","e639f1ea.c9763"],["63b99c71.5b61b4","e639f1ea.c9763"],["63b99c71.5b61b4","e639f1ea.c9763"],["63b99c71.5b61b4","e639f1ea.c9763"],["531d2e29.a3056","96ba6b6f.8e7458"],["531d2e29.a3056","96ba6b6f.8e7458"],["531d2e29.a3056","96ba6b6f.8e7458"],["531d2e29.a3056","96ba6b6f.8e7458"],["531d2e29.a3056","96ba6b6f.8e7458"],["96ba6b6f.8e7458","531d2e29.a3056"]]},{"id":"63b99c71.5b61b4","type":"function","z":"d8914092.480f3","name":"Set medium priority message","func":"//Set error message\nvar message = msg.payload.value.alertDescription_0;\nvar topic = msg.payload.value.alertHeadline_0;\nvar priority = 1; //values are -2,-1,0,1,2\nvar device = \"\"; //Blank device = All\nvar url = \"\"; // url to be included in message\nvar url_title = \"\";// title of URL\nvar sound = \"echo\"; // notifcation sound\nvar attachmentPath = \"\"; //file path if attachment is included\n\n//Inputs for Notification Subflow\n\nmsg.payload = message;\nmsg.topic = topic;\nmsg.device = device;\nmsg.priority = priority;\nmsg.url = url;\nmsg.url_title = url_title\nmsg.attachment = attachmentPath;\nmsg.sound = sound;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":980,"y":2200,"wires":[["5b484df7.12ddc4"]]},{"id":"5b484df7.12ddc4","type":"subflow:83145f42.4888a","z":"d8914092.480f3","name":"","x":1290,"y":2200,"wires":[]},{"id":"531d2e29.a3056","type":"function","z":"d8914092.480f3","name":"Set high priority message","func":"//Set error message\nvar message = msg.payload.value.alertDescription_0;\nvar topic = msg.payload.value.alertHeadline_0;\nvar priority = 2; //values are -2,-1,0,1,2\nvar device = \"\"; //Blank device = All\nvar url = \"\"; // url to be included in message\nvar url_title = \"\";// title of URL\nvar sound = \"persistent\"; // notifcation sound\nvar attachmentPath = \"\"; //file path if attachment is included\n\n//Inputs for Notification Subflow\n\nmsg.payload = message;\nmsg.topic = topic;\nmsg.device = device;\nmsg.priority = priority;\nmsg.url = url;\nmsg.url_title = url_title\nmsg.attachment = attachmentPath;\nmsg.sound = sound;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":970,"y":2340,"wires":[["a28ed2ca.3b9d8"]]},{"id":"a28ed2ca.3b9d8","type":"subflow:83145f42.4888a","z":"d8914092.480f3","name":"","x":1290,"y":2340,"wires":[]},{"id":"23871762.47e8d8","type":"alexa-remote-routine","z":"d8914092.480f3","name":"","account":"450a069.149d6f8","routineNode":{"type":"custom","payload":{"type":"msg","value":"payload"}},"x":1300,"y":2120,"wires":[[]]},{"id":"2f342414.5f912c","type":"switch","z":"d8914092.480f3","name":"","property":"currentMode","propertyType":"global","rules":[{"t":"neq","v":"Night","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":910,"y":2120,"wires":[["aa0c9213.9b598"]]},{"id":"96ba6b6f.8e7458","type":"function","z":"d8914092.480f3","name":"Set Alexa announcement","func":"return {\n    \"payload\": {\n        \"type\": \"speak\",\n        \"payload\": {\n            \"type\": \"announcement\",\n            \"volume\": 75,\n            \"devices\": [\"The May's Echo Show\"][\"Zack's Echo Spot\"], \n            \"text\": msg.payload.value.alertHeadline_0 + \" \" + msg.payload.value.alertDescription_0   \n        }\n    }\n};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1090,"y":2300,"wires":[["d60130d6.39d68"]]},{"id":"d60130d6.39d68","type":"alexa-remote-routine","z":"d8914092.480f3","name":"","account":"450a069.149d6f8","routineNode":{"type":"custom","payload":{"type":"msg","value":"payload"}},"x":1300,"y":2300,"wires":[[]]},{"id":"e639f1ea.c9763","type":"function","z":"d8914092.480f3","name":"Set Alexa Announcement","func":"return {\n    \"payload\": {\n        \"type\": \"speak\",\n        \"payload\": {\n            \"type\": \"announcement\",\n            \"volume\": 75,\n            \"devices\": [\"The May's Echo Show\"][\"Zack's Echo Spot\"], \n            \"text\": msg.payload.value.alertHeadline_0 + \" \" + msg.payload.value.alertDescription_0   \n        }\n    }\n};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1090,"y":2240,"wires":[["877615ce.371548"]]},{"id":"877615ce.371548","type":"alexa-remote-routine","z":"d8914092.480f3","name":"","account":"450a069.149d6f8","routineNode":{"type":"custom","payload":{"type":"msg","value":"payload"}},"x":1300,"y":2240,"wires":[[]]},{"id":"14e20b9.de134f4","type":"hubitat device","z":"d8914092.480f3","deviceLabel":"WDG - Abingdon Weather Data","name":"","server":"d6046962.d6e518","deviceId":"1057","attribute":"alertHeadline_0","sendEvent":true,"x":350,"y":2140,"wires":[["f5f249c0.4880d8"]]},{"id":"cda19404.3e4438","type":"hubitat device","z":"d8914092.480f3","deviceLabel":"WDG - Abingdon Weather Data","name":"","server":"d6046962.d6e518","deviceId":"1057","attribute":"alertDescription_0","sendEvent":true,"x":350,"y":2260,"wires":[["f5f249c0.4880d8"]]},{"id":"aa0c9213.9b598","type":"function","z":"d8914092.480f3","name":"Set Alexa Announcement","func":"return {\n    \"payload\": {\n        \"type\": \"speak\",\n        \"payload\": {\n            \"type\": \"announcement\",\n            \"volume\": 75,\n            \"devices\": [\"The May's Echo Show\"][\"Zack's Echo Spot\"], \n            \"text\":msg.payload.value.alertHeadline_0 +\" \"+ msg.payload.value.alertDescription_0  \n        }\n    }\n};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1090,"y":2120,"wires":[["23871762.47e8d8"]]},{"id":"450a069.149d6f8","type":"alexa-remote-account","name":"","authMethod":"proxy","proxyOwnIp":"localhost","proxyPort":"3456","cookieFile":"fileauth2","refreshInterval":"","alexaServiceHost":"pitangui.amazon.com","amazonPage":"amazon.com","acceptLanguage":"en-US","userAgent":"","useWsMqtt":"on","autoInit":"on"},{"id":"d6046962.d6e518","type":"hubitat config","name":"The Mays","usetls":false,"host":"10.0.0.120","port":"80","appId":"649","nodeRedServer":"http://10.0.3.8:1880","webhookPath":"/hubitat/webhook","autoRefresh":true,"useWebsocket":false}]

The message successfully pushes to our mobile devices, but the Alexa announcement does not work. This same sequence, only changing from the base alert 0 to alert 1 (for us a Wind Advisory), works as intended (I get both the Pushover notification and the Alexa announcement. The only change to the function node for Alexa text was to change msg.payload.value.alertHeading_0 to alertHeading_1 and the same for the alertDescription.

I've also taken out the combined msg.payload.value.alertHeading_0 + " " + msg.payload.value.alertDescription_0 and just changed it to msg.payload.value.alertHeading_0. This text is successfully announced; switching the text to only alertDescription_0 results in an unsuccessful announcement. Changing it to alertHeading_1 and alertDescription_1 results in successful announcements both times.

The nice thing for us (maybe not so much later today...) has been we actually have multiple weather advisories for me to work with testing this today; our phones are often in closer proximity than our weather radio, and the Openweather driver was nice over the winter for a heads-up but it didn't split alerts out if multiple were issued.

My guess is that this may be a issue with the Alexa remote 2 node, or maybe I've missed something?

1 Like

Wanted to post this here from the Node-RED thread.. more JSONATA fun!

Cross posting a solution for downloading the latest HE backup (not a new backup) with Node-red and appending the timestamp of the backup to the file name. The flow is in the post below:

UPDATE: I found a cleaner way of getting to the last row of the backup table by using different CSS selectors (the posted flow uses the "TD" tag and loops through the resulting array to get the date/time of the backup). The method below returns the data of the last row (latest backup) directly.

4 Likes

Because I can't seem to let the whole multi-tap thing go... here is a simple subflow that encapsulates the timed-counter & switch so you can separate single/double/triple/quadruple+ taps after a button press .. Also you set the timing in the properties of the subflow instance node.. default is 450 ms. Note: On my system (C-4) Lutron 5 button picos the 2 & 4 buttons seem to need a bit longer time for multi tap at 700 ms..

Not shown on this partial sequence is "Increase" and "Decrease" Levels - Thanks to multi tap I can control dimming on 2 different sets of lights with one set of up/down buttons.. of course you have to be careful and not click up or down too fast when accessing single tap set.. but it's pretty intuitive once you get the hang of it.

Make sure you install the "node-red-contrib-timed-counter" node before importing this...

Button Taps

[{"id":"d0e305e1.7ad558","type":"subflow","name":"Button Taps","info":"","category":"","in":[{"x":50,"y":30,"wires":[{"id":"4e584c74.8f1724"}]}],"out":[{"x":640,"y":40,"wires":[{"id":"959b5260.c1c1c","port":0}]},{"x":640,"y":100,"wires":[{"id":"959b5260.c1c1c","port":1}]},{"x":640,"y":160,"wires":[{"id":"959b5260.c1c1c","port":2}]},{"x":640,"y":220,"wires":[{"id":"959b5260.c1c1c","port":3}]}],"env":[{"name":"TIME_LIMIT_MS","type":"num","value":"450"}],"color":"#E2D96E","inputLabels":["Button Press"],"outputLabels":["Single Tap","Double Tap","Triple Tap","Quad+ Tap"],"icon":"node-red-dashboard/ui_button.png","status":{"x":640,"y":280,"wires":[{"id":"b4ba35d5.020018","port":0}]}},{"id":"959b5260.c1c1c","type":"switch","z":"d0e305e1.7ad558","name":"Single Tap \\n Double Tap \\n Triple Tap \\n Quad+ Tap","property":"count","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"3","vt":"str"},{"t":"gte","v":"4","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":430,"y":80,"wires":[[],[],[],[]]},{"id":"4e584c74.8f1724","type":"timed-counter","z":"d0e305e1.7ad558","name":"","timelimit":"${TIME_LIMIT_MS}","timeunit":1,"withhold":true,"fixedtimeout":false,"pertopic":false,"x":200,"y":80,"wires":[["959b5260.c1c1c","b4ba35d5.020018"]]},{"id":"b4ba35d5.020018","type":"function","z":"d0e305e1.7ad558","name":"set status payload","func":"\nvar payload = {\n\"fill\": \"green\",\n\"shape\":\"dot\",\n\"text\": ( msg.count == 1 ? \"Single\" : (msg.count == 2 ? \"Double\": (msg.count == 3 ? \"Triple\": (msg.count == 4 ? \"Quadruple\": msg.count.toString() )))) + \" Tap\"\n};\n\nmsg.payload = payload;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":410,"y":160,"wires":[[]]},{"id":"72661f7b.08887","type":"subflow:d0e305e1.7ad558","z":"af91369d.586338","name":"","x":880,"y":1980,"wires":[[],[],[],[]]}]


EDIT: Latest is here...

4 Likes

That's a nice little node. It removes the need for about 5 standard nodes. Thanks!

1 Like

This is a generic suggestion/tip. If you stop NodeRED by killing it, then it is preferred to use SIGINT over SIGKILL. SIGINT flushes all writes to disk before exiting the NR process cleanly, while SIGKILL terminates the process abruptly.

Edit: This is particularly important if your flows rely on storing context data on the local filesystem.

5 Likes

@mike - Have been having fun playing around with finite state machines. Wanted to post an image of my simple sequence I've done to handle timed lighting controls based on home/away + guests.

I am using the "node-red-contrib-finite-state-machine" node vs "node-red-contrib-state-machine" node - I kinda like the ability to code in the transitions via JSON. Also note - I left out the actual light control part. For that I have separate sublows for each state and am using the "node-red-contrib-presence-faker" node to control timing/on/off etc...

As an aside - I'm a really "fascinating" and "interesting" guy apparently at least according to my wife. :laughing: :thinking: :cry:

4 Likes

A totally non-biased view. :stuck_out_tongue_winking_eye:

Sadly my wife's comments are usually sarcastic and more often accurate in their intent than I would care to admit.. ah well what does she know about the thrill of Finite State Machine transitions anyway?

:rofl:

1 Like

I suggest you ask her.
:rofl:

Well I tried and that's why I ended up posting here.. :rofl:

3 Likes

That looks good. I might transition. The one I use has a start up error that I asked about here.

1 Like