Hello guys!!!
I recently purchased a Wemos® Mega + WiFi R3 ATmega2560 + ESP8266 to communicate with my Raspberry Pi running Home Assistant via the MQTT protocol.
My intention is to control some relays and pick up the status of some voltage sensors to check if the light is on or not. I intend to do this because the relays will be in parallel making the system completely independent. I know this makes the project a lot more complicated but it was the way I found it to make the system independent of any device.
At first I used Firmata firmware on myboard but the update time of the sensors was not satisfactory so my intention now is to use MQTT.
The problem is that I am filled with doubts about how to best perform the communication between these components. I’m seriously thinking of merging some codes to get what I want but before that I would like to know if there is some automated way.
I know that this board has two microntoladores so the intention is to use the ESP8266 as an MQTT Bridge which will communicate via serial with the Arduino MEGA. The arduino would then execute the commands, do the readings of some sensors and send the data to ESP via serial, which in turn would send the data by MQTT to the Home Assistant.
I am a layman on the subject (just a curious one) so I would like to hear your opinion and suggestions. Am I crazy?
Thank you!