RPI notification alarm output to GPIO (pulsing piezo) #39
gregsyoung
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
a piezo is connected via a 1ch relay module to RPi GPIO 40, the below flow pulses the output when signalk notification alarms are set
& stops when alarm cleared.
[{"id":"749f1b8bf0241065","type":"tab","label":"Notifications Alarm output to GPIO","disabled":false,"info":"","env":[]},{"id":"a7c6ee1af91a5ab0","type":"rpi-gpio out","z":"749f1b8bf0241065","name":"","pin":"21","set":true,"level":"0","freq":"","out":"out","bcm":true,"x":1220,"y":140,"wires":[]},{"id":"cf90e92d.32c6a8","type":"inject","z":"749f1b8bf0241065","name":"","props":[{"p":"payload","v":"start","vt":"str"},{"p":"topic","v":"","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"start","payloadType":"str","x":530,"y":20,"wires":[["80fd4145.02be7"]]},{"id":"80fd4145.02be7","type":"trigger","z":"749f1b8bf0241065","name":"","op1":"1","op2":"0","op1type":"num","op2type":"num","duration":"1.2","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":810,"y":120,"wires":[["95500936.6dd878","a7c6ee1af91a5ab0"]]},{"id":"14cfbea5.9851f1","type":"delay","z":"749f1b8bf0241065","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":720,"y":180,"wires":[["80fd4145.02be7"]]},{"id":"95500936.6dd878","type":"switch","z":"749f1b8bf0241065","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":910,"y":180,"wires":[["14cfbea5.9851f1"]]},{"id":"1bfc8878.37cde8","type":"inject","z":"749f1b8bf0241065","name":"reset","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":530,"y":60,"wires":[["4b2947a2.e420f8"]]},{"id":"4b2947a2.e420f8","type":"change","z":"749f1b8bf0241065","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":200,"wires":[["80fd4145.02be7","14cfbea5.9851f1","5513ff13e31233a8"]]},{"id":"5513ff13e31233a8","type":"change","z":"749f1b8bf0241065","name":"reset GPIO to off (0)","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":80,"wires":[["a7c6ee1af91a5ab0"]]},{"id":"bd658d8d6ac028a0","type":"comment","z":"749f1b8bf0241065","name":""Alarm" Continuous 1.2 ON 1 OFF seconds ","info":"","x":740,"y":240,"wires":[]},{"id":"2cb2de384af1ce9e","type":"delay","z":"749f1b8bf0241065","name":"","pauseType":"delay","timeout":"0.7","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":470,"y":540,"wires":[["22c3a5aea74d7dac"]]},{"id":"bd16831206c8d2c2","type":"trigger","z":"749f1b8bf0241065","name":"","op1":"1","op2":"0","op1type":"num","op2type":"num","duration":"0.2","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":830,"y":420,"wires":[["d4342e02f8c9ae2c","a7c6ee1af91a5ab0"]]},{"id":"85ea3e40823e3a05","type":"delay","z":"749f1b8bf0241065","name":"","pauseType":"delay","timeout":"0.25","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":810,"y":480,"wires":[["bd16831206c8d2c2"]]},{"id":"d4342e02f8c9ae2c","type":"switch","z":"749f1b8bf0241065","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":1010,"y":480,"wires":[["85ea3e40823e3a05"]]},{"id":"22c3a5aea74d7dac","type":"change","z":"749f1b8bf0241065","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":480,"wires":[["85ea3e40823e3a05","c6b37160c9f72921","bd16831206c8d2c2"]]},{"id":"c6b37160c9f72921","type":"change","z":"749f1b8bf0241065","name":"reset GPIO to off (0)","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":380,"wires":[["a7c6ee1af91a5ab0"]]},{"id":"9a1d5fe235e256f1","type":"comment","z":"749f1b8bf0241065","name":"2 x Double Beep ","info":"","x":500,"y":380,"wires":[]},{"id":"cf6e9d12c9eae58d","type":"signalk-notification","z":"749f1b8bf0241065","name":"all notification path normal","notification":"","state":"normal","x":150,"y":240,"wires":[["4b2947a2.e420f8"]]},{"id":"9536784d61db49e5","type":"signalk-notification","z":"749f1b8bf0241065","name":"all notification path emergency","notification":"","state":"emergency","x":180,"y":80,"wires":[["80fd4145.02be7","ed1078c5b135a4d1"]]},{"id":"d76c9bbc148740b7","type":"signalk-notification","z":"749f1b8bf0241065","name":"all notification path alarm","notification":"","state":"alarm","x":170,"y":120,"wires":[["80fd4145.02be7","ed1078c5b135a4d1"]]},{"id":"ed1078c5b135a4d1","type":"debug","z":"749f1b8bf0241065","name":"debug 18","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":440,"y":260,"wires":[]},{"id":"98fd9dd39b7619d6","type":"inject","z":"749f1b8bf0241065","name":"","props":[{"p":"payload","v":"start","vt":"str"},{"p":"topic","v":"","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"start","payloadType":"str","x":270,"y":420,"wires":[["bd16831206c8d2c2","2cb2de384af1ce9e","acaffdbd321ec136"]]},{"id":"e0c4151fd7489f89","type":"signalk-notification","z":"749f1b8bf0241065","name":"all notification path normal","notification":"","state":"normal","x":190,"y":540,"wires":[["22c3a5aea74d7dac"]]},{"id":"7785acc5eee2b3e5","type":"signalk-notification","z":"749f1b8bf0241065","name":"all notification path "Alert"","notification":"","state":"alert","x":210,"y":720,"wires":[[]]},{"id":"acaffdbd321ec136","type":"trigger","z":"749f1b8bf0241065","name":"","op1":"","op2":"1","op1type":"nul","op2type":"str","duration":"5","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":440,"y":600,"wires":[["bd16831206c8d2c2","2cb2de384af1ce9e"]]},{"id":"9685f4884b8ddcd4","type":"signalk-notification","z":"749f1b8bf0241065","name":"all notification path WARN","notification":"","state":"warn","x":190,"y":480,"wires":[["bd16831206c8d2c2","acaffdbd321ec136","2cb2de384af1ce9e"]]},{"id":"e881715a0e4b761b","type":"comment","z":"749f1b8bf0241065","name":"silent","info":"","x":410,"y":720,"wires":[]}]
Beta Was this translation helpful? Give feedback.
All reactions