SHARE
TWEET

Untitled

a guest May 22nd, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [{"id":"920e1ec.d1dc9e","type":"inject","z":"2bacf292.978c3e","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":600,"wires":[["560954db.fe462c"]]},{"id":"67cd78b3.9ac3e8","type":"debug","z":"2bacf292.978c3e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":750,"y":440,"wires":[]},{"id":"560954db.fe462c","type":"api-current-state","z":"2bacf292.978c3e","name":"","server":"a7b21508.4388a8","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.plant_problems","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":430,"y":440,"wires":[["67cd78b3.9ac3e8","2882aba1.11a004"]]},{"id":"2882aba1.11a004","type":"function","z":"2bacf292.978c3e","name":"Check for problems","func":"if (msg.data.attribvutes.plant_problems.water_number===0){\nmsg.payload = {\n    \"domain\": \"notify\",\n    \"service\": \"alexa_media\",\n    \"data\": {\n        \"message\": \"No Plants Need Watering\",\n        \"data\": {\n            \"type\": \"tts\"\n        },\n        \"target\": [\n            \"Office Echo\"\n        ]\n    }\n}\n\n}\n\nelse if(msg.data.attribvutes.water_number | float > 0){\nmsg.payload = {\n    \"domain\": \"notify\",\n    \"service\": \"alexa_media\",\n    \"data\": {\n        \"message\": states.sensor.plant_problems.attributes.water + \"Needs to be watered\",\n        \"data\": {\n            \"type\": \"tts\"\n        },\n        \"target\": [\n            \"Office Echo\"\n        ]\n    }\n}\n\n}\n\nelse if (msg.data.attribvutes.fertilizer_number===0){\nmsg.payload = {\n    \"domain\": \"notify\",\n    \"service\": \"alexa_media\",\n    \"data\": {\n        \"message\": \"No Plants need fertilizer\",\n        \"data\": {\n            \"type\": \"tts\"\n        },\n        \"target\": [\n            \"Office Echo\"\n        ]\n    }\n}\n\n}\n\n\nelse if (msg.data.attribvutes.fertilizer_number | float > 0){\nmsg.payload = {\n    \"domain\": \"notify\",\n    \"service\": \"alexa_media\",\n    \"data\": {\n        \"message\": \"These plants \"+ states.sensor.plant_problems.attributes.fertilizer + \"need fertilizing\",\n        \"data\": {\n            \"type\": \"tts\"\n        },\n        \"target\": [\n            \"Office Echo\"\n        ]\n    }\n}\n\n}\n\n\nreturn msg;","outputs":3,"noerr":0,"x":910,"y":520,"wires":[["54ebf259.d32c9c","2140529f.bc9c7e"],["f4558242.e38e4","b7695e0a.aec83"],[]]},{"id":"a7b21508.4388a8","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top