ESPHome Component for EmonTX (ESPx & PiPicoW)

Continuing the discussion from EmonESP - ESPHome Component:

3 years since I first suggested this!

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.

I have a basic component up and running on a WEMOS D1 Mini and when ESPHome support for the PiPico chip (RP2040) arrives on Wednesday, I intend to try that out. It should ‘just work’. The Component in it’s current form can be found here GitHub - openenergymonitor/esphome_components: ESPHome Components with my working fork here GitHub - borpin/esphome_components: ESPHome Components.

However, for this component to work more widely, the EmonTX firmware needs to be modified to output a JSON string (again discussed elsewhere).

If anyone with some C++ skills wants to chip in, they would be very welcome as I’m reaching the limit of my C++ knowledge.

Things to do:

  • Add HTTP interface (possibly including compression)
  • Add a configuration item for scale to the Pulse output (currently assumes 1 pulse = 1 watt)
  • Investigate the SPI interface to the RFM69 chip
  • Investigate being able to modify the EmonTX settings from ESPHome
  • Investigate moving the I2C and OneWire sensors to be read directly by this device. This would widen the sensors supported by the EmonTX.