Skip to content

Instantly share code, notes, and snippets.

@clintkev251
Created November 27, 2025 17:06
Show Gist options
  • Select an option

  • Save clintkev251/7d827c1fde3c08d7b2bff4df4dd2ab12 to your computer and use it in GitHub Desktop.

Select an option

Save clintkev251/7d827c1fde3c08d7b2bff4df4dd2ab12 to your computer and use it in GitHub Desktop.
sensor:
- platform: emporia_vue
i2c_id: i2c_a
phases:
- id: phase_b # 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.022 # 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: [*moving_avg, *pos]
frequency:
name: "Phase A Frequency"
filters: [*moving_avg, *pos]
- id: phase_a # 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.022 # 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: [*moving_avg, *pos]
phase_angle:
name: "Phase B Phase Angle"
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: "Phase A Power"
id: phase_a_power
device_class: power
filters: [*moving_avg]
- phase_id: phase_b
input: "B" # Verify the CT going to this device input also matches the phase/leg
power:
name: "Phase B Power"
id: phase_b_power
device_class: power
filters: [*moving_avg]
# 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_b, input: "1", power: { name: "Zone 1 AC Power", id: cir1, filters: [ *moving_avg, *pos, multiply: 2 ] } }
- { phase_id: phase_b, input: "2", power: { name: "Zone 2 AC Power", id: cir2, filters: [ *moving_avg, *pos, multiply: 2 ] } }
- { phase_id: phase_b, input: "3", power: { name: "Dryer Power", id: cir3, filters: [ *moving_avg, *pos, multiply: 2 ] } }
- { phase_id: phase_b, input: "4", power: { name: "Kitchen Outlets Power", id: cir4, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "5", power: { name: "Dishwasher Power", id: cir5, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_b, input: "6", power: { name: "Office Power", id: cir6, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_b, input: "7", power: { name: "Garage Power", id: cir7, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "8", power: { name: "Solar Power A", id: cir8, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_a, input: "9", power: { name: "Loft Power", id: cir9, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_b, input: "10", power: { name: "Basement Power", id: cir10, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_b, input: "11", power: { name: "Refrigerator Power", id: cir11, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_b, input: "12", power: { name: "Zone 1 Furnace/Water SoftenerPower", id: cir12, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_b, input: "13", power: { name: "Solar Power B", id: cir13, filters: [ *moving_avg, *pos ] } }
- { phase_id: phase_b, input: "14", power: { name: "Zone 2 Furnace Power", id: cir14, filters: [ *moving_avg, *pos, multiply: 2 ] } }
- { phase_id: phase_b, input: "15", power: { name: "Oven Power", id: cir15, filters: [ *moving_avg, *pos, multiply: 2 ] } }
- { phase_id: phase_b, input: "16", power: { name: "EVSE Power", id: cir16, filters: [ *moving_avg, *pos, multiply: 2 ] } }
- platform: template
name: "Grid Power"
lambda: return id(phase_a_power).state + id(phase_b_power).state;
update_interval: 1s
id: total_power
unit_of_measurement: "W"
- platform: template
name: "Solar Power"
lambda: |
if((id(cir8).state + id(cir13).state) < 10){
return 0;
} else{
return id(cir8).state + id(cir13).state;
}
update_interval: 1s
id: solar_power
unit_of_measurement: "W"
# - platform: template
# name: "Solar Power Test"
# lambda: |
# if((id(cir8).state + id(cir13).state) < 10){
# return 0;
# } else{
# return id(cir8).state + id(cir13).state;
# }
# update_interval: 1s
# id: solar_power_test
# unit_of_measurement: "W"
- platform: total_daily_energy
name: "Solar Daily Energy"
power_id: solar_power
accuracy_decimals: 0
- platform: total_daily_energy
name: "Grid Daily Energy"
power_id: total_power
accuracy_decimals: 0
state_class: total
- { power_id: cir1, platform: total_daily_energy, accuracy_decimals: 0, name: "Zone 1 AC Daily Energy" }
- { power_id: cir2, platform: total_daily_energy, accuracy_decimals: 0, name: "Zone 2 AC Daily Energy" }
- { power_id: cir3, platform: total_daily_energy, accuracy_decimals: 0, name: "Dryer Daily Energy" }
- { power_id: cir4, platform: total_daily_energy, accuracy_decimals: 0, name: "Kitchen Outlets Daily Energy" }
- { power_id: cir5, platform: total_daily_energy, accuracy_decimals: 0, name: "Dishwasher Daily Energy" }
- { power_id: cir6, platform: total_daily_energy, accuracy_decimals: 0, name: "Office Daily Energy" }
- { power_id: cir7, platform: total_daily_energy, accuracy_decimals: 0, name: "Garage Daily Energy" }
- { power_id: cir9, platform: total_daily_energy, accuracy_decimals: 0, name: "Loft Daily Energy" }
- { power_id: cir10, platform: total_daily_energy, accuracy_decimals: 0, name: "Basement Daily Energy" }
- { power_id: cir11, platform: total_daily_energy, accuracy_decimals: 0, name: "Refrigerator Daily Energy" }
- { power_id: cir12, platform: total_daily_energy, accuracy_decimals: 0, name: "Zone 1 Furnace/Water Softener Daily Energy" }
- { power_id: cir14, platform: total_daily_energy, accuracy_decimals: 0, name: "Zone 2 Furnace Daily Energy" }
- { power_id: cir15, platform: total_daily_energy, accuracy_decimals: 0, name: "Oven Daily Energy" }
- { power_id: cir16, platform: total_daily_energy, accuracy_decimals: 0, name: "EVSE Daily Energy" }
- platform: integration
name: "Running Energy"
sensor: total_power
integration_method: right
time_unit: h
- platform: integration
name: "Running Solar Energy"
sensor: solar_power
integration_method: right
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment