The idea is still to simplify the interface between the EmonTXx and other systems via Wi-Fi rather than RFM69. This is done by using the ESPHome Core and adding on a component specifically for the EmonTX. This approach has a number of advantages:
The C++ code base required to be maintained by OEM is reduced resulting in bug fixes and security updates to the base libraries being easily passed onto the ESP device.
Updates & configuration changes can be done OTA
The interface to HomeAssistant would be simplified and the device work independently from EmonCMS.
ESPHome has changed significantly since I first suggested this, with the core developer now part of the HA family and the integration to HA tighter and the support on a more professional footing.
@awjlogan - if you are looking at this, Iād suggest two components
A component to read the data from the TX Serial
A component to send the data to emoncms. Using a Lambda to send the data by MQTT is horribly clunky. Could provide an option for MQTT or HTTP API then it could go to emoncms.org.
@borpin - apologies, Iāve only just had a chance to have a look properly at this. Looks great - Iāll start having a play with it!
On the todo items, the emonPi3/Tx++ can easily do the OneWire interface and thereās an expander on board for I2C and Iāve left the temperature API agnostic to the actual sensor being used. We can skip the SPI interface and directly interface with the UART (using the existing header) - I put JSON support in to match the Tx4/Pi2 firmware, and this is clearly where it came from!
As it interfaces with the UART on the Pi3, if ESPHome supports commands being sent to a destination, it could configure it directly.
Currently, I have a USB-C header on the ESP board for programming - this seems a bit clunky (as thereās already a USB-C connector on the Pi3), so Iāll also look at programming the board through the Pi3 as well (Iām not too familiar with Espressifās stuff yet).
In the meantime, I can make you an ESP board up (probably, have to check my part stash) and after Iām happy it works, could send you one to use as well?
Quick skim of the ESPHome documentation suggests that the UART Component would be a reasonable place to start. It does support transmit from the ESPHome as well, so could be used to configure the Tx/Pi in situ.
Looking at Brianās Tx4 module, one question I have would be how to generalise it so the JSON decoding is not static. That is, the Pi3 can support 3 digital (OneWire or pulse) or 1 extra analog and 2 digital (OneWire or pulse) inputs. The number of temperature sensors is not defined but is detected at start up. There is a defined maximum for static allocation, but unlikely to be used in practice so youād end up with a lot of empty entries (āT5ā: 30000, āT6ā: 30000 ā¦). See what I can come up with - I also need to set up HA so I can test things