Skip to content

Instantly share code, notes, and snippets.

@unixweb
Last active December 3, 2017 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unixweb/0138e106a14ae7b8ebe63bd34c8bd96d to your computer and use it in GitHub Desktop.
Save unixweb/0138e106a14ae7b8ebe63bd34c8bd96d to your computer and use it in GitHub Desktop.
Moon Calender for Node-Red to implement in any smarthome solution
[{"id":"c22423c2.1e727","type":"inject","z":"43367500.55eb6c","name":"make request","topic":"","payload":"","payloadType":"date","repeat":"3600","crontab":"","once":false,"x":146,"y":168.00000190734863,"wires":[["995dc366.8a14e"]]},{"id":"995dc366.8a14e","type":"http request","z":"43367500.55eb6c","name":"","method":"GET","ret":"txt","url":"https://www.timeanddate.de/mond/phasen/deutschland/muenchen","tls":"","x":356.51953887939453,"y":167.0000057220459,"wires":[["c82b2ba.c1f4bd8"]]},{"id":"c82b2ba.c1f4bd8","type":"html","z":"43367500.55eb6c","name":"","tag":"div.three p","ret":"html","as":"single","x":559.5195541381836,"y":166.99999809265137,"wires":[["4f5c03b6.a6543c"]]},{"id":"4f5c03b6.a6543c","type":"function","z":"43367500.55eb6c","name":"Parse msg","func":"// outputs: 2\nmsg.payload = msg.payload[0]; \nreturn msg;","outputs":1,"noerr":0,"x":757.5195846557617,"y":165.00000476837158,"wires":[["da31befc.20712"]]},{"id":"da31befc.20712","type":"switch","z":"43367500.55eb6c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"Vollmond","vt":"str","case":false},{"t":"regex","v":"Halbmond","vt":"str","case":false},{"t":"regex","v":"Zunehmend","vt":"str","case":false},{"t":"regex","v":"Abnehmender Mond","vt":"str","case":false}],"checkall":"true","outputs":4,"x":526.5195388793945,"y":264.00000381469727,"wires":[["13569d49.0e4c33"],["a2b1c478.903498"],["1453eef0.b59e11"],["a3506d27.67226"]]},{"id":"13569d49.0e4c33","type":"function","z":"43367500.55eb6c","name":"Vollmond","func":"msg.payload = \"moon-full\";\nreturn msg;\n","outputs":1,"noerr":0,"x":793.7695426940918,"y":222.00000286102295,"wires":[["182d9fc2.56b8f","ca62de2a.fbeb1"]]},{"id":"a2b1c478.903498","type":"function","z":"43367500.55eb6c","name":"Halbmond","func":"msg.payload = \"Halbmond\";\nreturn msg;\n","outputs":1,"noerr":0,"x":803.7695426940918,"y":260.25001525878906,"wires":[["182d9fc2.56b8f"]]},{"id":"1453eef0.b59e11","type":"function","z":"43367500.55eb6c","name":"Zunehmender Mond","func":"msg.payload = \"Zunehmend\";\nreturn msg;\n","outputs":1,"noerr":0,"x":834.5195465087891,"y":300.50000381469727,"wires":[["182d9fc2.56b8f"]]},{"id":"a3506d27.67226","type":"function","z":"43367500.55eb6c","name":"Abnehmender Mond","func":"msg.payload = \"Abnehmend\";\nreturn msg;\n","outputs":1,"noerr":0,"x":834.0195465087891,"y":339.7500057220459,"wires":[["182d9fc2.56b8f"]]},{"id":"182d9fc2.56b8f","type":"debug","z":"43367500.55eb6c","name":"","active":true,"console":"false","complete":"false","x":1067.519546508789,"y":265.00000286102295,"wires":[]},{"id":"ca62de2a.fbeb1","type":"ui_template","z":"43367500.55eb6c","group":"8b394670.04a058","name":"Moon Icon","order":15,"width":"2","height":"3","format":"<center>Mondphase</center>\n<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-4x wi wi-{{msg.payload}}\"></i>\n</div>","storeOutMessages":false,"fwdInMessages":true,"templateScope":"local","x":1066.0000762939453,"y":225.00000667572021,"wires":[[]]},{"id":"fe2831f.4c7885","type":"ui_template","z":"43367500.55eb6c","group":"8b394670.04a058","name":"Load CSS","order":18,"width":"0","height":"0","format":"<link rel=\"stylesheet\" href=\"/weather-icons/mycss/weather-icons.min.css\">\n<style>\n .nr-dashboard-theme-dark ui-card-panel {\n \tbackground-color: #222;\n \toutline: 1px solid #cccccc;\n \t }\n</style>\n","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":129,"y":90.00000095367432,"wires":[[]]},{"id":"8b394670.04a058","type":"ui_group","z":"","name":"Licht","tab":"b763f993.c217c8","order":1,"disp":true,"width":"6"},{"id":"b763f993.c217c8","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1}]
@unixweb
Copy link
Author

unixweb commented Dec 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment