This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automated Lighting
#1
I'm a "if you leave it to me to remember it, I'll forget" kind of sailor, so I like to automate what I can. On my new boat (based on experience form my old boat) I've installed shelly's on my lighting systems – anchor, running, steaming, deck lights. It's given me nice little switches in WhilhelmSK, which makes it convenient to activate on my iPhone when I"m coming down the dock (I can (turn on the deck light before I get there), or I drop the anchor and the sunsets, but I didn't turn on the light (happens automatically now). This also allowed me to remove old plug ins (virtual N2K switch and some sort of state generator) that added latency into the setup. Now, everything ie pretty much in real time and it ruins smoothly. Only requirement is Derived-Data to generate time of day and something that sets navigation.state. It outputs to shelly relays which are connected to my boat's wifi. Nice thing is on start up, it polls the Shellys for their state and assigns the switch, it doesn't just guess. 

[{"id":"7166cba6f1599e6a","type":"tab","label":"Lighting Switch Control","disabled":false,"info":"","env":[]},{"id":"2567f298acc1b4cf","type":"shelly-gen2","z":"7166cba6f1599e6a","hostname":"172.16.1.101","description":"Anchor Light","mode":"polling","verbose":false,"server":"fa05f71af5cb9244","uploadretryinterval":"5000","pollinginterval":"5000","pollstatus":false,"getstatusoncommand":true,"devicetype":"Relay","devicetypemustmatchexactly":true,"captureblutooth":false,"outputs":1,"x":230,"y":460,"wires":[["93611193646f0f50"]]},{"id":"93611193646f0f50","type":"switch","z":"7166cba6f1599e6a","name":"","property":"payload.switch0.output","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":210,"y":520,"wires":[["12f1316be74e5245"],["86bc830de1f5dac8"]]},{"id":"86bc830de1f5dac8","type":"change","z":"7166cba6f1599e6a","name":"Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"electrical.switches.ShellyAnchor.state","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":540,"wires":[["3b894997866f0e59"]]},{"id":"12f1316be74e5245","type":"change","z":"7166cba6f1599e6a","name":"On","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"electrical.switches.ShellyAnchor.state","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":500,"wires":[["3b894997866f0e59"]]},{"id":"3b894997866f0e59","type":"signalk-send-pathvalue","z":"7166cba6f1599e6a","name":"","path":"","source":"","meta":"","x":690,"y":500,"wires":[]},{"id":"69fcf278a3cf863d","type":"signalk-subscribe","z":"7166cba6f1599e6a","name":"Nav State","mode":"sendAll","flatten":true,"context":"vessels.self","path":"navigation.state","source":"","period":1000,"x":100,"y":140,"wires":[["16d9e7e8f582b12e"]]},{"id":"7e8852e1ec2253cb","type":"signalk-subscribe","z":"7166cba6f1599e6a","name":"Day Mode","mode":"sendAll","flatten":true,"context":"vessels.self","path":"environment.mode","source":"","period":1000,"x":100,"y":200,"wires":[["17aae2238baa20f1"]]},{"id":"c6d4a11f443d8caf","type":"change","z":"7166cba6f1599e6a","name":"topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"autoLighting","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":80,"wires":[["b145e0bdff86bb25"]]},{"id":"16d9e7e8f582b12e","type":"change","z":"7166cba6f1599e6a","name":"topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"navState","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":140,"wires":[["b145e0bdff86bb25"]]},{"id":"17aae2238baa20f1","type":"change","z":"7166cba6f1599e6a","name":"topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"dayTime","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":200,"wires":[["b145e0bdff86bb25"]]},{"id":"b45b7a981f65f319","type":"change","z":"7166cba6f1599e6a","name":"topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"anchorCommand","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":260,"wires":[["b145e0bdff86bb25"]]},{"id":"88e0e461e803ccca","type":"change","z":"7166cba6f1599e6a","name":"topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"runningCommand","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":320,"wires":[["b145e0bdff86bb25"]]},{"id":"76e465b80b1f99df","type":"change","z":"7166cba6f1599e6a","name":"topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"steamingCommand","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":380,"wires":[["b145e0bdff86bb25"]]},{"id":"a52b9bc5a7d335fe","type":"signalk-put-handler","z":"7166cba6f1599e6a","name":"Steaming Command","path":"electrical.switches.steamingLight.state","pending":false,"x":130,"y":380,"wires":[["76e465b80b1f99df"]]},{"id":"80e79252d6b58cbb","type":"signalk-put-handler","z":"7166cba6f1599e6a","name":"Running Command","path":"electrical.switches.runningLights.state","pending":false,"x":130,"y":320,"wires":[["88e0e461e803ccca"]]},{"id":"d0bfaaa8ed8f1cb7","type":"signalk-put-handler","z":"7166cba6f1599e6a","name":"Anchor Command","path":"electrical.switches.anchorLight.state","pending":false,"x":130,"y":260,"wires":[["b45b7a981f65f319"]]},{"id":"b5ec39125c0694e7","type":"signalk-put-handler","z":"7166cba6f1599e6a","name":"Auto Lights","path":"electrical.switches.autoLights.state","pending":false,"x":110,"y":80,"wires":[["c6d4a11f443d8caf"]]},{"id":"4d5ed81b4cb26509","type":"shelly-gen2","z":"7166cba6f1599e6a","hostname":"172.16.1.102","description":"Running Light","mode":"polling","verbose":false,"server":"fa05f71af5cb9244","uploadretryinterval":"5000","pollinginterval":"5000","pollstatus":false,"getstatusoncommand":true,"devicetype":"Relay","devicetypemustmatchexactly":false,"captureblutooth":false,"outputs":1,"x":240,"y":640,"wires":[["fad53d30ea4e135a"]]},{"id":"fad53d30ea4e135a","type":"switch","z":"7166cba6f1599e6a","name":"","property":"payload.switch0.output","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":210,"y":700,"wires":[["d7bab9f6ed35c7d5"],["78c7e632ba5d5907"]]},{"id":"78c7e632ba5d5907","type":"change","z":"7166cba6f1599e6a","name":"Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"electrical.switches.ShellyRunning.state","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":720,"wires":[["621d780fad46325b"]]},{"id":"d7bab9f6ed35c7d5","type":"change","z":"7166cba6f1599e6a","name":"On","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"electrical.switches.ShellyRunning.state","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":680,"wires":[["621d780fad46325b"]]},{"id":"621d780fad46325b","type":"signalk-send-pathvalue","z":"7166cba6f1599e6a","name":"","path":"","source":"","meta":"","x":690,"y":680,"wires":[]},{"id":"f76d9bc7d5ca2209","type":"shelly-gen2","z":"7166cba6f1599e6a","hostname":"172.16.1.103","description":"Steaming Light","mode":"polling","verbose":false,"server":"fa05f71af5cb9244","uploadretryinterval":"5000","pollinginterval":"5000","pollstatus":false,"getstatusoncommand":true,"devicetype":"Relay","devicetypemustmatchexactly":false,"captureblutooth":false,"outputs":1,"x":240,"y":820,"wires":[["715161af11541fb7"]]},{"id":"715161af11541fb7","type":"switch","z":"7166cba6f1599e6a","name":"","property":"payload.switch0.output","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":210,"y":880,"wires":[["30309b5d312f7958"],["775b9cd3989b46a4"]]},{"id":"775b9cd3989b46a4","type":"change","z":"7166cba6f1599e6a","name":"Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"electrical.switches.ShellySteaming.state","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":900,"wires":[["e5fbf3e7cf0a507e"]]},{"id":"30309b5d312f7958","type":"change","z":"7166cba6f1599e6a","name":"On","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"electrical.switches.ShellySteaming.state","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":860,"wires":[["e5fbf3e7cf0a507e"]]},{"id":"e5fbf3e7cf0a507e","type":"signalk-send-pathvalue","z":"7166cba6f1599e6a","name":"","path":"","source":"","meta":"","x":690,"y":860,"wires":[]},{"id":"d20902a8637d0f63","type":"inject","z":"7166cba6f1599e6a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"2","topic":"","payload":"","payloadType":"date","x":110,"y":1220,"wires":[["477c31756a37eb0c","db768674d3962a46"]]},{"id":"477c31756a37eb0c","type":"function","z":"7166cba6f1599e6a","name":"Auto INIT","func":"msg.topic = \"electrical.switches.autoLights.state\";\nmsg.payload = 0;\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":1220,"wires":[["021b7cb9662cb152"]]},{"id":"c29d545747d85302","type":"comment","z":"7166cba6f1599e6a","name":"Vitual Switch Initialization (on startup)","info":"","x":150,"y":1180,"wires":[]},{"id":"a290b39f2ee0917d","type":"shelly-gen2","z":"7166cba6f1599e6a","hostname":"172.16.1.104","description":"Deck Light","mode":"polling","server":"","outputmode":"event","uploadretryinterval":5000,"pollinginterval":5000,"pollstatus":false,"getstatusoncommand":true,"devicetype":"Relay","outputs":1,"x":170,"y":1320,"wires":[["473e0366b395e160"]]},{"id":"473e0366b395e160","type":"switch","z":"7166cba6f1599e6a","name":"","property":"payload.result.output","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":1320,"wires":[["bcbfb245a83c75bb"],["55b9374f6a0405f4"]]},{"id":"bcbfb245a83c75bb","type":"change","z":"7166cba6f1599e6a","name":"Off","rules":[{"t":"set","p":"topic","pt":"msg","to":"electrical.switches.deckLight.state","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":1300,"wires":[["ad487f6f4245461b"]]},{"id":"021b7cb9662cb152","type":"signalk-send-pathvalue","z":"7166cba6f1599e6a","name":"","path":"","source":"","meta":"","x":710,"y":1220,"wires":[]},{"id":"ad487f6f4245461b","type":"signalk-send-pathvalue","z":"7166cba6f1599e6a","name":"","path":"","source":"","meta":"","x":710,"y":1320,"wires":[]},{"id":"55b9374f6a0405f4","type":"change","z":"7166cba6f1599e6a","name":"On","rules":[{"t":"set","p":"topic","pt":"msg","to":"electrical.switches.deckLight.state","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":1340,"wires":[["ad487f6f4245461b"]]},{"id":"7928c6f01b09d7f1","type":"shelly-gen2","z":"7166cba6f1599e6a","hostname":"172.16.1.101","description":"Anchor Light","mode":"polling","verbose":false,"server":"fa05f71af5cb9244","uploadretryinterval":"5000","pollinginterval":"5000","pollstatus":false,"getstatusoncommand":false,"devicetype":"Relay","devicetypemustmatchexactly":false,"captureblutooth":false,"outputs":1,"x":170,"y":1400,"wires":[["5435568e5ba415be"]]},{"id":"5435568e5ba415be","type":"switch","z":"7166cba6f1599e6a","name":"","property":"payload.result.output","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":true,"outputs":2,"x":330,"y":1400,"wires":[["eff9a76ae0cc8860"],["12de4286daabd4f2"]]},{"id":"eff9a76ae0cc8860","type":"change","z":"7166cba6f1599e6a","name":"Off","rules":[{"t":"set","p":"topic","pt":"msg","to":"electrical.switches.anchorLight.state","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":1380,"wires":[["68993a7a49d27065"]]},{"id":"68993a7a49d27065","type":"signalk-send-pathvalue","z":"7166cba6f1599e6a","name":"","path":"","source":"","meta":"","x":710,"y":1400,"wires":[]},{"id":"b23f294776453f30","type":"shelly-gen2","z":"7166cba6f1599e6a","hostname":"172.16.1.102","description":"Running Lights","mode":"polling","server":"fa05f71af5cb9244","uploadretryinterval":"5000","pollinginterval":"5000","pollstatus":false,"getstatusoncommand":false,"devicetype":"Relay","outputs":1,"x":160,"y":1480,"wires":[["02c65b44e099c7d5"]]},{"id":"02c65b44e099c7d5","type":"switch","z":"7166cba6f1599e6a","name":"","property":"payload.result.output","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":true,"outputs":2,"x":330,"y":1480,"wires":[["b8a81a0719d2b45a"],["058d241032abff5e"]]},{"id":"b8a81a0719d2b45a","type":"change","z":"7166cba6f1599e6a","name":"Off","rules":[{"t":"set","p":"topic","pt":"msg","to":"electrical.switches.runningLights.state","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":1460,"wires":[["c0f538fcb2148d52"]]},{"id":"058d241032abff5e","type":"change","z":"7166cba6f1599e6a","name":"On","rules":[{"t":"set","p":"topic","pt":"msg","to":"electrical.switches.runningLights.state","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":1500,"wires":[["c0f538fcb2148d52"]]},{"id":"106fca9204d5a1f8","type":"shelly-gen2","z":"7166cba6f1599e6a","hostname":"172.16.1.103","description":"Steaming Light","mode":"polling","server":"fa05f71af5cb9244","uploadretryinterval":"5000","pollinginterval":"5000","pollstatus":false,"getstatusoncommand":false,"devicetype":"Relay","outputs":1,"x":160,"y":1560,"wires":[["b5b5cad9a4d57928"]]},{"id":"b5b5cad9a4d57928","type":"switch","z":"7166cba6f1599e6a","name":"","property":"payload.result.output","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":true,"outputs":2,"x":330,"y":1560,"wires":[["e85a7dda4f77fd72"],["ec6fb9e866bea84e"]]},{"id":"e85a7dda4f77fd72","type":"change","z":"7166cba6f1599e6a","name":"Off","rules":[{"t":"set","p":"topic","pt":"msg","to":"electrical.switches.steamingLight.state","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":1540,"wires":[["997903ac3c1b1e33"]]},{"id":"ec6fb9e866bea84e","type":"change","z":"7166cba6f1599e6a","name":"On","rules":[{"t":"set","p":"topic","pt":"msg","to":"electrical.switches.steamingLight.state","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":1580,"wires":[["997903ac3c1b1e33"]]},{"id":"997903ac3c1b1e33","type":"signalk-send-pathvalue","z":"7166cba6f1599e6a","name":"","path":"","source":"","meta":"","x":710,"y":1560,"wires":[]},{"id":"c0f538fcb2148d52","type":"signalk-send-pathvalue","z":"7166cba6f1599e6a","name":"","path":"","source":"","meta":"","x":710,"y":1480,"wires":[]},{"id":"12de4286daabd4f2","type":"change","z":"7166cba6f1599e6a","name":"On","rules":[{"t":"set","p":"topic","pt":"msg","to":"electrical.switches.anchorLight.state","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":1420,"wires":[["68993a7a49d27065"]]},{"id":"658d8165ddd12d16","type":"function","z":"7166cba6f1599e6a","name":"State Engine","func":"let p = msg.payload;\n\n// Defaults\nlet autoLighting = Number(p.autoLighting || 0);\nlet anchorCommand = Number(p.anchorCommand || 0);\nlet runningCommand = Number(p.runningCommand || 0);\nlet steamingCommand = Number(p.steamingCommand || 0);\n\nlet anchor = false;\nlet running = false;\nlet steaming = false;\n\n// ----------------------------------------\n// MANUAL COMMANDS\n// ----------------------------------------\n\nif (anchorCommand === 1) {\n    anchor = true;\n}\n\nif (runningCommand === 1) {\n    running = true;\n}\n\nif (steamingCommand === 1) {\n    steaming = true;\n}\n\n// ----------------------------------------\n// AUTOMATION\n// ----------------------------------------\n\nif (\n    autoLighting === 1 &&\n    p.navState !== undefined &&\n    p.dayTime !== undefined\n) {\n\n    // Anchor Light\n    if (\n        (p.navState === \"anchored\" || p.navState === \"moored\") &&\n        p.dayTime !== \"day\"\n    ) {\n        anchor = true;\n    }\n\n    // Running Lights\n    if (\n        (p.navState === \"sailing\" || p.navState === \"motoring\") &&\n        p.dayTime !== \"day\"\n    ) {\n        running = true;\n    }\n\n    // Steaming Light\n    if (\n        p.navState === \"motoring\" &&\n        p.dayTime !== \"day\"\n    ) {\n        steaming = true;\n    }\n}\n\n// ----------------------------------------\n// SUPPRESS DUPLICATES\n// ----------------------------------------\n\nlet currentState = {\n    anchor,\n    running,\n    steaming\n};\n\nlet lastState = context.get(\"lastState\");\n\nif (\n    lastState &&\n    JSON.stringify(lastState) === JSON.stringify(currentState)\n) {\n    return null;\n}\n\ncontext.set(\"lastState\", currentState);\n\n// ----------------------------------------\n// DEBUG\n// ----------------------------------------\n\n//node.warn(currentState);\n\n// ----------------------------------------\n// SHELLY COMMANDS\n// ----------------------------------------\n\nreturn [\n    {\n        payload: {\n            method: \"Switch.Set\",\n            parameters: {\n                id: 0,\n                on: anchor\n            }\n        }\n    },\n    {\n        payload: {\n            method: \"Switch.Set\",\n            parameters: {\n                id: 0,\n                on: running\n            }\n        }\n    },\n    {\n        payload: {\n            method: \"Switch.Set\",\n            parameters: {\n                id: 0,\n                on: steaming\n            }\n        }\n    }\n];","outputs":3,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":300,"wires":[["2567f298acc1b4cf"],["4d5ed81b4cb26509"],["f76d9bc7d5ca2209"]]},{"id":"b145e0bdff86bb25","type":"function","z":"7166cba6f1599e6a","name":"State Cache","func":"// node.warn({\n//  incomingTopic: msg.topic,\n//  incomingPayload: msg.payload\n// });\n\nlet state = context.get(\"state\") || {};\n\nstate[msg.topic] = msg.payload;\n\ncontext.set(\"state\", state);\n\nmsg.payload = state;\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":80,"wires":[["658d8165ddd12d16"]]},{"id":"fc369f39337524a8","type":"comment","z":"7166cba6f1599e6a","name":"Deck Light Control","info":"","x":90,"y":960,"wires":[]},{"id":"76604e5374deb0a7","type":"function","z":"7166cba6f1599e6a","name":"on","func":"msg.payload = {\n    method: \"Switch.Set\",\n    parameters: {\n        id: 0,\n        on: true,\n    }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":980,"wires":[["71efecbd6bdc0d54"]]},{"id":"92ca5c076c8dcfde","type":"function","z":"7166cba6f1599e6a","name":"off","func":"msg.payload = {\n    method: \"Switch.Set\",\n    parameters: {\n        id: 0,\n        on: false,\n    }\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":1020,"wires":[["71efecbd6bdc0d54"]]},{"id":"6a7efc5dc0953b44","type":"switch","z":"7166cba6f1599e6a","name":"","property":"payload.switch0.output","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":1100,"wires":[["a1afdd57898984de"],["027b787bf114be68"]]},{"id":"a1afdd57898984de","type":"change","z":"7166cba6f1599e6a","name":"Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"electrical.switches.ShellyDeck.state","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":1080,"wires":[["dc4547fa9832b320"]]},{"id":"027b787bf114be68","type":"change","z":"7166cba6f1599e6a","name":"On","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"electrical.switches.ShellyDeck.state","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":1120,"wires":[["dc4547fa9832b320"]]},{"id":"dc4547fa9832b320","type":"signalk-send-pathvalue","z":"7166cba6f1599e6a","name":"","path":"","source":"","meta":"","x":710,"y":1100,"wires":[]},{"id":"ce4593a147db0b55","type":"switch","z":"7166cba6f1599e6a","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":1000,"wires":[["76604e5374deb0a7"],["92ca5c076c8dcfde"]]},{"id":"71efecbd6bdc0d54","type":"shelly-gen2","z":"7166cba6f1599e6a","hostname":"172.16.1.104","description":"Deck Light","mode":"polling","server":"","outputmode":"event","uploadretryinterval":5000,"pollinginterval":5000,"pollstatus":false,"getstatusoncommand":true,"devicetype":"Relay","outputs":1,"x":670,"y":1000,"wires":[["6a7efc5dc0953b44"]]},{"id":"33d7bb804061f56f","type":"signalk-put-handler","z":"7166cba6f1599e6a","name":"Deck Light Switch","path":"electrical.switches.deckLight.state","pending":false,"x":110,"y":1000,"wires":[["ce4593a147db0b55"]]},{"id":"db768674d3962a46","type":"function","z":"7166cba6f1599e6a","name":"Poll Shelly States","func":"msg.payload = {\n    method: \"Switch.GetStatus\",\n    parameters: {\n        id: 0\n    }\n};\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":290,"y":1260,"wires":[["a290b39f2ee0917d","7928c6f01b09d7f1","b23f294776453f30","106fca9204d5a1f8"]]},{"id":"1f60b5503dfc573c","type":"comment","z":"7166cba6f1599e6a","name":"Auto Light Switch Logic","info":"","x":100,"y":40,"wires":[]},{"id":"fa05f71af5cb9244","type":"shelly-gen2-server","port":"10001","hostname":"unimatrix"},{"id":"e1d09f9c7f7c9644","type":"global-config","env":[],"modules":{"node-red-contrib-shelly":"11.11.2","@signalk/node-red-embedded":"2.21.0"}}]
_____________
Nautical 32
TBD
Saugatuck, MI
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)