-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbedtime_charge_phone
1 lines (1 loc) · 9.15 KB
/
bedtime_charge_phone
1
[{"id":"d18f6c2c.9e113","type":"tab","label":"Kids Phones","disabled":false,"info":""},{"id":"f1f294bd.be8bb8","type":"inject","z":"d18f6c2c.9e113","name":"bedtime","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"30 21 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":80,"y":207,"wires":[["7837c1c6.2fcc4"]]},{"id":"fde2d0e5.6d452","type":"api-current-state","z":"d18f6c2c.9e113","name":"kirsten Phone","server":"c70028c6.b5cd08","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"device_tracker.life360_kirsten","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":626,"y":248,"wires":[["afce6f48.0c8be"]]},{"id":"afce6f48.0c8be","type":"switch","z":"d18f6c2c.9e113","name":"charging state","property":"data.attributes.battery_charging","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":866,"y":248,"wires":[[],["f0e9ee9e.43488"]]},{"id":"b6c19f31.65db6","type":"api-current-state","z":"d18f6c2c.9e113","name":"rods Phone","server":"c70028c6.b5cd08","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"device_tracker.life360_rod_poplarchick","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":596,"y":308,"wires":[["afce6f48.0c8be"]]},{"id":"51ee694.eca0098","type":"api-current-state","z":"d18f6c2c.9e113","name":"coles's Phone","server":"c70028c6.b5cd08","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"device_tracker.life360_cole","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":626,"y":188,"wires":[["afce6f48.0c8be"]]},{"id":"f0e9ee9e.43488","type":"api-call-service","z":"d18f6c2c.9e113","name":"Google say","server":"c70028c6.b5cd08","version":1,"debugenabled":true,"service_domain":"tts","service":"google_translate_say","entityId":"media_player.living_room_speaker, media_player.master_bedroom_speaker","data":"{\"message\":\"{{data.attributes.friendly_name}}'s phone isn't charging its at {{data.attributes.battery}} percent\",\"language\":\"en\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1096,"y":248,"wires":[["2d50cbf4.722f34"]]},{"id":"b0866fa6.ab411","type":"api-call-service","z":"d18f6c2c.9e113","name":"Google say to rod","server":"c70028c6.b5cd08","version":1,"debugenabled":true,"service_domain":"tts","service":"google_translate_say","entityId":"media_player.master_bedroom_speaker","data":"{\"message\":\"hello Master Rod your phone battery is at{{data.attributes.battery}} Percent please charge \",\"language\":\"en\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":930,"y":470,"wires":[[]]},{"id":"ac11166c.71edb8","type":"switch","z":"d18f6c2c.9e113","name":"battery <25%","property":"data.attributes.battery","propertyType":"msg","rules":[{"t":"lt","v":"25","vt":"num"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":736,"y":475,"wires":[["b0866fa6.ab411"],[]]},{"id":"a773a378.22361","type":"api-current-state","z":"d18f6c2c.9e113","name":"rods Phone","server":"c70028c6.b5cd08","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"device_tracker.life360_rod_poplarchick","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":570,"y":475,"wires":[["ac11166c.71edb8"]]},{"id":"cf834f89.f47ac","type":"inject","z":"d18f6c2c.9e113","name":"30 min check","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1800","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":480,"wires":[["9ea2db1d.ea0588"]]},{"id":"b220f4fa.a06888","type":"delay","z":"d18f6c2c.9e113","name":"","pauseType":"delay","timeout":"15","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":460,"y":248,"wires":[["fde2d0e5.6d452"]]},{"id":"d353b505.5bee18","type":"delay","z":"d18f6c2c.9e113","name":"","pauseType":"delay","timeout":"60","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":436,"y":308,"wires":[["b6c19f31.65db6"]]},{"id":"7837c1c6.2fcc4","type":"api-current-state","z":"d18f6c2c.9e113","name":"anyone home?","server":"c70028c6.b5cd08","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.occupied","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":260,"y":208,"wires":[["51ee694.eca0098","b220f4fa.a06888","d353b505.5bee18"],[]]},{"id":"9ea2db1d.ea0588","type":"api-current-state","z":"d18f6c2c.9e113","name":"anyone home?","server":"c70028c6.b5cd08","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.rod_home","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":400,"y":480,"wires":[["a773a378.22361"],[]]},{"id":"f0b7e3a.fe1b12","type":"comment","z":"d18f6c2c.9e113","name":"days and time to activate","info":"","x":110,"y":160,"wires":[]},{"id":"2ff14670.f7345a","type":"comment","z":"d18f6c2c.9e113","name":"only when house is accupied","info":"","x":340,"y":160,"wires":[]},{"id":"7a1a0c9e.fbd8a4","type":"comment","z":"d18f6c2c.9e113","name":"is phone charging?","info":"if device is not chaging then flow continued ","x":830,"y":200,"wires":[]},{"id":"65ef4e62.affc2","type":"comment","z":"d18f6c2c.9e113","name":"flow to remind to plug in phone and its bedtime. ","info":"","x":200,"y":40,"wires":[]},{"id":"5a2d06e2.cc2108","type":"comment","z":"d18f6c2c.9e113","name":"google with anounce what device is not charging ","info":"it will extract the atribute from life360 IF not plugged in. ","x":1120,"y":200,"wires":[]},{"id":"3117f828.1f9e38","type":"comment","z":"d18f6c2c.9e113","name":"delay so each device is anounced if neeed or later beditme","info":"google will not do more that one at same time in my test. ","x":230,"y":360,"wires":[]},{"id":"7f9e791e.aeb3e8","type":"comment","z":"d18f6c2c.9e113","name":"open comments for more details ","info":"","x":170,"y":80,"wires":[]},{"id":"2d50cbf4.722f34","type":"debug","z":"d18f6c2c.9e113","name":"extract atrabutes with debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1060,"y":340,"wires":[]},{"id":"3a2b9cf3.eb8554","type":"comment","z":"d18f6c2c.9e113","name":"click here to see how to find atrabutes to fill in data field.","info":"to find what you need to put in call of service node google say data message to pull current value of intity attrubute you want in your message. {{data.attributes.friendly_name}}\n\ngo to debug window click on errow next to opject\nthen\nerrow next to data \nrepet the drill down untill you get to attributes.\n\nattributes: object\nsource_type: \"gps\"\nlatitude: \nlongitude: \ngps_accuracy: 15\nbattery: 92\naddress: \"my house Hwy 41, Oakhurst, CA\"\nat_loc_since: \"2020-07-10T01:04:07+00:00\"\nbattery_charging: false\ndriving: false\nlast_seen: \"2020-07-10T17:21:58+00:00\"\nmoving: false\nplace: null\nraw_speed: null\nspeed: \"unknown\"\nwifi_on: true\nscanner: \"NmapDeviceScanner\"\nip: \"192.168.86.$$$$\"\nfriendly_name: \"life360_rod_poplarchick\"\n\nThen mouse over the attribute you want to use and select the first box (copy path)\nthen you can paste that between the\nbrackets {{ }} \nlike this\n{{data.attributes.friendly_name}}\nin the data of the call of service node\n\n\n{\n \"message\": \"its almost bed time and {{data.attributes.friendly_name}}'s phone isn't charging\",\n \"language\": \"en\"\n}","x":1040,"y":300,"wires":[]},{"id":"11d97960.5e9bf7","type":"comment","z":"d18f6c2c.9e113","name":"below is to remind me my phone is almost dead.","info":"","x":440,"y":420,"wires":[]},{"id":"f17e78b8.702bd8","type":"comment","z":"d18f6c2c.9e113","name":"checked my phone every 30 minutes.","info":"","x":170,"y":540,"wires":[]},{"id":"9592bb2f.8a7368","type":"comment","z":"d18f6c2c.9e113","name":"only when im home","info":"","x":410,"y":540,"wires":[]},{"id":"25d704cf.9f62ac","type":"comment","z":"d18f6c2c.9e113","name":"checkes my battery level then flow only if below set level","info":"if device below set level then flow continued ","x":840,"y":420,"wires":[]},{"id":"c70028c6.b5cd08","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]