diyfuturism

DIYFUTURISM.COM Blink Lights in Closest Room

Mar 13th, 2018
416
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [{"id":"cc632a7.ec297d8","type":"api-current-state","z":"832f3028.e21a3","name":"House Lights On?","server":"8ac3cd7f.58d3e","halt_if":"","entity_id":"group.all_lights","x":350,"y":1140,"wires":[["b57899a3.2013d8"]]},{"id":"b57899a3.2013d8","type":"switch","z":"832f3028.e21a3","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":510,"y":1140,"wires":[["bbc6bfd8.29843"],["5a0cd187.0e414"]]},{"id":"bbc6bfd8.29843","type":"api-current-state","z":"832f3028.e21a3","name":"Where In House Am I?","server":"8ac3cd7f.58d3e","halt_if":"","entity_id":"variable.last_motion","x":720,"y":1140,"wires":[["1ad6aa4a.3a0d56"]]},{"id":"5a0cd187.0e414","type":"api-current-state","z":"832f3028.e21a3","name":"Watching Movie?","server":"8ac3cd7f.58d3e","halt_if":"","entity_id":"variable.house_state","x":350,"y":1220,"wires":[["d8dd3f4a.daa25"]]},{"id":"d8dd3f4a.daa25","type":"switch","z":"832f3028.e21a3","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Watching Movie","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":510,"y":1220,"wires":[["fea60c9b.8dc55"]]},{"id":"fea60c9b.8dc55","type":"api-call-service","z":"832f3028.e21a3","name":"Pause Movie","server":"8ac3cd7f.58d3e","service_domain":"media_player","service":"media_pause","data":"{\"entity_id\":\"media_player.roku_3__4124cg078650\"}","x":710,"y":1220,"wires":[[]]},{"id":"1ad6aa4a.3a0d56","type":"function","z":"832f3028.e21a3","name":"Assign Lights to Blink","func":"newmsg = {}\nentity_id = \"\";\nif (msg.payload == \"Office Motion\") {\n    entity_id = \"light.office_pendant\"\n} \nelse if (msg.payload == \"Bathroom Motion\") {\n    entity_id = \"switch.bathroom_light\"\n} \nelse if (msg.payload == \"Kitchen Motion\" || msg.payload == \"Dining Motion\") {\n    entity_id = \"switch.edison_pendants\"\n}\nelse if (msg.payload == \"Living Room Motion\") {\n    entity_id = \"light.middle_pendant\"\n}\nelse if (msg.payload == \"Closet Motion\") {\n    entithy_id = \"light.closet\"\n}\nelse {\n    newmsg = \"NONE\"\n    return newmsg;\n}\n    \nnewmsg.payload = { data: {'entity_id': entity_id } }   \nreturn newmsg;","outputs":1,"noerr":0,"x":960,"y":1140,"wires":[["a0ff9425.34b368"]]},{"id":"a0ff9425.34b368","type":"looptimer","z":"832f3028.e21a3","duration":"1","units":"Second","maxloops":"5","maxtimeout":"1","maxtimeoutunits":"Hour","name":"6 toggles = Blink 3x","x":970,"y":1200,"wires":[["dec2d03a.95437"],[]]},{"id":"dec2d03a.95437","type":"api-call-service","z":"832f3028.e21a3","name":"Toggle Light","server":"8ac3cd7f.58d3e","service_domain":"homeassistant","service":"toggle","data":"","mergecontext":"","x":1170,"y":1200,"wires":[[]]},{"id":"8ac3cd7f.58d3e","type":"server","z":"","name":"Home Assistant","url":"https://MYURL","pass":"MYPASS"}]
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×