Support

PM1 Setup Guide:

There are two methods to add the PM1 to an ESPHome/Home Assistant instance. You can add a new device and flash the firmware with a physical device connection via USB serial or you can add it using the pre installed PM1 WIFI Captive portal and upload the firmware via OTA.

The WIFI Captive portal method is by far a more convient method since we only need a cell phone to establish your local WIFI connection. If the method chosen is the captive portal then you can install PM1 physically in the power distribution panel and configure it remotely using your phone and ESPHome/Home Assistant after one minute of power on time.

Important information:

  • If you are not fammiliar with AC mains safety please consult with or hire an electrician to connect the PM1.
  • Never connect to a live AC mains supply during the install.
  • Use only appropriately rated mains connection wire. e.g. 18 AWG Flexible AC 300V cord (Item ACCORD3 in the store)
  • Always use an non-metalic fire safe enclosure to house the PM1. (Item PM1BOX1 or PM1BOX2 in the store or 3D print it yourself)
  • Do not install the PM1 on the inside of a metal distribution panel as the WIFI signal will be poor do to the shielding.
  • Connect CT1 and the AC mains supply to the same same split phase line. (Higher accuracy)
  • If you are connecting the optional secondary voltage isolation transformer be sure to cut JP2 and connect the AC mains side to the alternate split AC line. (Polarity is not critical for the secondary voltage monitor)
  • CT1 and CT2 will detect current in or out of the panel, if you observe a negative current during positive usage then you need to reverse the clamp direction.

The ESPhome Home Assistant Add-on is required – see: https://esphome.io/guides/getting_started_hassio.html

Captive portal or Physical USB Serial Method prep:

Open the ESPhome add-on menu and add a new device.

new device - power-meter-1

The device name must be unique.

install skip

Skip this step. We need to add a full configuration first.

support page image - esp board type

Select the Expressif ESP8266 ESP-12E

ESP access encryption key

Skip again. Note the generated unique key, this must be preserved in the config going forward.

Edit the newly created device named power-meter-1, preserving the api key, add the example PM1 code after the captive portal line, as shown.

esphome:
  name: power-meter-1

esp8266:
  board: esp12e

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "HVKJQwDom1FpiVVyvJaapmJJErQ/58fDkczJ38KqrVg="

ota:
  password: "0b66232409165dd356a014046bc790c2"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Power-Meter 1 Fallback Hotspot"
    password: "lSPmFextDxAy"

captive_portal:

web_server:
  port: 80

spi:
  clk_pin: 14
  miso_pin: 12
  mosi_pin: 13

substitutions:
# Change the disp_name to something you want  
  disp_name: PM1
# Interval of how often the power is updated
  update_time: 15s
# Current transformer calibrations:
# 100A/50mA SCT-013: 15270
# 200A/100mA SCT-023: 15270
# Integrated Block AVB 2,0/2/6 Transformer: 4425
  current_cal: '15270'
  voltage_cal: '4425'

sensor:

  - platform: wifi_signal
    name: ${disp_name} WiFi Signal
    update_interval: 15s
  
  - platform: atm90e32
    cs_pin: 5
    phase_a:
      voltage:
        name: ${disp_name} Volts
        accuracy_decimals: 1
      current:
        name: ${disp_name} CT1 Amps
        id: "ct1Amps"
      power:
        name: ${disp_name} CT1 Watts
        accuracy_decimals: 1
        id: "ct1Watts"
      gain_voltage: ${voltage_cal}
      gain_ct: ${current_cal}
    phase_c:
      current:
        name: ${disp_name} CT2 Amps
        id: "ct2Amps"
      power:
        name: ${disp_name} CT2 Watts
        accuracy_decimals: 1
        id: "ct2Watts"
      gain_voltage: ${voltage_cal}
      gain_ct: ${current_cal}
    frequency:
      name: ${disp_name} Freq
    line_frequency: 60Hz
    gain_pga: 2X
    chip_temperature:
      name: ${disp_name} IC Temperature
    update_interval: ${update_time}
  - platform: template
    name: ${disp_name} Total Amps
    id: "totalAmps"
    lambda: return id(ct1Amps).state + id(ct2Amps).state;
    accuracy_decimals: 2
    unit_of_measurement: A
    update_interval: ${update_time}  
    device_class: current
  - platform: template
    name: ${disp_name} Total Watts
    id: "totalWatts"
    lambda: return id(ct1Watts).state + id(ct2Watts).state;
    accuracy_decimals: 0
    unit_of_measurement: W
    device_class: power
    update_interval: ${update_time}

  - platform: total_daily_energy
    name: ${disp_name} Total kWh
    power_id: totalWatts
    filters:
      - multiply: 0.001
    unit_of_measurement: kWh
    device_class: energy
    state_class: total_increasing    
    
time:
  - platform: sntp
    id: sntp_time
    servers: pool.ntp.org
        
    
switch:
  - platform: restart
    name: ${disp_name} Restart  

Captive Portal Method:

captive portal power-meter-1

With the PM1 already powered up for at least 1 minute use a phone or other capable device connect to the PM1 default preinstalled captive portal AP SSID named power-meter-1

captive portal select ssid

Set the SSID and Password.

After a minute or so visit the PM1 WEB portal using its mDNS address to verify it’s ready. Power cycle it if required.

http://power-meter-1.local

Prepare the firmware by selecting INSTALL on the top right of the ESPHome edit screen.

PM1 firmware wireless upload

Select wirelessly.

esphome device online

PM1 will now come online and you can add it to Home Assisant with the configured key.

Physical USB Serial Method:

To enable flash mode on the PM1 you need to depress and hold SW1 then connect your USB to serial adapter to the uart flashing connector as shown here. Once power is applied the button can be released and PM1 will be in flash mode. (Preconnecting J1 and then plugging in the USB end is usually easier)

Serial TX and RX pins should be crossed e.g.

J1 PM1 :    USB Adapter
TX     ->   RX
RX     <-   TX
3.3v   -    3.5v Max
GND    -    GND
flash button
SW1
flash header
J1

Prepare the firmware by selecting install on the top right of the ESPHome edit screen.

manual download

Select Plug into this computer.

esphome device online

PM1 will now come online and you can add it to Home Assisant with the configured key.