-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
=
committed
Mar 19, 2021
1 parent
8f4909f
commit c12543b
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[{"id":"32cb8da3.eeffc2","type":"tab","label":"Sun Events simple example","disabled":true,"info":""},{"id":"f10f1911.0d5928","type":"tab","label":"Sun Events GPS stream example ","disabled":true,"info":""},{"id":"40f39ad3.0340f4","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"2d8758dc.922e08","type":"inject","z":"32cb8da3.eeffc2","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payloadType":"str","x":110,"y":120,"wires":[["58c171f7.59b7a"]]},{"id":"f10b6e96.34bbf","type":"debug","z":"32cb8da3.eeffc2","name":"Your logic goes here","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":800,"y":180,"wires":[]},{"id":"58c171f7.59b7a","type":"change","z":"32cb8da3.eeffc2","name":"set GPS coordinates (change node) ","rules":[{"t":"set","p":"payload.latitude","pt":"msg","to":"51.501364","tot":"num"},{"t":"set","p":"payload.longitude","pt":"msg","to":"-0.1440787","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":180,"wires":[["fa29adf4.f428b"]]},{"id":"c0aa61b0.223ae","type":"inject","z":"32cb8da3.eeffc2","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 12 * * *","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":110,"y":240,"wires":[["58c171f7.59b7a"]]},{"id":"8a69281b.9d7da8","type":"comment","z":"32cb8da3.eeffc2","name":"Sun Events simple example","info":"# Inject node(s)\nThere are two inject nodes in this example, one to initialise sun-events on flow deployment and the other to refresh the Sun-events at a fixed time each day.\n\n# Change node\nYou could just set the latitude and longitude in the msg.payload in an inject node, but since we are using two inject nodes in this example, the change node is used to set the payload from both.\n\n# Sun Events node\nThe Sun-events node will output a series of Sun events msg at the appropriate time of day.\n\n# Debug node\nThe debug node is just here to outpuit the contents of the payload in the debug window, you could obviously replace that with what ever logic you need for your use case. ","x":450,"y":100,"wires":[]},{"id":"7ed2700.7d9ad9","type":"inject","z":"f10f1911.0d5928","name":"Fake Victron GPS Input (Latitude)","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1.501364","payloadType":"num","x":200,"y":100,"wires":[["a7098192.563ad"]]},{"id":"133e413c.d490af","type":"inject","z":"f10f1911.0d5928","name":"Fake Victron GPS Input (Longitude)","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"-0.1440787","payloadType":"num","x":210,"y":180,"wires":[["83eeb23b.83ec8"]]},{"id":"a7098192.563ad","type":"change","z":"f10f1911.0d5928","name":"","rules":[{"t":"set","p":"latitude","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":100,"wires":[["319cbcdb.fbfb14"]]},{"id":"83eeb23b.83ec8","type":"change","z":"f10f1911.0d5928","name":"","rules":[{"t":"set","p":"longitude","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":180,"wires":[["319cbcdb.fbfb14"]]},{"id":"bec53378.d5ba5","type":"inject","z":"f10f1911.0d5928","name":"Inject from Global","props":[{"p":"payload.latitude","v":"latitude","vt":"global"},{"p":"payload.longitude","v":"longitude","vt":"global"}],"repeat":"","crontab":"00 12 * * *","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":140,"y":300,"wires":[["bbc8dc7e.0350d"]]},{"id":"3f2e386d.e75748","type":"debug","z":"f10f1911.0d5928","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":610,"y":300,"wires":[]},{"id":"319cbcdb.fbfb14","type":"function","z":"f10f1911.0d5928","name":"Current Lat & Long","func":"node.status([global.get('latitude'), global.get('longitude')].join(\", \"))\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":770,"y":140,"wires":[[]]},{"id":"77a56ab0.cab344","type":"comment","z":"f10f1911.0d5928","name":"Sun Events and GPS stream example","info":"If you have a stream of GPS coordinates comming into the flow (for example from a Victron Energet GX unit) it will be very inneficient to continually refresh Sunevents on every GPS update. One way to control the refresh is to store the lattest latitude and longitude into a global. You can then inject the contents of the global as and when required.","x":500,"y":60,"wires":[]},{"id":"9c3d074.206c9f8","type":"inject","z":"40f39ad3.0340f4","name":"","props":[{"p":"payload.x","v":"","vt":"date"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":90,"y":180,"wires":[["71446de1.5087d4","40936388.b8e1dc"]]},{"id":"bdfd46bb.682268","type":"debug","z":"40f39ad3.0340f4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":550,"y":180,"wires":[]},{"id":"71446de1.5087d4","type":"debug","z":"40f39ad3.0340f4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":310,"y":100,"wires":[]},{"id":"fa29adf4.f428b","type":"sun events","z":"32cb8da3.eeffc2","testmode":"N","verbose":"N","topic":"","name":"","x":590,"y":180,"wires":[["f10b6e96.34bbf"]]},{"id":"bbc8dc7e.0350d","type":"sun events","z":"f10f1911.0d5928","testmode":"N","verbose":"N","topic":"","name":"","x":390,"y":300,"wires":[["3f2e386d.e75748"]]},{"id":"40936388.b8e1dc","type":"sun events","z":"40f39ad3.0340f4","testmode":true,"verbose":"N","topic":"","name":"","x":330,"y":180,"wires":[["bdfd46bb.682268"]]}] | ||
[{"id":"32cb8da3.eeffc2","type":"tab","label":"Sun Events simple example","disabled":true,"info":""},{"id":"f10f1911.0d5928","type":"tab","label":"Sun Events GPS stream example ","disabled":true,"info":""},{"id":"40f39ad3.0340f4","type":"tab","label":"No lat and long","disabled":true,"info":""},{"id":"69c9ac2d.f545b4","type":"tab","label":"Mult events","disabled":false,"info":""},{"id":"2d8758dc.922e08","type":"inject","z":"32cb8da3.eeffc2","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payloadType":"str","x":110,"y":120,"wires":[["58c171f7.59b7a"]]},{"id":"f10b6e96.34bbf","type":"debug","z":"32cb8da3.eeffc2","name":"Your logic goes here","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":800,"y":180,"wires":[]},{"id":"58c171f7.59b7a","type":"change","z":"32cb8da3.eeffc2","name":"set GPS coordinates (change node) ","rules":[{"t":"set","p":"payload.latitude","pt":"msg","to":"51.501364","tot":"num"},{"t":"set","p":"payload.longitude","pt":"msg","to":"-0.1440787","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":180,"wires":[["fa29adf4.f428b"]]},{"id":"c0aa61b0.223ae","type":"inject","z":"32cb8da3.eeffc2","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 12 * * *","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":110,"y":240,"wires":[["58c171f7.59b7a"]]},{"id":"8a69281b.9d7da8","type":"comment","z":"32cb8da3.eeffc2","name":"Sun Events simple example","info":"# Inject node(s)\nThere are two inject nodes in this example, one to initialise sun-events on flow deployment and the other to refresh the Sun-events at a fixed time each day.\n\n# Change node\nYou could just set the latitude and longitude in the msg.payload in an inject node, but since we are using two inject nodes in this example, the change node is used to set the payload from both.\n\n# Sun Events node\nThe Sun-events node will output a series of Sun events msg at the appropriate time of day.\n\n# Debug node\nThe debug node is just here to outpuit the contents of the payload in the debug window, you could obviously replace that with what ever logic you need for your use case. ","x":450,"y":100,"wires":[]},{"id":"7ed2700.7d9ad9","type":"inject","z":"f10f1911.0d5928","name":"Fake Victron GPS Input (Latitude)","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1.501364","payloadType":"num","x":200,"y":100,"wires":[["a7098192.563ad"]]},{"id":"133e413c.d490af","type":"inject","z":"f10f1911.0d5928","name":"Fake Victron GPS Input (Longitude)","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"-0.1440787","payloadType":"num","x":210,"y":180,"wires":[["83eeb23b.83ec8"]]},{"id":"a7098192.563ad","type":"change","z":"f10f1911.0d5928","name":"","rules":[{"t":"set","p":"latitude","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":100,"wires":[["319cbcdb.fbfb14"]]},{"id":"83eeb23b.83ec8","type":"change","z":"f10f1911.0d5928","name":"","rules":[{"t":"set","p":"longitude","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":180,"wires":[["319cbcdb.fbfb14"]]},{"id":"bec53378.d5ba5","type":"inject","z":"f10f1911.0d5928","name":"Inject from Global","props":[{"p":"payload.latitude","v":"latitude","vt":"global"},{"p":"payload.longitude","v":"longitude","vt":"global"}],"repeat":"","crontab":"00 12 * * *","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":140,"y":300,"wires":[["bbc8dc7e.0350d"]]},{"id":"3f2e386d.e75748","type":"debug","z":"f10f1911.0d5928","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":610,"y":300,"wires":[]},{"id":"319cbcdb.fbfb14","type":"function","z":"f10f1911.0d5928","name":"Current Lat & Long","func":"node.status([global.get('latitude'), global.get('longitude')].join(\", \"))\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":770,"y":140,"wires":[[]]},{"id":"77a56ab0.cab344","type":"comment","z":"f10f1911.0d5928","name":"Sun Events and GPS stream example","info":"If you have a stream of GPS coordinates comming into the flow (for example from a Victron Energet GX unit) it will be very inneficient to continually refresh Sunevents on every GPS update. One way to control the refresh is to store the lattest latitude and longitude into a global. You can then inject the contents of the global as and when required.","x":500,"y":60,"wires":[]},{"id":"9c3d074.206c9f8","type":"inject","z":"40f39ad3.0340f4","name":"","props":[{"p":"payload.x","v":"","vt":"date"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":90,"y":180,"wires":[["71446de1.5087d4","40936388.b8e1dc"]]},{"id":"bdfd46bb.682268","type":"debug","z":"40f39ad3.0340f4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":550,"y":180,"wires":[]},{"id":"71446de1.5087d4","type":"debug","z":"40f39ad3.0340f4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":310,"y":100,"wires":[]},{"id":"fa29adf4.f428b","type":"sun events","z":"32cb8da3.eeffc2","testmode":"N","verbose":"N","topic":"","name":"","x":590,"y":180,"wires":[["f10b6e96.34bbf"]]},{"id":"bbc8dc7e.0350d","type":"sun events","z":"f10f1911.0d5928","testmode":"N","verbose":"N","topic":"","name":"","x":390,"y":300,"wires":[["3f2e386d.e75748"]]},{"id":"40936388.b8e1dc","type":"sun events","z":"40f39ad3.0340f4","testmode":true,"verbose":"N","topic":"","name":"","x":330,"y":180,"wires":[["bdfd46bb.682268"]]},{"id":"88c6fc11.037fc","type":"inject","z":"69c9ac2d.f545b4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"900","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"{\"lat\": 50.1233, \"lng\": -1.123}","payloadType":"json","x":100,"y":140,"wires":[["9acea12a.383b6"]]},{"id":"86e1df09.8a4cf","type":"debug","z":"69c9ac2d.f545b4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":500,"y":140,"wires":[]},{"id":"9acea12a.383b6","type":"sun events","z":"69c9ac2d.f545b4","testmode":"N","verbose":"N","topic":"","name":"","x":320,"y":140,"wires":[["86e1df09.8a4cf"]]}] |