Skip to content
openenergymonitorPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

emonWiFi

This small adapter allows OpenEnergyMonitor products to be used with a WiFi connection. The module is fully supported by ESPHome and is compatible with many endpoints, for example emonCMS, Home Assistant, and MQTT.

It is available for the following OpenEnergyMonitor products:

The adapter uses an Espressif ESP32-C3 and connects to the emonTx's serial port.

Warning

You must not connect the USB-C port of the emonWiFi while the emonWiFi is plugged into an emonTx. Doing so can cause damage to your emonTx.

Hardware Setup

Installing the pin headers

You need to fit the connectors that correspond to the device you are attaching it to. There are different headers for each of the boards listed above. The headers face downwards, away from the side with the USB-C socket.

For an emonPi3 and emonTx6, a 2x5 pin header is installed in the position marked Pi3.

Pin header for emonPi3 and emonTx6

For an emonPi2 and emonTx5, a 5 position socket is installed in the position marked Pi2.

Socket for emonPi2 and emonTx5

For an emonTx4, a 6 position socket is installed in the position marked Tx4.

Socket for emonTx4

Installing the emonWiFi

Warning

You must remove power from the emonTx before installing the emonWiFi. Failure to do so can result in damage to either or both of the devices.

Warning

Ensure you have placed the emonWiFi into the correct position for your emonTx before applying power. Failure to do so can result in damage to either or both of the devices.

emonTx4

Note

If you want to configure the emonTx4 over the WiFi connection, you must remove the solder bridge marked JP6. With this removed, you will not be able to configure the emonTx4 using the USB-C port.

With the emonTx4's USB-C port facing downwards, insert the emonWiFi into the 6 pins in the centre left. The emonWiFi's USB-C port should face to the right.

emonTx5

Note

If you want to configure the emonTx5 over the WiFi connection, you must cut the pad marked USB_TX. With this cut, you will not be able to configure the emonTx5 using the USB-C port. You can restore this functionality by applying a small solder bridge over the USB_TX pads.

With the emonTx5's USB-C port to the right, insert the emonWiFi into the pins below the Raspberry Pi socket as far to the right as possible with the emonWiFi's USB-C port also to the right.

emonTx6

With the emonTx6's USB-C port to the right, insert the emonWiFi into the 40pin socket towards the bottom as far to the right as possible with the emonWiFi's USB-C port also to the right.

Firmware Setup

Warning

You must not connect the USB-C port of the emonWiFi while the emonWiFi is plugged into an emonTx. Doing so can cause damage to your emonTx.

To install firmware for the first time, hold down the push button on the emonWiFi while plugging in the USB-C cable. This puts the ESP32 module into bootloader mode which allows firmware to be uploaded over the USB connection. After the first upload, you can use OTA updates.

ESPHome Firmware

The emonWiFi is natively supported by ESPHome. See the ESPHome emonTx component documentation for configuration details. This does not mean you need to use Home Assistant. The ESPHome firmware will communicate directly with emoncms by MQTT or HTTP(S).

If you are new to ESPHome it is worth noting that there is no prebuilt firmware image to download and then configure as there is with frameworks like Tasmota. You define the firmware using an ESPHome YAML configuration, which is then compiled and installed on the device. The first installation is performed over USB; subsequent updates can be installed over Wi-Fi using OTA.

To build the ESPHome firmware for the emonWiFi you will need the ESPHome Device Builder. You can find in-depth instructions on how to install and use that here.

The ESPHome configuration snippet for the emonWiFi is:

esphome:
  name: emonwifi
  friendly_name: emonWiFi

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: esp-idf

uart:
  id: emontx_uart # using UART2
  rx_pin: GPIO20
  tx_pin: GPIO21
  baud_rate: 115200
  rx_buffer_size: 2048

The YAML file that defines the ESPHome Device is where each of the sensors is declared. The tag_name attribute maps to the channels reported on the emonTx. An example sensor definition would look like:

emontx:

sensor:
  - platform: emontx
    tag_name: "V1"  # Use "V1"-"V3" for multi-phase; see Sensor Indexing for "Vrms" (single-phase)
    name: "Voltage"
  - platform: emontx
    tag_name: "P1"
    name: "Power CT1"
  - platform: emontx
    tag_name: "E1"
    name: "Energy CT1"

You do not need to integrate the emonWiFi running ESPHome with any larger home automation system. The configuration for an emonWiFi connected to an emonTx is documented in the Home Assistant integration documentation.

To configure the emonTx you will need to issue commands to it via the UART connection from the emonWiFi. Details of these commands are documented here, or you can send a ? command and the emonTx will respond with the command list.

They can be issued using the emontx.send_command Action or via components like Serial Proxy.

Home Assistant

To get data from your emonTx into Home Assistant you will need the ESPHome Device Builder and the ESPHome Home Assistant App. Note that in earlier versions of Home Assistant that Apps were known as Add-ons and you may see that still in some documentation.

The Device Builder lets you set up the emonWiFi as an ESPHome device. The ESPHome integration allows the ESPHome device to communicate with Home Assistant.

To be able to configure the emonTx via the emonWiFi within Home Assistant you will need emonPi/Tx Configuration for Home Assistant and make additional ESPHome configuration changes to include the emontx_ha_bridge component.

There are detailed instructions on how to set all this up in the project's README.md

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors