Chicken coop control

Chicken door control, food control. Electric fence control. Mostly uploadet for my own backup.

[{"id":"b2492c70.4db6d","type":"rpi-gpio out","name":"Door UP (16)","pin":"16","set":true,"level":"1","out":"out","x":641,"y":258,"z":"c3aed0d3.3ce58","wires":[]},{"id":"b4f7831a.4b088","type":"rpi-gpio in","name":"Open 37","pin":"37","intype":"up","read":false,"x":321,"y":355,"z":"c3aed0d3.3ce58","wires":[["da7ffdd5.bc264"]]},{"id":"cde0ca3e.321f38","type":"rpi-gpio out","name":"Door DOWN (18)","pin":"18","set":true,"level":"1","out":"out","x":534,"y":505,"z":"c3aed0d3.3ce58","wires":[]},{"id":"6a0184d6.95fe7c","type":"rpi-gpio in","name":"Close 32","pin":"32","intype":"up","read":false,"x":322,"y":409,"z":"c3aed0d3.3ce58","wires":[["18709ab0.b73c55"]]},{"id":"14b59898.eb4a67","type":"rpi-gpio out","name":"Fence (22)","pin":"22","set":true,"level":"1","out":"out","x":880,"y":352,"z":"c3aed0d3.3ce58","wires":[]},{"id":"9ae52842.651ad8","type":"http response","name":"","x":715,"y":55,"z":"c3aed0d3.3ce58","wires":[]},{"id":"61ab2a7b.9e54d4","type":"template","name":"","field":"payload","format":"handlebars","template":"<html>\n<head>\n  <meta charset=\"utf-8\">\n  <title>click button to open door</title>\n</head>\n<body>\n    <div class=\"login\">\n      <h1>click button to open door</h1>\n      <form method=\"post\" action=\"open_door\">\n         <p class=\"submit\"><input type=\"submit\" name=\"commit\" value=\"Open Door\"></p>\n      </form>\n    </div>\n</body>\n</html>","x":573,"y":53,"z":"c3aed0d3.3ce58","wires":[["9ae52842.651ad8"]]},{"id":"e417b329.1be85","type":"http in","name":"","url":"/open_door","method":"get","swaggerDoc":"","x":387.5,"y":55,"z":"c3aed0d3.3ce58","wires":[["61ab2a7b.9e54d4"]]},{"id":"66c0a3c7.993f5c","type":"http in","name":"","url":"/open_door","method":"post","swaggerDoc":"","x":147,"y":165,"z":"c3aed0d3.3ce58","wires":[["3e240472.2ce6bc"]]},{"id":"1dc4fd2a.e23b03","type":"twitter in","twitter":"","tags":"","user":"dm","name":"","topic":"tweets","x":135,"y":216,"z":"c3aed0d3.3ce58","wires":[["3e240472.2ce6bc"]]},{"id":"86638a14.799c78","type":"rpi-gpio out","name":"Feeder (15)","pin":"15","set":true,"level":"1","out":"out","x":616,"y":595,"z":"c3aed0d3.3ce58","wires":[]},{"id":"b63064be.49cf98","type":"inject","name":"9:00","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"00 7 * * *","once":false,"x":120,"y":662,"z":"c3aed0d3.3ce58","wires":[["6f31d920.7df298"]]},{"id":"e8e4d7fc.171b28","type":"inject","name":"10.00","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"00 8 * * *","once":false,"x":118,"y":705,"z":"c3aed0d3.3ce58","wires":[["6f31d920.7df298"]]},{"id":"7600f27a.873e7c","type":"switch","name":"","property":"payload","rules":[{"t":"eq","v":"0"}],"checkall":"true","outputs":1,"x":684,"y":108,"z":"c3aed0d3.3ce58","wires":[["b9f334c6.2f6298"]]},{"id":"b9f334c6.2f6298","type":"function","name":"message","func":"msg.payload = \"Food at \"+(new Date()).toString();\nreturn msg;","outputs":"1","noerr":0,"x":843,"y":109,"z":"c3aed0d3.3ce58","wires":[[]]},{"id":"a8479ce8.e3615","type":"rpi-gpio in","name":"","pin":"36","intype":"up","read":false,"x":525,"y":113,"z":"c3aed0d3.3ce58","wires":[["7600f27a.873e7c"]]},{"id":"3e240472.2ce6bc","type":"trigger","op1":"0","op2":"1","op1type":"val","op2type":"val","duration":"1","extend":false,"units":"s","name":"On_Off","x":431,"y":255,"z":"c3aed0d3.3ce58","wires":[["b2492c70.4db6d"]]},{"id":"43f3d704.dad0e8","type":"function","name":"Open","func":"var messages = [\n        \"El doros openesos atis \",\n        \"Gokke door opened at \",\n        \"Someone opened this door at \"\n];\nmsg.payload = messages[Math.floor(Math.random()*messages.length)]+(new Date()).toString();\nreturn msg;","outputs":1,"noerr":0,"x":737,"y":499,"z":"c3aed0d3.3ce58","wires":[["129713ea.69090c"]]},{"id":"967b92e2.52823","type":"rpi-mouse","name":"","butt":"1","x":137,"y":290,"z":"c3aed0d3.3ce58","wires":[["3e240472.2ce6bc"]]},{"id":"9e4613c.41c3bf","type":"trigger","op1":"0","op2":"1","op1type":"val","op2type":"val","duration":"50","extend":false,"units":"ms","name":"On_Off","x":340,"y":506,"z":"c3aed0d3.3ce58","wires":[["cde0ca3e.321f38"]]},{"id":"46ad6155.3d498","type":"rpi-mouse","name":"","butt":"2","x":121,"y":453,"z":"c3aed0d3.3ce58","wires":[["9e4613c.41c3bf"]]},{"id":"573ee7b.f39c418","type":"function","name":"Close","func":"var messages = [\n        \"The door closed nicely at \",\n        \"Closemos noche pero \",\n        \"Good night chickens \"\n];\nmsg.payload = messages[Math.floor(Math.random()*messages.length)]+(new Date()).toString();\nreturn msg;","outputs":1,"noerr":0,"x":739,"y":451,"z":"c3aed0d3.3ce58","wires":[["129713ea.69090c"]]},{"id":"18709ab0.b73c55","type":"switch","name":"","property":"payload","rules":[{"t":"eq","v":"0"}],"checkall":"true","outputs":1,"x":474,"y":368,"z":"c3aed0d3.3ce58","wires":[["573ee7b.f39c418","7193178a.1299c8"]]},{"id":"6f31d920.7df298","type":"trigger","op1":"0","op2":"1","op1type":"val","op2type":"val","duration":"10","extend":false,"units":"s","name":"Feed time","x":403,"y":595,"z":"c3aed0d3.3ce58","wires":[["86638a14.799c78"]]},{"id":"d9d3c08d.96323","type":"rpi-mouse","name":"","butt":"4","x":122,"y":601,"z":"c3aed0d3.3ce58","wires":[["6f31d920.7df298"]]},{"id":"da7ffdd5.bc264","type":"switch","name":"","property":"payload","rules":[{"t":"eq","v":"0"}],"checkall":"true","outputs":1,"x":476,"y":409,"z":"c3aed0d3.3ce58","wires":[["43f3d704.dad0e8","307d7ec5.d97222"]]},{"id":"e4bf0464.421fd8","type":"inject","name":"open","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":136,"y":360,"z":"c3aed0d3.3ce58","wires":[["3e240472.2ce6bc"]]},{"id":"307d7ec5.d97222","type":"trigger","op1":"0","op2":"0","op1type":"val","op2type":"val","duration":"1","extend":false,"units":"s","name":"Fence OFF","x":679,"y":331,"z":"c3aed0d3.3ce58","wires":[["14b59898.eb4a67"]]},{"id":"7193178a.1299c8","type":"trigger","op1":"1","op2":"1","op1type":"val","op2type":"val","duration":"1","extend":false,"units":"s","name":"Fence ON","x":680,"y":377,"z":"c3aed0d3.3ce58","wires":[["14b59898.eb4a67"]]},{"id":"5dc6b7b5.8c0358","type":"inject","name":"12.00","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"00 9 * * *","once":false,"x":119,"y":759,"z":"c3aed0d3.3ce58","wires":[["6f31d920.7df298"]]},{"id":"85ebb1b7.68f7f","type":"inject","name":"close","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":147,"y":526,"z":"c3aed0d3.3ce58","wires":[["9e4613c.41c3bf"]]},{"id":"fbfe83f9.cf7fc","type":"commentdown","name":"Time","info":"Time is offset by minus 2 hours\nso when the clock is 9am the thingbox says its 7am","x":127,"y":65,"z":"c3aed0d3.3ce58","wires":[]},{"id":"129713ea.69090c","type":"debug","name":"","active":true,"console":"false","complete":"false","x":922,"y":468,"z":"c3aed0d3.3ce58","wires":[]},{"id":"9f1266ba.c6d008","type":"inject","name":"9:00","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"00 5 * * *","once":false,"x":345,"y":728,"z":"c3aed0d3.3ce58","wires":[["6f31d920.7df298"]]},{"id":"494c537c.a3bd7c","type":"trigger","op1":"0","op2":"1","op1type":"val","op2type":"val","duration":"1","extend":false,"units":"s","name":"Feed time","x":531,"y":733,"z":"c3aed0d3.3ce58","wires":[["86638a14.799c78"]]},{"id":"8e957c46.be4c9","type":"inject","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":375,"y":798,"z":"c3aed0d3.3ce58","wires":[["494c537c.a3bd7c"]]}]
matisok

Flow Info

created 1 year, 6 months ago

Node Types

Core
  • debug (x1)
  • function (x3)
  • http in (x2)
  • http response (x1)
  • inject (x7)
  • rpi-gpio in (x3)
  • rpi-gpio out (x4)
  • rpi-mouse (x3)
  • switch (x3)
  • template (x1)
  • trigger (x6)
  • twitter in (x1)
Other
  • commentdown (x1)

Tags

  • chicken
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option