There's a famous outlet in Japan next to our office there where I was told people used to queue down the street every day when it first opened. This practice continued for several years apparently, it was so so popular. Love 'em but they're not good for my diet (which is not really a diet at all, it's more just wishful thinking really)
Donuts, too.
Bad donuts are hardware. KKs are definitely software.
Title - Randomized greeting/departure announcement
Summary - This one will take a little bit of work to convert to the HE node pallet, but somebody adventurous can give it a go (I'm looking at you @aaiyar since you've got the wait conditions with loops figured out ). I have lots of fun with this one.
This is triggered by presence arrival/departure for 2 people. Checks who arrived (or both) within the past 5 minutes, chooses a randomized arrival greeting, waits for door to open and then close and speaks the random greeting on Alexa. Could easily be expanded to support more people by expanding the names in the unsafe-function node.
Picture -
Flow
[{"id":"fe22ec90.1f7b4","type":"ha-get-entities","z":"43efc72.aa76338","server":"94fdcfdf.a00b","name":"","rules":[{"property":"entity_id","logic":"includes","value":"switch.mike_presence, switch.ashley_presence","valueType":"str"},{"property":"state","logic":"is","value":"on","valueType":"str"},{"property":"timeSinceChangedMs","logic":"lt","value":"300000","valueType":"num"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":130,"y":460,"wires":[["dce1b1d1.9a685"]]},{"id":"dce1b1d1.9a685","type":"template","z":"43efc72.aa76338","name":"Format Names","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload.attributes.friendly_name}}","output":"str","x":300,"y":460,"wires":[["c675d5c9.a6bdd8"]]},{"id":"c675d5c9.a6bdd8","type":"join","z":"43efc72.aa76338","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":", ","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":450,"y":460,"wires":[["eef7b7e8.d8c558"]]},{"id":"eef7b7e8.d8c558","type":"unsafe-function","z":"43efc72.aa76338","name":"Random Message","func":"var device=msg.payload\nmsg.payload = {};\nmsg.payload.domain = {};\nmsg.payload.service = {};\nmsg.payload.data = {};\nmsg.payload.data.data = {};\nmsg.payload.data.data.type = {};\nmsg.payload.data.message = {};\n\nif (device == 'Mike - Presence') {\n var name = 'Mike';\n var isAre = 'is';\n} else if (device === 'OTHER - Presence') {\n var name = 'OTHER';\n var isAre = 'is';\n} else if (device == 'Mike - Presence, OTHER - Presence' || device == 'OTHER - Presence, Mike - Presence') {\n var name ='Mike and OTHER';\n var isAre = 'are';\n}\n\nvar messageOpening = [\n "Welcome Home",\n "How you doing",\n "What's up",\n "Long time no see",\n "Hey",\n "Nice to see you",\n "Look who's home, it's",\n "Nice to have you back",\n "Howdy do",\n "What's going on",\n "How is everything",\n "It's feels like ages since I've seen you",\n "Where have you been hiding",\n "How's it hanging",\n "What's cookin",\n "What's shakin",\n "Greetings and salutations",\n "How goes it",\n "What's happening",\n "How goes it",\n "Roll out the red carpet for"\n];\n\nvar messageClosing = [\n "in the house! Ooo oooo",\n "here.",\n "home.",\n "joining the party",\n "crashing the party",\n "gracing us with their presence",\n "dropping anchor",\n "dropping in",\n "making the scene",\n "barging in",\n "showing up",\n "blowing in",\n "appearing",\n "breezing in",\n "rolling in",\n "popping in",\n "finally home"\n];\n\n\nvar randomOpening = messageOpening[Math.floor(Math.random()*messageOpening.length)];\nvar randomClosing = messageClosing[Math.floor(Math.random()*messageClosing.length)];\nvar message = randomOpening + " " + name + "." + " " + name + " " + isAre + " " + randomClosing\n\nmsg.payload.domain = "notify"\nmsg.payload.service = "alexa_media_front_entrance_echo_dot"\nmsg.payload.data.data.type = "announce"\nmsg.payload.data.message = message\n\nreturn msg;","outputs":1,"noerr":0,"x":610,"y":460,"wires":[["b4e71139.15e7b"]]},{"id":"b4e71139.15e7b","type":"ha-wait-until","z":"43efc72.aa76338","name":"Door Opens","server":"94fdcfdf.a00b","outputs":2,"entityId":"binary_sensor.garage_door","entityIdFilterType":"exact","property":"state","comparator":"is","value":"on","valueType":"str","timeout":"5","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":790,"y":460,"wires":[["e9446d66.c088b"],[]]},{"id":"e9446d66.c088b","type":"ha-wait-until","z":"43efc72.aa76338","name":"Door Closes","server":"94fdcfdf.a00b","outputs":2,"entityId":"binary_sensor.garage_door","entityIdFilterType":"exact","property":"state","comparator":"is","value":"off","valueType":"str","timeout":"5","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":950,"y":460,"wires":[["9a733390.064f4"],[]]},{"id":"9a733390.064f4","type":"api-call-service","z":"43efc72.aa76338","name":"Speak Message","server":"94fdcfdf.a00b","version":1,"debugenabled":false,"service_domain":"notify","service":"alexa_media_front_entrance_echo_dot","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1120,"y":460,"wires":[[]]},{"id":"b1e2d385.f986d","type":"ha-get-entities","z":"43efc72.aa76338","server":"94fdcfdf.a00b","name":"","rules":[{"property":"entity_id","logic":"includes","value":"switch.mike_presence, switch.ashley_presence","valueType":"str"},{"property":"state","logic":"is","value":"off","valueType":"str"},{"property":"timeSinceChangedMs","logic":"lt","value":"300000","valueType":"num"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":130,"y":560,"wires":[["c069c1d8.2ffeb"]]},{"id":"c069c1d8.2ffeb","type":"template","z":"43efc72.aa76338","name":"Format Names","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload.attributes.friendly_name}}","output":"str","x":300,"y":560,"wires":[["b1e03b81.244208"]]},{"id":"b1e03b81.244208","type":"join","z":"43efc72.aa76338","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":", ","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":450,"y":560,"wires":[["ee858f3e.2a157"]]},{"id":"ee858f3e.2a157","type":"unsafe-function","z":"43efc72.aa76338","name":"Random Message","func":"var device=msg.payload\nmsg.payload = {};\nmsg.payload.domain = {};\nmsg.payload.service = {};\nmsg.payload.data = {};\nmsg.payload.data.data = {};\nmsg.payload.data.data.type = {};\nmsg.payload.data.message = {};\n\nif (device == 'Mike - Presence') {\n var name = 'Mike';\n var hasHave = 'has';\n} else if (device === 'OTHER - Presence') {\n var name = 'OTHER';\n var hasHave = 'has';\n} else if (device == 'Mike - Presence, OTHER - Presence' || device == 'OTHER - Presence, Mike - Presence') {\n var name ='Mike and OTHER';\n var hasHave = 'have';\n}\n\nvar messageOpening = [\n "Goodbye",\n "See you later",\n "Bye",\n "Live long and prosper",\n "Farewell",\n "Hope you have a great time",\n "Take care",\n "Smell you later",\n "Adios",\n "Caio",\n "Au revoir",\n "Sayonara",\n "Ta Ta for now",\n "Catch you later",\n "To-da-loo",\n "See you in the funny papers",\n "Toodles",\n "Godspeed",\n "So long",\n "Cheerio",\n "Arrivederci"\n];\n\nvar messageClosing = [\n "left the building",\n "gone out",\n "popped out",\n "left",\n "buggered off",\n "departed",\n "split",\n "vamoosed",\n "high tailed it",\n "escaped",\n "eight-six'd it",\n "bid farewell",\n "flaked off",\n "took a hike",\n "withdrawn",\n "exited",\n "vanished",\n "disappeared",\n "evacuated",\n "retreated",\n "taken their leave"\n];\n\n\nvar randomOpening = messageOpening[Math.floor(Math.random()*messageOpening.length)];\nvar randomClosing = messageClosing[Math.floor(Math.random()*messageClosing.length)];\nvar message = randomOpening + " " + name + "." + " " + name + " " + hasHave + " " + randomClosing\n\nmsg.payload.domain = "notify"\nmsg.payload.service = "alexa_media_front_entrance_echo_dot"\nmsg.payload.data.data.type = "announce"\nmsg.payload.data.message = message\n\nreturn msg;","outputs":1,"noerr":0,"x":610,"y":560,"wires":[["904ffb9e.c47158"]]},{"id":"904ffb9e.c47158","type":"delay","z":"43efc72.aa76338","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":780,"y":560,"wires":[["8cf021e4.e7e3e"]]},{"id":"8cf021e4.e7e3e","type":"api-call-service","z":"43efc72.aa76338","name":"Speak Message","server":"94fdcfdf.a00b","version":1,"debugenabled":false,"service_domain":"notify","service":"alexa_media_front_entrance_echo_dot","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":940,"y":560,"wires":[[]]},{"id":"893c5b2b.7de1f8","type":"comment","z":"43efc72.aa76338","name":"Announce departue","info":"","x":150,"y":520,"wires":[]},{"id":"46989487.63407c","type":"comment","z":"43efc72.aa76338","name":"Announce arrival","info":"","x":140,"y":420,"wires":[]},{"id":"94fdcfdf.a00b","type":"server","z":"","name":"Home Assistant","addon":true}]
I tried to import your flow because, for one, it's cool. But I keep getting this error
When I look at it, the code looks consistent to me, but I know about enough to be dangerous. Why the error? How do you fix it? Like, what's wrong? I'm sorry to be so curious. Helps me learn.
interesting we had the same kind of issue with @aaiyar network monitoring code
Yeah - it has a link out. When I’m back from my walk, I’ll fix it .... my bad
Just shared a flow with someone else and got a syntax error and he actually tried to copy and paste the flow back in to his node red and got the same error on something that's already created in HIS node red. Could this be a bug?
I suspect that something is being changed by posting it
maybe try using
code tags
test
more test
the error I am getting
at position 2060
font color="cyan">{{msg.
C in Cyan being highlighted
Would you mind importing it again? It should work now. I removed the link out/in nodes and tested importing it. The modified flow is in my original response (further up this thread).
Sorry about the hassle.
same error same place
It imports fine for me and is in a code block. So was the original ... very puzzling.
version of nodered? I am on 1.1.2
1.1.0
Try this - without hide details turned on. Still in a code-block.
[{"id":"f11a13be.36e21","type":"simpletime","z":"641677fe.7efb8","name":"","x":410,"y":660,"wires":[["c48f441a.c64868","12bb40d7.cee35f"]]},{"id":"c48f441a.c64868","type":"template","z":"641677fe.7efb8","name":"time","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{mydate}} {{mytimes}}","output":"str","x":650,"y":620,"wires":[["ef753891.93342"]]},{"id":"12bb40d7.cee35f","type":"switch","z":"641677fe.7efb8","name":"down < 100","property":"payload.speeds.download","propertyType":"msg","rules":[{"t":"lt","v":"100","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":670,"y":820,"wires":[["ff368af4.ae96d"]]},{"id":"9e3f58fe.e530e","type":"speedtest","z":"641677fe.7efb8","name":"Speedtest","serverId":"","maxTime":"120000","x":410,"y":600,"wires":[["aa623598.74eb98","b2a90ab2.32421","dbc3c3e7.20861","6755d730.02674","a012c307.cb4028","f11a13be.36e21"]]},{"id":"ef753891.93342","type":"ui_text","z":"641677fe.7efb8","group":"2a046f7e.21973","order":6,"width":0,"height":0,"name":"Last Speedtest","label":"Last Speedtest","format":"<font color=\"cyan\">{{msg.payload}}</font>","layout":"col-center","x":920,"y":620,"wires":[]},{"id":"ff368af4.ae96d","type":"change","z":"641677fe.7efb8","name":"Speed Test","rules":[{"t":"set","p":"topic","pt":"msg","to":"Speed Test","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":820,"wires":[["aa219933.4c2e6"]]},{"id":"aa623598.74eb98","type":"change","z":"641677fe.7efb8","name":"download","rules":[{"t":"set","p":"topic","pt":"msg","to":"Download","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload.speeds.download","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":540,"wires":[["b61f1f5e.41d8b8","288318fc.e25458"]]},{"id":"b2a90ab2.32421","type":"change","z":"641677fe.7efb8","name":"upload","rules":[{"t":"set","p":"topic","pt":"msg","to":"Upload","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload.speeds.upload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":580,"wires":[["bd35f52c.df077","288318fc.e25458"]]},{"id":"dbc3c3e7.20861","type":"change","z":"641677fe.7efb8","name":"ping","rules":[{"t":"set","p":"topic","pt":"msg","to":"Ping","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload.server.ping","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":660,"wires":[["8b605dac.f72bd","1ee5385b.d78bb"]]},{"id":"6755d730.02674","type":"change","z":"641677fe.7efb8","name":"distance","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.server.distanceMi","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"Distance","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":700,"wires":[["4402db66.176ac4","1ee5385b.d78bb"]]},{"id":"a012c307.cb4028","type":"change","z":"641677fe.7efb8","name":"ISP","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.server.sponsor","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":740,"wires":[["ce98fa70.5faaa"]]},{"id":"9015ffc1.ef6a1","type":"ui_button","z":"641677fe.7efb8","name":"","group":"2a046f7e.21973","order":3,"width":0,"height":0,"label":"SpeedTest Now!","color":"","icon":"","payload":"","payloadType":"date","topic":"","x":190,"y":560,"wires":[["9e3f58fe.e530e"]]},{"id":"5493692d.1d584","type":"cronplus","z":"641677fe.7efb8","name":"5 minutes past the hour","outputField":"payload","timeZone":"","outputs":1,"options":[{"topic":"5 past every hour","payload":"start","type":"str","expression":"5 * * * *","name":"5 past every hour"}],"x":170,"y":640,"wires":[["9e3f58fe.e530e"]]},{"id":"aa219933.4c2e6","type":"template","z":"641677fe.7efb8","name":"SMS","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Internet speed was {{payload.speeds.download}}/{{payload.speeds.upload}} (down/up Mbits/s) at {{mytimes}} on {{mymonthn}}/{{mydom}}. Speedtest server was {{payload.server.sponsor}}.","output":"str","x":1010,"y":820,"wires":[["5b712b3b.4d3b0c"]]},{"id":"b61f1f5e.41d8b8","type":"ui_gauge","z":"641677fe.7efb8","name":"","group":"2a046f7e.21973","order":7,"width":0,"height":0,"gtype":"gage","title":"Download Speed","label":"Download Mbits","format":"{{value}}","min":0,"max":"150","colors":["#ff002d","#e4b400","#03f81f"],"seg1":"50","seg2":"100","x":930,"y":540,"wires":[]},{"id":"288318fc.e25458","type":"ui_chart","z":"641677fe.7efb8","name":"Performance Chart","group":"6dbda234.52c8cc","order":2,"width":12,"height":6,"label":"Performance Chart","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"2","removeOlderPoints":"","removeOlderUnit":"86400","cutout":"","useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"x":930,"y":340,"wires":[["4860da2.4f503a4"]]},{"id":"bd35f52c.df077","type":"ui_gauge","z":"641677fe.7efb8","name":"","group":"2a046f7e.21973","order":8,"width":0,"height":0,"gtype":"gage","title":"Upload Speed","label":"Upload MBits","format":"{{value}}","min":0,"max":"15","colors":["#ff002d","#ffed36","#03f81f"],"seg1":"2","seg2":"8","x":920,"y":580,"wires":[]},{"id":"8b605dac.f72bd","type":"ui_text","z":"641677fe.7efb8","group":"2a046f7e.21973","order":4,"width":0,"height":0,"name":"","label":"Ping Time","format":"<font color=\"cyan\">{{msg.payload}}</font>","layout":"col-center","x":910,"y":660,"wires":[]},{"id":"1ee5385b.d78bb","type":"ui_chart","z":"641677fe.7efb8","name":"Latency Chart","group":"6dbda234.52c8cc","order":4,"width":12,"height":6,"label":"Latency Chart","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"2","removeOlderPoints":"","removeOlderUnit":"86400","cutout":"","useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"x":920,"y":460,"wires":[["84fc2070.d9275"]]},{"id":"4402db66.176ac4","type":"ui_text","z":"641677fe.7efb8","group":"2a046f7e.21973","order":5,"width":0,"height":0,"name":"","label":"Distance","format":"<font color=\"cyan\">{{msg.payload}} mi</font>","layout":"col-center","x":900,"y":700,"wires":[]},{"id":"ce98fa70.5faaa","type":"ui_text","z":"641677fe.7efb8","group":"2a046f7e.21973","order":2,"width":0,"height":0,"name":"","label":"Hosted By","format":"<font color=\"cyan\">{{msg.payload}}</font>","layout":"col-center","x":910,"y":740,"wires":[]},{"id":"5b712b3b.4d3b0c","type":"e-mail","z":"641677fe.7efb8","server":"localhost","port":"25","secure":false,"tls":false,"name":"5042727138@msg.fi.google.com","dname":"SMS Notification","x":1190,"y":820,"wires":[]},{"id":"4860da2.4f503a4","type":"file","z":"641677fe.7efb8","name":"Speed Test Data Save","filename":"/home/odroid/.node-red/data/speedtest/speedtestData.json","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":1180,"y":340,"wires":[[]]},{"id":"976aad37.93366","type":"json","z":"641677fe.7efb8","name":"","x":1150,"y":280,"wires":[["288318fc.e25458"]]},{"id":"84fc2070.d9275","type":"file","z":"641677fe.7efb8","name":"Speed Test Data Save","filename":"/home/odroid/.node-red/data/speedtest/speedtestDataPD.json","appendNewline":false,"createDir":false,"overwriteFile":"true","x":1180,"y":420,"wires":[[]]},{"id":"1b6007eb.95fd98","type":"json","z":"641677fe.7efb8","name":"","x":1150,"y":520,"wires":[["1ee5385b.d78bb"]]},{"id":"559e7829.3d7fb","type":"file in","z":"641677fe.7efb8","name":"Speed Test Data Restore","filename":"/home/odroid/.node-red/data/speedtest/speedtestData.json","format":"utf8","x":1190,"y":380,"wires":[["976aad37.93366"]]},{"id":"1d72d587.de0bd2","type":"file in","z":"641677fe.7efb8","name":"Speed Test Data Restore","filename":"/home/odroid/.node-red/data/speedtest/speedtestDataPD.json","format":"utf8","x":1190,"y":460,"wires":[["1b6007eb.95fd98"]]},{"id":"e65149c6.542d","type":"inject","z":"641677fe.7efb8","name":"","repeat":"","crontab":"","once":true,"topic":"","payload":"restore","payloadType":"str","x":920,"y":400,"wires":[["559e7829.3d7fb","1d72d587.de0bd2"]]},{"id":"2a046f7e.21973","type":"ui_group","z":"","name":"Graphs","tab":"929d3236.90d2","order":1,"disp":false,"width":"6","collapse":false},{"id":"6dbda234.52c8cc","type":"ui_group","z":"","name":"Charts","tab":"929d3236.90d2","order":2,"disp":false,"width":"12","collapse":false},{"id":"929d3236.90d2","type":"ui_tab","z":"","name":"Internet Speed","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
that worked!
I'm trying to pipe HE's logs into NR logging using NR socket listener. I had seen a previous, non NR posting, on setup; of course cant it now...
TIA
Found it: ws://hubip/logsocket
Title - Fan control via inside temp comparison with outside temp check.
Summary - Turns on the ceiling fan above our wood stove when the temperature in that room is +5 degrees warmer then the room next to it (this should only occur if the wood stove is going). If that happens while the outside temp is under 40 degrees; turn on the fan. To prevent my wife getting wind chill in the AM, when the temp difference drops below +3 turn the fan off (the fire is out and the house is equaling off). Thanks to @JasonJoel for the function code help
Flow
[{"id":"d59b8c3c.ba0aa","type":"group","z":"ce2603c5.15dfa","name":"","style":{"fill":"#c8e7a7","label":true},"nodes":["597ac14c.92178","f6c39fa6.83bc1","3a060f2c.44063","c898d1b5.bf791","3ee1303f.32e1e","54a9dc8e.b81ee4","2e361256.600f8e","3af12d48.ed57f2","1963f122.4a5bcf","fb47395b.ed7108","df9d182f.7a15b8","21679210.ef87ae","6a8f0b3e.c399c4"],"x":34,"y":39,"w":1419.0000495910645,"h":201.0000147819519},{"id":"597ac14c.92178","type":"hubitat device","z":"ce2603c5.15dfa","g":"d59b8c3c.ba0aa","name":"Family Room Temp","server":"e56053d2.c7d11","deviceId":"756","attribute":"temperature","sendEvent":true,"x":196.00006866455078,"y":144.0000114440918,"wires":[["3ee1303f.32e1e"]]},{"id":"f6c39fa6.83bc1","type":"switch","z":"ce2603c5.15dfa","g":"d59b8c3c.ba0aa","name":"true/false","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"true","vt":"str"},{"t":"cont","v":"false","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":825.0001182556152,"y":166.00001525878906,"wires":[["df9d182f.7a15b8"],["21679210.ef87ae"]]},{"id":"3a060f2c.44063","type":"comment","z":"ce2603c5.15dfa","g":"d59b8c3c.ba0aa","name":"🌡️ - Winter Fan On/Off when +5/+3","info":"","x":200,"y":80,"wires":[]},{"id":"c898d1b5.bf791","type":"function","z":"ce2603c5.15dfa","g":"d59b8c3c.ba0aa","name":"Family Room > Desk +5?","func":"var msg = {};\n\nvar familyroomTemp = flow.get(\"familyroomTemp\")\nvar deskmotionTemp = flow.get(\"deskmotionTemp\");\n\nif (!familyroomTemp || !deskmotionTemp) {\n return;\n}\n\nif (familyroomTemp > (deskmotionTemp +5)) {\n msg.payload = true;\n return msg;\n}\n\nif (familyroomTemp < (deskmotionTemp +3)) {\n msg.payload = false;\n return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":641.0000686645508,"y":166.00001335144043,"wires":[["f6c39fa6.83bc1"]]},{"id":"3ee1303f.32e1e","type":"change","z":"ce2603c5.15dfa","g":"d59b8c3c.ba0aa","name":"set familyroomTemp","rules":[{"t":"set","p":"familyroomTemp","pt":"flow","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":406.0000686645508,"y":144.0000114440918,"wires":[["c898d1b5.bf791"]]},{"id":"54a9dc8e.b81ee4","type":"hubitat device","z":"ce2603c5.15dfa","g":"d59b8c3c.ba0aa","name":"Office Motion Temp","server":"e56053d2.c7d11","deviceId":"2251","attribute":"temperature","sendEvent":true,"x":196.00006866455078,"y":199.0000147819519,"wires":[["2e361256.600f8e"]]},{"id":"2e361256.600f8e","type":"change","z":"ce2603c5.15dfa","g":"d59b8c3c.ba0aa","name":"set deskmotionTemp","rules":[{"t":"set","p":"deskmotionTemp","pt":"flow","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":407.0000686645508,"y":199.0000114440918,"wires":[["c898d1b5.bf791"]]},{"id":"3af12d48.ed57f2","type":"hubitat command","z":"ce2603c5.15dfa","g":"d59b8c3c.ba0aa","name":"Family Room Fan On","server":"e56053d2.c7d11","deviceId":"587","command":"on","commandArgs":"","x":1327.0000495910645,"y":145.0000114440918,"wires":[[]]},{"id":"1963f122.4a5bcf","type":"hubitat command","z":"ce2603c5.15dfa","g":"d59b8c3c.ba0aa","name":"Family Room Fan Off","server":"e56053d2.c7d11","deviceId":"587","command":"off","commandArgs":"","x":1325.0001068115234,"y":186.0000114440918,"wires":[[]]},{"id":"fb47395b.ed7108","type":"switch","z":"ce2603c5.15dfa","g":"d59b8c3c.ba0aa","name":"Below 40?","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"40","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1138.0000076293945,"y":137.00000762939453,"wires":[["3af12d48.ed57f2"]]},{"id":"df9d182f.7a15b8","type":"hubitat device","z":"ce2603c5.15dfa","g":"d59b8c3c.ba0aa","name":"OutsideTemp","server":"c8979c8a.67001","deviceId":"161","attribute":"temperature","sendEvent":false,"x":979.0000534057617,"y":140.00001335144043,"wires":[["fb47395b.ed7108"]]},{"id":"21679210.ef87ae","type":"hubitat device","z":"ce2603c5.15dfa","g":"d59b8c3c.ba0aa","name":"OutsideTemp","server":"c8979c8a.67001","deviceId":"161","attribute":"temperature","sendEvent":false,"x":979.0000495910645,"y":190.00001525878906,"wires":[["6a8f0b3e.c399c4"]]},{"id":"6a8f0b3e.c399c4","type":"switch","z":"ce2603c5.15dfa","g":"d59b8c3c.ba0aa","name":"Below 40?","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"40","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1139.0000114440918,"y":190.00001335144043,"wires":[["1963f122.4a5bcf"]]},{"id":"e56053d2.c7d11","type":"hubitat config","z":"","name":"Devices Hub","usetls":false,"host":"10.13.9.11","port":"80","appId":"2532","nodeRedServer":"http://10.13.9.28:1880","webhookPath":"/hubitat/webhook__","autoRefresh":true,"useWebsocket":false},{"id":"c8979c8a.67001","type":"hubitat config","z":"","name":"Apps Hub","usetls":false,"host":"10.13.9.12","port":"80","appId":"899","nodeRedServer":"http://10.13.9.28:1880","webhookPath":"/hubitat/webhook___","autoRefresh":true,"useWebsocket":false}]
Title - Outside Light On and Off + Change with Motion
Summary - (this could be better) but I have created my outside light to come on at Dusk at 1% and off at Dawn, in inbetween those times if motion is detected the light goes upto 100% and goes back down to 1% once motion has stopped. This uses node-red-contrib-bigtimer & node-red-contrib-time-range-switch
Picture -
Flow -
Summary
[{"id":"73237910.0a2008","type":"hubitat device","z":"59821e52.c4335","name":"Front Door","server":"89a479f5.5c31e8","deviceId":"164","attribute":"motion","sendEvent":true,"x":90,"y":200,"wires":[["6efa468f.3981c8"]]},{"id":"6efa468f.3981c8","type":"switch","z":"59821e52.c4335","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":300,"y":200,"wires":[["e54b0756.fc7b38"],["72f28de3.e1f6d4"]]},{"id":"6f351f4.c3bdfe","type":"hubitat command","z":"59821e52.c4335","name":"Outside Light 1%","server":"89a479f5.5c31e8","deviceId":"650","command":"setLevel","commandArgs":"1","x":750,"y":220,"wires":[[]]},{"id":"eeb04e1.acb47b","type":"hubitat command","z":"59821e52.c4335","name":"Outside Light Off","server":"89a479f5.5c31e8","deviceId":"650","command":"off","commandArgs":"","x":550,"y":80,"wires":[[]]},{"id":"7c0ff5d9.4e653c","type":"hubitat command","z":"59821e52.c4335","name":"Outside Light On","server":"89a479f5.5c31e8","deviceId":"650","command":"on","commandArgs":"","x":550,"y":40,"wires":[[]]},{"id":"7e96d26c.12185c","type":"switch","z":"59821e52.c4335","name":"On (1) - Off (0)","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":340,"y":80,"wires":[["7c0ff5d9.4e653c"],["eeb04e1.acb47b"]]},{"id":"957b1404.bf00a8","type":"bigtimer","z":"59821e52.c4335","outtopic":"","outpayload1":"","outpayload2":"","name":"Big Timer","comment":"","lat":"52.699219","lon":"-1.367270","starttime":5001,"endtime":"5000","starttime2":0,"endtime2":"0","startoff":0,"endoff":0,"startoff2":0,"endoff2":0,"offs":0,"outtext1":"1","outtext2":"0","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,"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,"repeat":true,"atstart":true,"odd":false,"even":false,"x":100,"y":80,"wires":[["7e96d26c.12185c"],[],["7e96d26c.12185c"]]},{"id":"e54b0756.fc7b38","type":"time-range-switch","z":"59821e52.c4335","name":"","lat":"52.699219","lon":"-1.367270","startTime":"dusk","endTime":"dawn","startOffset":"1","endOffset":"-1","x":530,"y":160,"wires":[["f5fab64c.1a05b8"],[]]},{"id":"72f28de3.e1f6d4","type":"time-range-switch","z":"59821e52.c4335","name":"","lat":"52.699219","lon":"-1.367270","startTime":"dusk","endTime":"dawn","startOffset":0,"endOffset":0,"x":530,"y":240,"wires":[["6f351f4.c3bdfe"],[]]},{"id":"f5fab64c.1a05b8","type":"hubitat command","z":"59821e52.c4335","name":"Outside Light 100%","server":"89a479f5.5c31e8","deviceId":"650","command":"setLevel","commandArgs":"100","x":750,"y":140,"wires":[[]]},{"id":"89a479f5.5c31e8","type":"hubitat config","z":"","name":"AVA","usetls":false,"host":"192.168.4.32","port":"80","appId":"966","nodeRedServer":"http://192.168.2.15:1880","webhookPath":"/hubitat/webhook_","autoRefresh":true,"useWebsocket":false}]