Hi,
I recently picked up a Emporia Vue 2 to monitor my energy. I confirmed that it all worked with the Emporia app and then flashed the ESPHome firmware on it and so far it’s been a nightmare. I double and tripled checked the firmware and clamping directions, everything looks correct. At first I was consuming more energy than the grid was supplying (I have no solar panels or any other source of energy).
Now I am seeing sort of the same issue but with a different graphic. I have 5.5 circuits that aren’t part of the main energy flow, they’re just floating in the breeze (see below).
If I look closer at the individual devices, it is reflecting just that, negative energy usage.
My setup is very simple, I have a main panel and subpanel in the garage. I have 2 clamps for the subpanel, one for each leg, and no x2 multiplier. Aside from that breaker, I only monitor 1 other 240V double-phase breaker with a single clamp and a 2x multiplier, and the rest are single phase.
The code that is running in the firmware is below, it is pretty much a copy-paste directly from the ESPHome Git repository. I am trying not to change much until I can get this basic setup working.
esphome:
name: emporia-vue2
friendly_name: emporia-vue2
external_components:
- source: github://emporia-vue-local/esphome@dev
components:
- emporia_vue
esp32:
board: esp32dev
framework:
type: esp-idf
version: recommended
# Enable Home Assistant API
api:
encryption:
# Encryption key is generated by the new device wizard.
key: "..."
services:
- service: play_rtttl
variables:
song_str: string
then:
- rtttl.play:
rtttl: !lambda 'return song_str;'
ota:
# Create a secure password for pushing OTA updates.
- platform: esphome
password: "..."
# Enable logging
logger:
logs:
# by default, every reading will be printed to the UART, which is very slow
# This will disable printing the readings but keep other helpful messages
sensor: INFO
wifi:
# Wifi credentials are stored securely by new device wizard.
ssid: "..."
password: "..."
preferences:
# please also make sure `restore: false` is set on all `platform: total_daily_energy`
# sensors below.
flash_write_interval: "48h"
output:
- platform: ledc
pin: GPIO12
id: buzzer
- platform: gpio
pin: GPIO27
id: buzzer_gnd
rtttl:
output: buzzer
on_finished_playback:
- logger.log: 'Song ended!'
button:
- platform: template
name: "Two Beeps"
on_press:
- rtttl.play: "two short:d=4,o=5,b=100:16e6,16e6"
light:
- platform: status_led
name: "D3_LED"
pin: 23
restore_mode: ALWAYS_OFF
entity_category: config
i2c:
sda: 21
scl: 22
scan: false
frequency: 400kHz
timeout: 1ms
id: i2c_a
time:
# needs some time source to reset daily counters and not accumulate
# floating-point issues. If Home Assistant isn't available, use sntp and
# set servers and/or DNS as appropriate: https://esphome.io/components/time/sntp.html
- platform: homeassistant
id: my_time
# these are called references in YAML. They allow you to reuse
# this configuration in each sensor, while only defining it once
.defaultfilters:
- &throttle_avg
# average all raw readings together over a 5 second span before publishing
throttle_average: 5s
- &throttle_time
# only send the most recent measurement every 60 seconds
throttle: 60s
- &invert
# invert and filter out any values below 0.
lambda: 'return max(-x, 0.0f);'
- &pos
# filter out any values below 0.
lambda: 'return max(x, 0.0f);'
- &abs
# take the absolute value of the value
lambda: 'return abs(x);'
sensor:
- platform: emporia_vue
i2c_id: i2c_a
phases:
- id: phase_a # Verify that this specific phase/leg is connected to correct input wire color on device listed below
input: BLACK # Vue device wire color
calibration: 0.023038 # 0.022 is used as the default as starting point but may need adjusted to ensure accuracy
# To calculate new calibration value use the formula <in-use calibration value> * <accurate voltage> / <reporting voltage>
voltage:
name: "Phase A Voltage"
filters: [*throttle_avg, *pos]
frequency:
name: "Phase A Frequency"
filters: [*throttle_avg, *pos]
- id: phase_b # Verify that this specific phase/leg is connected to correct input wire color on device listed below
input: RED # Vue device wire color
calibration: 0.02155 # 0.022 is used as the default as starting point but may need adjusted to ensure accuracy
# To calculate new calibration value use the formula <in-use calibration value> * <accurate voltage> / <reporting voltage>
voltage:
name: "Phase B Voltage"
filters: [*throttle_avg, *pos]
phase_angle:
name: "Phase B Phase Angle"
filters: [*throttle_avg, *pos]
ct_clamps:
# Do not specify a name for any of the power sensors here, only an id. This leaves the power sensors internal to ESPHome.
# Copy sensors will filter and then send power measurements to HA
# These non-throttled power sensors are used for accurately calculating energy
- phase_id: phase_a
input: "A" # Verify the CT going to this device input also matches the phase/leg
power:
id: phase_a_power
filters: [*pos]
- phase_id: phase_b
input: "B" # Verify the CT going to this device input also matches the phase/leg
power:
id: phase_b_power
filters: [*pos]
# Pay close attention to set the phase_id for each breaker by matching it to the phase/leg it connects to in the panel
- { phase_id: phase_a, input: "1", power: { id: cir1, filters: [ *pos ] } }
- { phase_id: phase_b, input: "2", power: { id: cir2, filters: [ *pos ] } }
- { phase_id: phase_a, input: "3", power: { id: cir3, filters: [ *pos ] } }
- { phase_id: phase_b, input: "4", power: { id: cir4, filters: [ *pos ] } }
- { phase_id: phase_a, input: "5", power: { id: cir5, filters: [ *pos ] } }
- { phase_id: phase_b, input: "6", power: { id: cir6, filters: [ *pos ] } }
- { phase_id: phase_a, input: "7", power: { id: cir7, filters: [ *pos ] } }
- { phase_id: phase_b, input: "8", power: { id: cir8, filters: [ *pos ] } }
- { phase_id: phase_a, input: "9", power: { id: cir9, filters: [ *pos ] } }
- { phase_id: phase_a, input: "10", power: { id: cir10, filters: [ *pos ] } }
- { phase_id: phase_a, input: "11", power: { id: cir11, filters: [ *pos, multiply: 2 ] } }
- { phase_id: phase_b, input: "12", power: { id: cir12, filters: [ *pos ] } }
- { phase_id: phase_a, input: "13", power: { id: cir13, filters: [ *pos ] } }
- { phase_id: phase_b, input: "14", power: { id: cir14, filters: [ *pos ] } }
- { phase_id: phase_a, input: "15", power: { id: cir15, filters: [ *pos ] } }
- { phase_id: phase_b, input: "16", power: { id: cir16, filters: [ *pos ] } }
on_update:
then:
- component.update: total_power
- component.update: balance_power
# The copy sensors filter and send the power state to HA
- { platform: copy, name: "Phase A Power", source_id: phase_a_power, filters: *throttle_avg }
- { platform: copy, name: "Phase B Power", source_id: phase_b_power, filters: *throttle_avg }
- { platform: copy, name: "Total Power", source_id: total_power, filters: *throttle_avg }
- { platform: copy, name: "Balance Power", source_id: balance_power, filters: *throttle_avg }
- { platform: copy, name: "Circuit 1 Power", source_id: cir1, filters: *throttle_avg }
- { platform: copy, name: "Circuit 2 Power", source_id: cir2, filters: *throttle_avg }
- { platform: copy, name: "Circuit 3 Power", source_id: cir3, filters: *throttle_avg }
- { platform: copy, name: "Circuit 4 Power", source_id: cir4, filters: *throttle_avg }
- { platform: copy, name: "Circuit 5 Power", source_id: cir5, filters: *throttle_avg }
- { platform: copy, name: "Circuit 6 Power", source_id: cir6, filters: *throttle_avg }
- { platform: copy, name: "Circuit 7 Power", source_id: cir7, filters: *throttle_avg }
- { platform: copy, name: "Circuit 8 Power", source_id: cir8, filters: *throttle_avg }
- { platform: copy, name: "Circuit 9 Power", source_id: cir9, filters: *throttle_avg }
- { platform: copy, name: "Circuit 10 Power", source_id: cir10, filters: *throttle_avg }
- { platform: copy, name: "Circuit 11 Power", source_id: cir11, filters: *throttle_avg }
- { platform: copy, name: "Circuit 12 Power", source_id: cir12, filters: *throttle_avg }
- { platform: copy, name: "Circuit 13 Power", source_id: cir13, filters: *throttle_avg }
- { platform: copy, name: "Circuit 14 Power", source_id: cir14, filters: *throttle_avg }
- { platform: copy, name: "Circuit 15 Power", source_id: cir15, filters: *throttle_avg }
- { platform: copy, name: "Circuit 16 Power", source_id: cir16, filters: *throttle_avg }
- platform: template
lambda: return id(phase_a_power).state + id(phase_b_power).state;
update_interval: never # will be updated after all power sensors update via on_update trigger
id: total_power
device_class: power
state_class: measurement
unit_of_measurement: "W"
- platform: total_daily_energy
name: "Total Daily Energy"
power_id: total_power
accuracy_decimals: 0
restore: false
filters: *throttle_time
- platform: template
lambda: !lambda |-
return max(0.0f, id(total_power).state -
id( cir1).state -
id( cir2).state -
id( cir3).state -
id( cir4).state -
id( cir5).state -
id( cir6).state -
id( cir7).state -
id( cir8).state -
id( cir9).state -
id(cir10).state -
id(cir11).state -
id(cir12).state -
id(cir13).state -
id(cir14).state -
id(cir15).state -
id(cir16).state);
update_interval: never # will be updated after all power sensors update via on_update trigger
id: balance_power
device_class: power
state_class: measurement
unit_of_measurement: "W"
- platform: total_daily_energy
name: "Balance Daily Energy"
power_id: balance_power
accuracy_decimals: 0
restore: false
filters: *throttle_time
- { power_id: cir1, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 1 Daily Energy", filters: *throttle_time }
- { power_id: cir2, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 2 Daily Energy", filters: *throttle_time }
- { power_id: cir3, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 3 Daily Energy", filters: *throttle_time }
- { power_id: cir4, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 4 Daily Energy", filters: *throttle_time }
- { power_id: cir5, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 5 Daily Energy", filters: *throttle_time }
- { power_id: cir6, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 6 Daily Energy", filters: *throttle_time }
- { power_id: cir7, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 7 Daily Energy", filters: *throttle_time }
- { power_id: cir8, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 8 Daily Energy", filters: *throttle_time }
- { power_id: cir9, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 9 Daily Energy", filters: *throttle_time }
- { power_id: cir10, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 10 Daily Energy", filters: *throttle_time }
- { power_id: cir11, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 11 Daily Energy", filters: *throttle_time }
- { power_id: cir12, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 12 Daily Energy", filters: *throttle_time }
- { power_id: cir13, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 13 Daily Energy", filters: *throttle_time }
- { power_id: cir14, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 14 Daily Energy", filters: *throttle_time }
- { power_id: cir15, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 15 Daily Energy", filters: *throttle_time }
- { power_id: cir16, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 16 Daily Energy", filters: *throttle_time }
Any help is really appreciated! I am truly lost at what could be happening.

