I find "share your flows" posts useful. So here some I use

At the beginning I found these posts about people sharing their flows very useful. So here I am sharing a few automations I created recently. I Believe these can give you some ideas also I would be really happy to see some suggestions from you, to improve mines. I learnt there are many ways to achieve a goal in Node Red and there can be faster/easier ways to do it.

Sensor: moving

the new HA android companion is now reporting the speed. Based on this information, I created a sensor showing if I am moving or not_moving. I don’t know what exactly I am going to do it right now but I will come up with something…

[{"id":"b77629a0.dfb2c8","type":"trigger-state","z":"9dcc9ab2.d57aa8","name":"serkan's speed","server":"e447d17a.16a64","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"sensor.serkan_speed","entityidfiltertype":"exact","debugenabled":false,"constraints":[],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"num","x":110,"y":420,"wires":[["4b426ca.f6ecc94"],[]]},{"id":"e447d17a.16a64","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false}]

GIF from Snapshots

I am using wall panel’s camera as generic mjpeg camera but that integration doesn’t support recording (or I don’t know how to do it). So I find a way to save snapshots as a gif file with the help of animate-gif node.

when the alarm is armed, movement at the front_door movement sensor triggers the taking snapshots service, loads jpg files as buffer, converts them to gif and saves to www folder.

