I’ve reflashed emporia according to this howto Setting up Emporia Vue 2 with ESPHome · GitHub
It disconnects with following error:
INFO energy-monitor.local: Error while reading incoming messages: Error while reading data: 0 bytes read on a total of 1 expected bytes
INFO Disconnected from ESPHome API for energy-monitor.local
WARNING Disconnected from API
INFO energy-monitor.local: Ping Failed: Error while reading data: 0 bytes read on a total of 1 expected bytes
INFO Successfully connected to energy-monitor.local
ESPHome version 2022.6.2
My configuration:
substitutions:
devicename: "energy-monitor"
upper_devicename: "emporiavue2"
wifi_ssid: !secret iot_wifi_ssid
wifi_pass: !secret iot_wifi_password
fallback_pass: !secret fallback_wifi_password
api_pass: !secret esp_api_password
ota_pass: !secret esp_ota_password
webserver_username: !secret webserver_username
webserver_password: !secret webserver_password
# phase a connected to main leat L1 load closet
name_a_power: "Grid Power"
name_a_voltage: "Grid Voltage"
name_total_a_power: "Total Power Grid"
name_total_a_energy: "Total Daily Energy Grid"
# phase b connected to main lead N direction load N
name_b_power: "Neutral Power"
name_b_voltage: "Neutral Voltage"
name_total_b_power: "Total Power Neutral"
name_total_b_energy: "Total Daily Energy Neutral"
# phase c connected main lead to earth direction load earth
name_c_power: "PE Power"
name_c_voltage: "PE Voltage"
name_total_c_power: "Total Power PE"
name_total_c_energy: "Total Daily Energy PE"
# individual circuits
name_circuit01: "Circuit 1"
name_circuit02: "Circuit 2"
name_circuit03: "Circuit 3"
name_circuit04: "Circuit 4"
name_circuit05: "Circuit 5"
name_circuit06: "Circuit 6"
name_circuit07: "Circuit 7"
name_circuit08: "Circuit 8"
name_circuit09: "Circuit 9"
name_circuit10: "Circuit 10"
name_circuit11: "Circuit 11"
name_circuit12: "Circuit 12"
name_circuit13: "Circuit 13"
name_circuit14: "Circuit 14"
name_circuit15: "Circuit 15"
name_circuit16: "Circuit 16"
esphome:
name: $devicename
external_components:
- source: github://flaviut/[email protected]
components: [ emporia_vue ]
esp32:
board: esp32dev
framework:
type: esp-idf
version: recommended
# Enable Home Assistant API
api:
password: "${api_pass}"
# Enable over the air updates
ota:
password: "${ota_pass}"
# Enable logging
logger:
wifi:
ssid: "${wifi_ssid}"
password: "${wifi_pass}"
i2c:
sda: 21
scl: 22
scan: false
frequency: 200kHz # recommended range is 50-200kHz
id: i2c_a
time:
- platform: sntp
timezone: 'CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00'
id: my_time
servers:
- 162.159.200.123
- 195.13.23.5
- 195.13.1.153
on_time_sync:
then:
- logger.log: "Synchronized system clock"
# these are called references in YAML. They allow you to reuse
# this configuration in each sensor, while only defining it once
.defaultfilters:
- &moving_avg
# we capture a new sample every 0.24 seconds, so the time can
# be calculated from the number of samples as n * 0.24.
sliding_window_moving_average:
# we average over the past 2.88 seconds
window_size: 12
# we push a new value every 1.44 seconds
send_every: 6
- &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.02260 # 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: $name_a_voltage
filters: [*moving_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.02260 # 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: $name_b_voltage
filters: [*moving_avg, *pos]
- id: phase_c # Verify that this specific phase/leg is connected to correct input wire color on device listed below
input: BLUE # Vue device wire color
calibration: 0.02260 # 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: $name_c_voltage
filters: [*moving_avg, *pos]
ct_clamps:
- phase_id: phase_a
input: "A" # Verify the CT going to this device input also matches the phase/leg
power:
name: $name_a_power
id: phase_a_power
device_class: power
filters: [*moving_avg, *pos]
- phase_id: phase_b
input: "B" # Verify the CT going to this device input also matches the phase/leg
power:
name: $name_b_power
id: phase_b_power
device_class: power
filters: [*moving_avg, *pos]
- phase_id: phase_c
input: "C" # Verify the CT going to this device input also matches the phase/leg
power:
name: $name_c_power
id: phase_c_power
device_class: power
filters: [*moving_avg, *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: { name: $name_circuit01, internal: true, id: power_cir01, device_class: power, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "2", power: { name: $name_circuit02, internal: true, id: power_cir02, device_class: power, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "3", power: { name: $name_circuit03, internal: true, id: power_cir03, device_class: power, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "4", power: { name: $name_circuit04, internal: true, id: power_cir04, device_class: power, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "5", power: { name: $name_circuit05, internal: true, id: power_cir05, device_class: power, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "6", power: { name: $name_circuit06, internal: true, id: power_cir06, device_class: power, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "7", power: { name: $name_circuit07, internal: true, id: power_cir07, device_class: power, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "8", power: { name: $name_circuit08, internal: true, id: power_cir08, device_class: power, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "9", power: { name: $name_circuit09, internal: true, id: power_cir09, device_class: power, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "10", power: { name: $name_circuit10, internal: true, id: power_cir10, device_class: power, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "11", power: { name: $name_circuit11, internal: true, id: power_cir11, device_class: power, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "12", power: { name: $name_circuit12, internal: true, id: power_cir12, device_class: power, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "13", power: { name: $name_circuit13, internal: true, id: power_cir13, device_class: power, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "14", power: { name: $name_circuit14, internal: true, id: power_cir14, device_class: power, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "15", power: { name: $name_circuit15, internal: true, id: power_cir15, device_class: power, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "16", power: { name: $name_circuit16, internal: true, id: power_cir16, device_class: power, filters: [ *moving_avg, *pos ] } }
- platform: template
name: "${name_circuit01} in W"
lambda: return id(power_cir01).state;
update_interval: 1s
id: total_cir01
unit_of_measurement: "W"
icon: mdi:gauge
- platform: template
name: "${name_circuit02} in W"
lambda: return id(power_cir02).state;
update_interval: 1s
id: total_cir02
unit_of_measurement: "W"
icon: mdi:gauge
- platform: template
name: "${name_circuit03} in W"
lambda: return id(power_cir03).state;
update_interval: 1s
id: total_cir03
unit_of_measurement: "W"
icon: mdi:gauge
- platform: template
name: "${name_circuit04} in W"
lambda: return id(power_cir04).state;
update_interval: 1s
id: total_cir04
unit_of_measurement: "W"
icon: mdi:gauge
- platform: template
name: "${name_circuit05} in W"
lambda: return id(power_cir05).state;
update_interval: 1s
id: total_cir05
unit_of_measurement: "W"
icon: mdi:gauge
- platform: template
name: "${name_circuit06} in W"
lambda: return id(power_cir06).state;
update_interval: 1s
id: total_cir06
unit_of_measurement: "W"
icon: mdi:gauge
- platform: template
name: "${name_circuit07} in W"
lambda: return id(power_cir07).state;
update_interval: 1s
id: total_cir07
unit_of_measurement: "W"
icon: mdi:gauge
- platform: template
name: "${name_circuit08} in W"
lambda: return id(power_cir08).state;
update_interval: 1s
id: total_cir08
unit_of_measurement: "W"
icon: mdi:gauge
- platform: template
name: "${name_circuit09} in W"
lambda: return id(power_cir09).state;
update_interval: 1s
id: total_cir09
unit_of_measurement: "W"
icon: mdi:gauge
- platform: template
name: "${name_circuit10} in W"
lambda: return id(power_cir10).state;
update_interval: 1s
id: total_cir10
unit_of_measurement: "W"
icon: mdi:gauge
- platform: template
name: "${name_circuit11} in W"
lambda: return id(power_cir11).state;
update_interval: 1s
id: total_cir11
unit_of_measurement: "W"
icon: mdi:gauge
- platform: template
name: "${name_circuit12} in W"
lambda: return id(power_cir12).state;
update_interval: 1s
id: total_cir12
unit_of_measurement: "W"
icon: mdi:gauge
- platform: template
name: "${name_circuit13} in W"
lambda: return id(power_cir13).state;
update_interval: 1s
id: total_cir13
unit_of_measurement: "W"
icon: mdi:gauge
- platform: template
name: "${name_circuit14} in W"
lambda: return id(power_cir14).state;
update_interval: 1s
id: total_cir14
unit_of_measurement: "W"
icon: mdi:gauge
- platform: template
name: "${name_circuit15} in W"
lambda: return id(power_cir15).state;
update_interval: 1s
id: total_cir15
unit_of_measurement: "W"
icon: mdi:gauge
- platform: template
name: "${name_circuit16} in W"
lambda: return id(power_cir16).state;
update_interval: 1s
id: total_cir16
unit_of_measurement: "W"
icon: mdi:gauge
# phase A
- platform: template
name: $name_total_a_power
lambda: return id(phase_a_power).state;
update_interval: 1s
id: total_power_a
unit_of_measurement: "W"
icon: mdi:gauge
- platform: total_daily_energy
name: $name_total_a_energy
power_id: total_power_a
accuracy_decimals: 0
icon: mdi:gauge
# phase B
- platform: template
name: $name_total_b_power
lambda: return id(phase_b_power).state;
update_interval: 1s
id: total_power_b
unit_of_measurement: "W"
icon: mdi:gauge
- platform: total_daily_energy
name: $name_total_b_energy
power_id: total_power_b
accuracy_decimals: 0
icon: mdi:gauge
# phase C
- platform: template
name: $name_total_c_power
lambda: return id(phase_c_power).state;
update_interval: 1s
id: total_power_c
unit_of_measurement: "W"
icon: mdi:gauge
- platform: total_daily_energy
name: $name_total_c_energy
power_id: total_power_c
accuracy_decimals: 0
icon: mdi:gauge
- { power_id: total_cir01, platform: total_daily_energy, accuracy_decimals: 1, name: "${name_circuit01} in Wh", unit_of_measurement: "Wh", icon: mdi:calendar-clock }
- { power_id: total_cir02, platform: total_daily_energy, accuracy_decimals: 1, name: "${name_circuit02} in Wh", unit_of_measurement: "Wh", icon: mdi:calendar-clock }
- { power_id: total_cir03, platform: total_daily_energy, accuracy_decimals: 1, name: "${name_circuit03} in Wh", unit_of_measurement: "Wh", icon: mdi:calendar-clock }
- { power_id: total_cir04, platform: total_daily_energy, accuracy_decimals: 1, name: "${name_circuit04} in Wh", unit_of_measurement: "Wh", icon: mdi:calendar-clock }
- { power_id: total_cir05, platform: total_daily_energy, accuracy_decimals: 1, name: "${name_circuit05} in Wh", unit_of_measurement: "Wh", icon: mdi:calendar-clock }
- { power_id: total_cir06, platform: total_daily_energy, accuracy_decimals: 1, name: "${name_circuit06} in Wh", unit_of_measurement: "Wh", icon: mdi:calendar-clock }
- { power_id: total_cir07, platform: total_daily_energy, accuracy_decimals: 1, name: "${name_circuit07} in Wh", unit_of_measurement: "Wh", icon: mdi:calendar-clock }
- { power_id: total_cir08, platform: total_daily_energy, accuracy_decimals: 1, name: "${name_circuit08} in Wh", unit_of_measurement: "Wh", icon: mdi:calendar-clock }
- { power_id: total_cir09, platform: total_daily_energy, accuracy_decimals: 1, name: "${name_circuit09} in Wh", unit_of_measurement: "Wh", icon: mdi:calendar-clock }
- { power_id: total_cir10, platform: total_daily_energy, accuracy_decimals: 1, name: "${name_circuit10} in Wh", unit_of_measurement: "Wh", icon: mdi:calendar-clock }
- { power_id: total_cir11, platform: total_daily_energy, accuracy_decimals: 1, name: "${name_circuit11} in Wh", unit_of_measurement: "Wh", icon: mdi:calendar-clock }
- { power_id: total_cir12, platform: total_daily_energy, accuracy_decimals: 1, name: "${name_circuit12} in Wh", unit_of_measurement: "Wh", icon: mdi:calendar-clock }
- { power_id: total_cir13, platform: total_daily_energy, accuracy_decimals: 1, name: "${name_circuit13} in Wh", unit_of_measurement: "Wh", icon: mdi:calendar-clock }
- { power_id: total_cir14, platform: total_daily_energy, accuracy_decimals: 1, name: "${name_circuit14} in Wh", unit_of_measurement: "Wh", icon: mdi:calendar-clock }
- { power_id: total_cir15, platform: total_daily_energy, accuracy_decimals: 1, name: "${name_circuit15} in Wh", unit_of_measurement: "Wh", icon: mdi:calendar-clock }
- { power_id: total_cir16, platform: total_daily_energy, accuracy_decimals: 1, name: "${name_circuit16} in Wh", unit_of_measurement: "Wh", icon: mdi:calendar-clock }
- { power_id: total_cir01, platform: total_daily_energy, accuracy_decimals: 3, name: "${name_circuit01} in kWh", unit_of_measurement: "kWh", filters: [multiply: 0.001], icon: mdi:calendar-clock }
- { power_id: total_cir02, platform: total_daily_energy, accuracy_decimals: 3, name: "${name_circuit02} in kWh", unit_of_measurement: "kWh", filters: [multiply: 0.001], icon: mdi:calendar-clock }
- { power_id: total_cir03, platform: total_daily_energy, accuracy_decimals: 3, name: "${name_circuit03} in kWh", unit_of_measurement: "kWh", filters: [multiply: 0.001], icon: mdi:calendar-clock }
- { power_id: total_cir04, platform: total_daily_energy, accuracy_decimals: 3, name: "${name_circuit04} in kWh", unit_of_measurement: "kWh", filters: [multiply: 0.001], icon: mdi:calendar-clock }
- { power_id: total_cir05, platform: total_daily_energy, accuracy_decimals: 3, name: "${name_circuit05} in kWh", unit_of_measurement: "kWh", filters: [multiply: 0.001], icon: mdi:calendar-clock }
- { power_id: total_cir06, platform: total_daily_energy, accuracy_decimals: 3, name: "${name_circuit06} in kWh", unit_of_measurement: "kWh", filters: [multiply: 0.001], icon: mdi:calendar-clock }
- { power_id: total_cir07, platform: total_daily_energy, accuracy_decimals: 3, name: "${name_circuit07} in kWh", unit_of_measurement: "kWh", filters: [multiply: 0.001], icon: mdi:calendar-clock }
- { power_id: total_cir08, platform: total_daily_energy, accuracy_decimals: 3, name: "${name_circuit08} in kWh", unit_of_measurement: "kWh", filters: [multiply: 0.001], icon: mdi:calendar-clock }
- { power_id: total_cir09, platform: total_daily_energy, accuracy_decimals: 3, name: "${name_circuit09} in kWh", unit_of_measurement: "kWh", filters: [multiply: 0.001], icon: mdi:calendar-clock }
- { power_id: total_cir10, platform: total_daily_energy, accuracy_decimals: 3, name: "${name_circuit10} in kWh", unit_of_measurement: "kWh", filters: [multiply: 0.001], icon: mdi:calendar-clock }
- { power_id: total_cir11, platform: total_daily_energy, accuracy_decimals: 3, name: "${name_circuit11} in kWh", unit_of_measurement: "kWh", filters: [multiply: 0.001], icon: mdi:calendar-clock }
- { power_id: total_cir12, platform: total_daily_energy, accuracy_decimals: 3, name: "${name_circuit12} in kWh", unit_of_measurement: "kWh", filters: [multiply: 0.001], icon: mdi:calendar-clock }
- { power_id: total_cir13, platform: total_daily_energy, accuracy_decimals: 3, name: "${name_circuit13} in kWh", unit_of_measurement: "kWh", filters: [multiply: 0.001], icon: mdi:calendar-clock }
- { power_id: total_cir14, platform: total_daily_energy, accuracy_decimals: 3, name: "${name_circuit14} in kWh", unit_of_measurement: "kWh", filters: [multiply: 0.001], icon: mdi:calendar-clock }
- { power_id: total_cir15, platform: total_daily_energy, accuracy_decimals: 3, name: "${name_circuit15} in kWh", unit_of_measurement: "kWh", filters: [multiply: 0.001], icon: mdi:calendar-clock }
- { power_id: total_cir16, platform: total_daily_energy, accuracy_decimals: 3, name: "${name_circuit16} in kWh", unit_of_measurement: "kWh", filters: [multiply: 0.001], icon: mdi:calendar-clock }
Also connected to see if there was more information on the console but there was even less, on the console I wouldn’t be able to tell that it reconnected.