I've put together some "Alpha code" for anyone interested in utilising an Arduino MEGA 2560 as a digital I/O unit that integrates nicely with this plugin. I put this together to see how reliably an arduino mega would work with MQTT. There are LOT of wireless projects with limited numbers of PINS, I wanted at least 20 input and 20 outputs (per node) for my home automation system. Just at my own front door I have 13 inputs and 8 outputs for various devices.
This code was based on Jonathan Oxers LightswitchMQTT controller, I removed the temp sensors & OLED as I have no need for them
1) Unit powers up and sends the status of all inputs so your H/A can sync to the state.
2) Outputs when activated send back a positive acknowledgement so NodeRed switches can be guaranteed to work (status set by input)
There are definately a few bugs in it, nothing that will cause it to fail, just debug output on the serial isnt correct, that I need to work on. OTHERWISE it works like a CHAMP !
If anyone wants to help clean it up or otherwise, do a pull of it on GitHub. I did it for fun and learnt along the way....
https://github.com/petez69/MQTT-Arduino-MEGA-I-O
This code was based on Jonathan Oxers LightswitchMQTT controller, I removed the temp sensors & OLED as I have no need for them
1) Unit powers up and sends the status of all inputs so your H/A can sync to the state.
2) Outputs when activated send back a positive acknowledgement so NodeRed switches can be guaranteed to work (status set by input)
There are definately a few bugs in it, nothing that will cause it to fail, just debug output on the serial isnt correct, that I need to work on. OTHERWISE it works like a CHAMP !
If anyone wants to help clean it up or otherwise, do a pull of it on GitHub. I did it for fun and learnt along the way....
https://github.com/petez69/MQTT-Arduino-MEGA-I-O
Comment