[{"id":"44f332b8.4a7c6c","type":"trigger-state","z":"5b8207c0.dcb8c8","name":"front door motion","server":"e447d17a.16a64","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"binary_sensor.front_door_sensor_motion","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"id":"62r1m87tqi6","targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"}],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":110,"y":720,"wires":[["336ccd1f.8e7ca2"],[]]},{"id":"336ccd1f.8e7ca2","type":"api-current-state","z":"5b8207c0.dcb8c8","name":"armed away?","server":"e447d17a.16a64","version":1,"outputs":2,"halt_if":"armed_away","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.ha_alarm","state_type":"str","state_location":"data.state","override_payload":"msg","entity_location":"data.entity","override_data":"msg","blockInputOverrides":false,"x":320,"y":720,"wires":[["5be687d4.8256a8","5c29f73e.5bd238"],[]]},{"id":"fdc31b63.99c958","type":"api-call-service","z":"5b8207c0.dcb8c8","name":"snapshots","server":"e447d17a.16a64","version":1,"debugenabled":false,"service_domain":"camera","service":"snapshot","entityId":"camera.wp_entrance_camera","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":850,"y":720,"wires":[["153ed262.4adb9e"]]},{"id":"1f62e7c3.0e5f68","type":"change","z":"5b8207c0.dcb8c8","name":"file names","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.data.filename","pt":"msg","to":"'/config/www/snapshots/temp/snapshot_' & $now() & '.jpg'","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":720,"wires":[["fdc31b63.99c958"]]},{"id":"5be687d4.8256a8","type":"looptimer","z":"5b8207c0.dcb8c8","duration":"1","units":"Second","maxloops":"30","maxtimeout":"3","maxtimeoutunits":"Minute","name":"","x":500,"y":720,"wires":[["1f62e7c3.0e5f68"],["42c0131a.99601c"]]},{"id":"a61636f4.160728","type":"animate-gif","z":"5b8207c0.dcb8c8","delay":"1000","dimensionX":"640","dimensionY":"480","quality":"50","repeat":false,"x":750,"y":840,"wires":[["1d668d26.aa9313","b1b257e0.4185e8"]]},{"id":"3b3fb307.99d81c","type":"file in","z":"5b8207c0.dcb8c8","name":"buffer them","filename":"","format":"","chunk":false,"sendError":false,"encoding":"none","x":1150,"y":720,"wires":[["cfe26649.15eef8"]]},{"id":"1505e200.fe18ee","type":"join","z":"5b8207c0.dcb8c8","name":"make array","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":590,"y":840,"wires":[["a61636f4.160728"]]},{"id":"153ed262.4adb9e","type":"change","z":"5b8207c0.dcb8c8","name":"filename","rules":[{"t":"move","p":"payload.data.filename","pt":"msg","to":"filename","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":720,"wires":[["3b3fb307.99d81c"]]},{"id":"adcc3d4f.2865f","type":"file","z":"5b8207c0.dcb8c8","name":"save gif","filename":"","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":1080,"y":840,"wires":[[]]},{"id":"42c0131a.99601c","type":"change","z":"5b8207c0.dcb8c8","name":"loop ended","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"complete","pt":"msg","to":"complete","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":760,"wires":[["cfe26649.15eef8"]]},{"id":"1d668d26.aa9313","type":"change","z":"5b8207c0.dcb8c8","name":"new file","rules":[{"t":"set","p":"filename","pt":"msg","to":"'/config/www/snapshots/recording_' & $now() & '.gif'","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":840,"wires":[["adcc3d4f.2865f"]]},{"id":"5c29f73e.5bd238","type":"api-call-service","z":"5b8207c0.dcb8c8","name":"turn on the light","server":"e447d17a.16a64","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.entrance","data":"{\"brightness\":255}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":500,"y":680,"wires":[[]]},{"id":"b1b257e0.4185e8","type":"file","z":"5b8207c0.dcb8c8","name":"save latest footage","filename":"/config/www/last_footage.gif","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":970,"y":880,"wires":[[]]},{"id":"cfe26649.15eef8","type":"link out","z":"5b8207c0.dcb8c8","name":"footage","links":["71012e8c.75d0b"],"x":1275,"y":760,"wires":[]},{"id":"71012e8c.75d0b","type":"link in","z":"5b8207c0.dcb8c8","name":"footage","links":["cfe26649.15eef8"],"x":475,"y":840,"wires":[["1505e200.fe18ee"]]},{"id":"e447d17a.16a64","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false}]

Additional Glances Info

Glances integration updated recently and now reports many more information but still somethings are missing. So I created my sensors using rest api nodes and calling Glances’ Api. This one shows me the uptime and disk size of RAID setup.

[{"id":"2039c6fe.11579a","type":"inject","z":"9a5e9cb4.3f28a","name":"","topic":"","payload":"","payloadType":"date","repeat":"600","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":160,"wires":[["cb7a5a68.bbe2c8","eaf05cc.cb2a8a","6663bb13.c9b734","f4813862.11b768"]]},{"id":"cb7a5a68.bbe2c8","type":"http request","z":"9a5e9cb4.3f28a","name":"uptime server","method":"GET","ret":"obj","paytoqs":false,"url":"192.168.178.31:61208/api/3/uptime","tls":"","persist":false,"proxy":"","authType":"","x":340,"y":100,"wires":[["e66a6b9.c2a7f98"]]},{"id":"eaf05cc.cb2a8a","type":"http request","z":"9a5e9cb4.3f28a","name":"uptime raspi","method":"GET","ret":"obj","paytoqs":false,"url":"192.168.178.250:61208/api/3/uptime","tls":"","persist":false,"proxy":"","authType":"","x":330,"y":140,"wires":[["604169ae.d958c8"]]},{"id":"5ca10d33.8bbfe4","type":"join","z":"9a5e9cb4.3f28a","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"host","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":710,"y":120,"wires":[["212a55e5.64890a","def8bf3f.484ed"]]},{"id":"e66a6b9.c2a7f98","type":"change","z":"9a5e9cb4.3f28a","name":"host","rules":[{"t":"set","p":"host","pt":"msg","to":"server","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":100,"wires":[["5ca10d33.8bbfe4"]]},{"id":"604169ae.d958c8","type":"change","z":"9a5e9cb4.3f28a","name":"host","rules":[{"t":"set","p":"host","pt":"msg","to":"raspi","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":140,"wires":[["5ca10d33.8bbfe4"]]},{"id":"212a55e5.64890a","type":"mqtt out","z":"9a5e9cb4.3f28a","name":"","topic":"sensor/uptime","qos":"","retain":"true","broker":"ea336ecd.70b63","x":920,"y":120,"wires":[]},{"id":"def8bf3f.484ed","type":"debug","z":"9a5e9cb4.3f28a","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":890,"y":80,"wires":[]},{"id":"1b7af9ca.355e96","type":"debug","z":"9a5e9cb4.3f28a","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1070,"y":180,"wires":[]},{"id":"f4813862.11b768","type":"http request","z":"9a5e9cb4.3f28a","name":"nas fs","method":"GET","ret":"obj","paytoqs":false,"url":"192.168.178.250:61208/api/3/fs","tls":"","persist":false,"proxy":"","authType":"","x":310,"y":180,"wires":[["83dc6a22.f96408"]]},{"id":"6663bb13.c9b734","type":"http request","z":"9a5e9cb4.3f28a","name":"nas raid","method":"GET","ret":"obj","paytoqs":false,"url":"192.168.178.250:61208/api/3/raid","tls":"","persist":false,"proxy":"","authType":"","x":320,"y":220,"wires":[["61bf294.10823d8"]]},{"id":"83dc6a22.f96408","type":"split","z":"9a5e9cb4.3f28a","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":470,"y":180,"wires":[["cc4cf054.1a5a4"]]},{"id":"cc4cf054.1a5a4","type":"switch","z":"9a5e9cb4.3f28a","name":"","property":"payload.mnt_point","propertyType":"msg","rules":[{"t":"eq","v":"/mnt/raid1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":590,"y":180,"wires":[["2e8dc448.f60a6c"]]},{"id":"61bf294.10823d8","type":"join","z":"9a5e9cb4.3f28a","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":930,"y":220,"wires":[["1b7af9ca.355e96","c847f8e.99ac408"]]},{"id":"c847f8e.99ac408","type":"mqtt out","z":"9a5e9cb4.3f28a","name":"","topic":"sensor/raid","qos":"","retain":"true","broker":"ea336ecd.70b63","x":1090,"y":220,"wires":[]},{"id":"2e8dc448.f60a6c","type":"change","z":"9a5e9cb4.3f28a","name":"convert to GB","rules":[{"t":"set","p":"payload.free","pt":"msg","to":"$round(payload.free / 1073741824, 2)","tot":"jsonata"},{"t":"set","p":"payload.size","pt":"msg","to":"$round(payload.size / 1073741824, 2)","tot":"jsonata"},{"t":"set","p":"payload.used","pt":"msg","to":"$round(payload.used / 1073741824, 2)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":180,"wires":[["61bf294.10823d8"]]},{"id":"ea336ecd.70b63","type":"mqtt-broker","z":"","name":"home mqtt","broker":"192.168.178.31","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

Another Rest Api node for alphavantage

The integration is little bit limited, so I am directly calling alphavantage’s Rest Api

[{"id":"cfe7806f.79a6d","type":"inject","z":"d91fca12.82c308","name":"","topic":"","payload":"{\"auth_code\":\"def502008faa6a2eb2e4c9e26a38884e1d81d5c87a7086eb33b3b225a055391d7a4a3e277065e8bd4e98c12ea1b63d3aa1013b19e208ddb2512ce7cca5109748338ef5a1925ada48df0b67bb0e40f0c1a31440e74197189ee93ea854f7b89b9d34d2554f031e6a61b745dadb29060bf44557bbf012dbbe1d8fdd9457d2197630dd7854fc6dced9a66819128364dc2d86a52bb2957f12591b9caf876639ff00250400bc6e1a509631a1f9529daeca1fdf627ac51725f49bd240acf07121f5d53017b87e0ae95cd065270025b0e0660cc30366b7c46e56adaff1be0c10ce1b5d833d34e9fa59c02635794e82c02f5b8f8184b7fd6597279eb788756ac5c7c130e4a66ee41904af06d3faade65965869d32a5c19fe2f3ccd68880b50fd10788f0f86bda6e6751b133b489dcccd6f5ef10adca36653a3bf6249e476c5fad92386bdb8d63cb02acf59a033c803b570339365996c4bf050586fbf4731f85225d623315a908a243d1d3f66fe7b93783503c24339fbeff937a4cd5\"}","payloadType":"json","repeat":"","crontab":"*/5 8-16 * * 1,2,3,4,5","once":false,"onceDelay":0.1,"x":90,"y":100,"wires":[["72619bf6.2fd784","a4c75059.4032f","c06611a7.08444"]]},{"id":"ab5b0181.34233","type":"change","z":"d91fca12.82c308","name":"remove space","rules":[{"t":"change","p":"payload","pt":"msg","from":". ","fromt":"str","to":"_","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":" ","fromt":"str","to":"_","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":60,"wires":[["d7c0f27a.05b3d"]]},{"id":"de012266.8dab8","type":"json","z":"d91fca12.82c308","name":"to String","property":"payload","action":"str","pretty":false,"x":400,"y":60,"wires":[["ab5b0181.34233"]]},{"id":"d7c0f27a.05b3d","type":"json","z":"d91fca12.82c308","name":"to Object","property":"payload","action":"obj","pretty":false,"x":720,"y":60,"wires":[["62ba3e76.c805e"]]},{"id":"62ba3e76.c805e","type":"change","z":"d91fca12.82c308","name":"move to payload","rules":[{"t":"move","p":"payload.Global_Quote","pt":"msg","to":"KNIN","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"move","p":"KNIN.05_price","pt":"msg","to":"payload.KNIN","tot":"msg"},{"t":"move","p":"KNIN","pt":"msg","to":"payload.KNIN_attr","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":60,"wires":[["2bc5074b.cc2668"]]},{"id":"a4c75059.4032f","type":"http request","z":"d91fca12.82c308","name":"get USD rate","method":"GET","ret":"obj","paytoqs":false,"url":"https://www.alphavantage.co/query?function=CURRENCY_EXCHANGE_RATE&from_currency=USD&to_currency=TRY&apikey=G9NVVLV4YX36C799","tls":"","persist":false,"proxy":"","authType":"","x":250,"y":100,"wires":[["263929ad.a2bf36"]]},{"id":"46d79d11.d23f74","type":"change","z":"d91fca12.82c308","name":"remove space","rules":[{"t":"change","p":"payload","pt":"msg","from":". ","fromt":"str","to":"_","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":" ","fromt":"str","to":"_","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":100,"wires":[["a8ac1270.96d9f"]]},{"id":"263929ad.a2bf36","type":"json","z":"d91fca12.82c308","name":"to String","property":"payload","action":"str","pretty":false,"x":400,"y":100,"wires":[["46d79d11.d23f74"]]},{"id":"a8ac1270.96d9f","type":"json","z":"d91fca12.82c308","name":"to Object","property":"payload","action":"obj","pretty":false,"x":720,"y":100,"wires":[["e2c72ed8.c1dd9"]]},{"id":"e2c72ed8.c1dd9","type":"change","z":"d91fca12.82c308","name":"move to payload","rules":[{"t":"move","p":"payload.Realtime_Currency_Exchange_Rate","pt":"msg","to":"USDTRY","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"move","p":"USDTRY.5_Exchange_Rate","pt":"msg","to":"payload.USDTRY","tot":"msg"},{"t":"move","p":"USDTRY","pt":"msg","to":"payload.USDTRY_attr","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":100,"wires":[["2bc5074b.cc2668"]]},{"id":"2bc5074b.cc2668","type":"join","z":"d91fca12.82c308","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"10","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1050,"y":100,"wires":[["22ccc08e.8f7da"]]},{"id":"c06611a7.08444","type":"http request","z":"d91fca12.82c308","name":"get EUR Rate","method":"GET","ret":"obj","paytoqs":false,"url":"https://www.alphavantage.co/query?function=CURRENCY_EXCHANGE_RATE&from_currency=EUR&to_currency=TRY&apikey=G9NVVLV4YX36C799","tls":"","persist":false,"proxy":"","authType":"","x":240,"y":140,"wires":[["abf0f580.432df8"]]},{"id":"71fba27.50ced5c","type":"change","z":"d91fca12.82c308","name":"remove space","rules":[{"t":"change","p":"payload","pt":"msg","from":". ","fromt":"str","to":"_","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":" ","fromt":"str","to":"_","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":140,"wires":[["6ad553a5.0f8bec"]]},{"id":"abf0f580.432df8","type":"json","z":"d91fca12.82c308","name":"to String","property":"payload","action":"str","pretty":false,"x":400,"y":140,"wires":[["71fba27.50ced5c"]]},{"id":"6ad553a5.0f8bec","type":"json","z":"d91fca12.82c308","name":"to Object","property":"payload","action":"obj","pretty":false,"x":720,"y":140,"wires":[["472e070c.d054a8"]]},{"id":"472e070c.d054a8","type":"change","z":"d91fca12.82c308","name":"move to payload","rules":[{"t":"move","p":"payload.Realtime_Currency_Exchange_Rate","pt":"msg","to":"EURTRY","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"move","p":"EURTRY.5_Exchange_Rate","pt":"msg","to":"payload.EURTRY","tot":"msg"},{"t":"move","p":"EURTRY","pt":"msg","to":"payload.EURTRY_attr","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":140,"wires":[["2bc5074b.cc2668"]]},{"id":"72619bf6.2fd784","type":"http request","z":"d91fca12.82c308","name":"get KNIN price","method":"GET","ret":"obj","paytoqs":false,"url":"https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=MSF&apikey=G9NVVLV4YX36C799","tls":"","persist":false,"proxy":"","authType":"","x":240,"y":60,"wires":[["de012266.8dab8"]]},{"id":"22ccc08e.8f7da","type":"mqtt out","z":"d91fca12.82c308","name":"","topic":"sensor/alphavantage","qos":"","retain":"true","broker":"ea336ecd.70b63","x":1220,"y":100,"wires":[]},{"id":"ea336ecd.70b63","type":"mqtt-broker","z":"","name":"home mqtt","broker":"192.168.178.31","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

That’s all for the moment.
Cheers.

5 Likes

Dimmer Manager, Motion and switch activation/deactivation. Light minimum level.

I have a flow to keep my phone battery at optimum charge level:
I’ve added in a boolean for presence detection and if I want to boost the battery before going out.

[{"id":"60d8e89c.24e878","type":"poll-state","z":"db492170.f9ebe","name":"Check Pete's phone","server":"c8eb62f2.32f1f","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"9","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":true,"entity_id":"device_tracker.pete_ot_pkpixel","state_type":"str","halt_if":"home","halt_if_type":"str","halt_if_compare":"is","outputs":2,"x":141,"y":102,"wires":[["af72d675.e7a008","1c708789.992848","35f73998.246bf6"],[]]},{"id":"35f73998.246bf6","type":"api-current-state","z":"db492170.f9ebe","name":"Pete Home","server":"c8eb62f2.32f1f","version":1,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"device_tracker.pete_ot_pkpixel","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":342,"y":102,"wires":[["72fa2561.6fa3cc"],["b61cbe6b.9d03c"]]},{"id":"72fa2561.6fa3cc","type":"api-current-state","z":"db492170.f9ebe","name":"Override on","server":"c8eb62f2.32f1f","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.pete_phone_charge_override","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":512,"y":102,"wires":[["6e3699b6.8eae28"],["2b29c2fd.e9f81e"]]},{"id":"6e3699b6.8eae28","type":"switch","z":"db492170.f9ebe","name":"<60 >=65","property":"data.attributes.battery_level","propertyType":"msg","rules":[{"t":"lt","v":"60","vt":"str"},{"t":"gte","v":"65","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":672,"y":85,"wires":[["380bbfa.696de4"],["b61cbe6b.9d03c"]]},{"id":"2b29c2fd.e9f81e","type":"switch","z":"db492170.f9ebe","name":"<95","property":"data.attributes.battery_level","propertyType":"msg","rules":[{"t":"lt","v":"95","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":662,"y":136,"wires":[["380bbfa.696de4"]]},{"id":"380bbfa.696de4","type":"light-scheduler-filter","z":"db492170.f9ebe","settings":"79687fc3.61924","events":"[{\"start\":{\"dow\":1,\"mod\":360},\"end\":{\"dow\":1,\"mod\":1320}},{\"start\":{\"dow\":2,\"mod\":360},\"end\":{\"dow\":2,\"mod\":1320}},{\"start\":{\"dow\":3,\"mod\":360},\"end\":{\"dow\":3,\"mod\":1320}},{\"start\":{\"dow\":4,\"mod\":360},\"end\":{\"dow\":4,\"mod\":1320}},{\"start\":{\"dow\":5,\"mod\":360},\"end\":{\"dow\":5,\"mod\":1380}},{\"start\":{\"dow\":6,\"mod\":480},\"end\":{\"dow\":6,\"mod\":1380}},{\"start\":{\"dow\":0,\"mod\":480},\"end\":{\"dow\":0,\"mod\":1320}}]","name":"Daytime","onlyWhenDark":false,"scheduleRndMax":0,"sunElevationThreshold":6,"sunShowElevationInStatus":false,"x":859,"y":85,"wires":[["7e8a703f.e8bcc"],["34226f4a.4c3d1"]]},{"id":"7e8a703f.e8bcc","type":"api-call-service","z":"db492170.f9ebe","name":"Kit Chg On","server":"c8eb62f2.32f1f","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.phone_charger1","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1022,"y":85,"wires":[[]]},{"id":"34226f4a.4c3d1","type":"api-call-service","z":"db492170.f9ebe","name":"Bdr Chg On","server":"c8eb62f2.32f1f","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.phone_charger2","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1022,"y":136,"wires":[[]]},{"id":"b61cbe6b.9d03c","type":"api-call-service","z":"db492170.f9ebe","name":"Charger Off","server":"c8eb62f2.32f1f","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.phone_charger1, switch.phone_charger2","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1022,"y":187,"wires":[[]]},{"id":"c8eb62f2.32f1f","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true},{"id":"79687fc3.61924","type":"light-scheduler-settings","z":"","name":"my settings","latitude":"53.155991","longitude":"-1.196117"}]

This one handles an IKEA motion sensor for the bathroom.
Brightness and colour temp vary at different times of the day.

[{"id":"8608e428.daa378","type":"poll-state","z":"dc108009.92242","name":"BathRm Mo","server":"c8eb62f2.32f1f","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"1","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":true,"entity_id":"binary_sensor.ikea_mosens01","state_type":"str","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":104,"y":1394,"wires":[["3ad533f5.6e797c"]]},{"id":"e19ee46d.ea3788","type":"api-call-service","z":"dc108009.92242","name":"Light on","server":"c8eb62f2.32f1f","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bathroom_toilet","data":"{\"brightness_pct\":15,\"color_temp\":454}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":706,"y":1394,"wires":[[]]},{"id":"af854daa.f84a4","type":"api-call-service","z":"dc108009.92242","name":"Light off","server":"c8eb62f2.32f1f","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.bathroom_toilet","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":706,"y":1496,"wires":[[]]},{"id":"7f7769b6.57bd38","type":"api-current-state","z":"dc108009.92242","name":"Nighttime","server":"c8eb62f2.32f1f","version":1,"outputs":2,"halt_if":"below_horizon","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sun.sun","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":502,"y":1394,"wires":[["e19ee46d.ea3788"],["5a71e456.4536fc"]]},{"id":"5a71e456.4536fc","type":"api-call-service","z":"dc108009.92242","name":"Light on","server":"c8eb62f2.32f1f","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bathroom_toilet","data":"{\"brightness_pct\":60,\"color_temp\":250}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":706,"y":1445,"wires":[[]]},{"id":"88d34b6f.972bb8","type":"delay","z":"dc108009.92242","name":"","pauseType":"delay","timeout":"30","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":502,"y":1445,"wires":[["af854daa.f84a4"]]},{"id":"3ad533f5.6e797c","type":"rbe","z":"dc108009.92242","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"data.state","x":237,"y":1394,"wires":[["c113c05a.c284"]]},{"id":"c113c05a.c284","type":"switch","z":"dc108009.92242","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":356,"y":1394,"wires":[["7f7769b6.57bd38"],["88d34b6f.972bb8"]]},{"id":"c8eb62f2.32f1f","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

I work from home, so I really dislike when my robot vacuum runs while I’m working, as it can be pretty disruptive. Instead of having it on a normal schedule, I trigger it either

  • when no one is home (using an “link in” from when the alarm is set to armed_away)
  • when the Roku TV in my “gym” starts playing something during the day.
  • I also set a time buffer of 17 hours between runs so that it doesn’t run more than once per day.

I created a sub-flow for announcements on my Google Home. I found that certain things need specific volumes to be effective and I want to reset the volume when it’s done speaking. This was getting tricky for my different use cases:

  • “Someone is at the front door” (alternative to a doorbell, which I disconnected)
  • “Welcome home!” (and tells me how many videos were recorded on my motion-detecting cameras)
  • "Good morning " (after I’ve gotten out of bed in the morning and motion is detected in the kitchen, it will greet me)

This flow takes in message and an optional volume and delay. It will turn the speaker on (to avoid the turn on noise during speaking), wait 2 seconds, then poll the current volume to reset later. Sets the volume as desired by the volume, speaks the content, delays by the set delay or 1-second per word in the message, then resets the volume to the previous setting.

1 Like