Skip to content

Commit e0535bd

Browse files
committed
Add 3 phase basic emporia vue
1 parent e8344e1 commit e0535bd

File tree

3 files changed

+166
-1
lines changed

3 files changed

+166
-1
lines changed

.github/workflows/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- sonoff-th16-si7021.yaml
2626
- shelly-uni-doorbell.yaml
2727
- emporia-vue2.yaml
28+
- emporia-vue2-3-phase.yaml
2829
steps:
2930
- name: Checkout source code
3031
uses: actions/checkout@v2

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ jobs:
1010
uses: cpyarger/esphome-templates/.github/workflows/do_publish.yml@main
1111
with:
1212
# CHANGEME: Set the filenames of your config files here:
13-
files: esp32-gateway-ethernet.yaml,esp32-gateway-wifi.yaml,shelly-1.yaml,sonoff-basic.yaml,sonoff-ifan04-l.yaml,sonoff-rfbridge.yaml,sonoff-tx-t1.yaml,sonoff-tx-t2.yaml,sonoff-tx-t3.yaml,sp501e.yaml,ttgo-higrow-stick.yaml,wyze-plug.yaml,sonoff-th16-si7021.yaml,shelly-uni-doorbell.yaml,emporia-vue2.yaml
13+
files: esp32-gateway-ethernet.yaml,esp32-gateway-wifi.yaml,shelly-1.yaml,sonoff-basic.yaml,sonoff-ifan04-l.yaml,sonoff-rfbridge.yaml,sonoff-tx-t1.yaml,sonoff-tx-t2.yaml,sonoff-tx-t3.yaml,sp501e.yaml,ttgo-higrow-stick.yaml,wyze-plug.yaml,sonoff-th16-si7021.yaml,shelly-uni-doorbell.yaml,emporia-vue2.yaml,emporia-vue2-3-phase.yaml

emporia-vue2-3-phase.yaml

+164
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
substitutions:
2+
name: emporia-vue2
3+
friendly_name: Emporia Vue2
4+
esphome:
5+
name: $name
6+
comment: Emporia Vue 2
7+
name_add_mac_suffix: true
8+
# This will allow for (future) project identification,
9+
# configuration and updates.
10+
project:
11+
name: cpyarger.emporia-vue2
12+
version: "1.0"
13+
14+
logger:
15+
16+
external_components:
17+
- source: github://flaviut/esphome@emporia-vue-2022.4.0
18+
components: [ emporia_vue ]
19+
dashboard_import:
20+
package_import_url: github://cpyarger/esphome-templates/emporia-vue2.yaml@main
21+
22+
esp32:
23+
board: esp32dev
24+
framework:
25+
type: esp-idf
26+
version: recommended
27+
28+
# Enable Home Assistant API
29+
wifi:
30+
# Set up a wifi access point
31+
ap:
32+
password: "12345678"
33+
# Sets up the improv via serial client for Wi-Fi provisioning
34+
improv_serial:
35+
# In combination with the `ap` this allows the user
36+
# to provision wifi credentials to the device.
37+
ota:
38+
api:
39+
# Sets up Bluetooth LE (Only on ESP32) to allow the user
40+
# to provision wifi credentials to the device.
41+
esp32_improv:
42+
authorizer: none
43+
44+
i2c:
45+
sda: 21
46+
scl: 22
47+
scan: false
48+
frequency: 200kHz # recommended range is 50-200kHz
49+
id: i2c_a
50+
time:
51+
- platform: sntp
52+
id: my_time
53+
54+
# these are called references in YAML. They allow you to reuse
55+
# this configuration in each sensor, while only defining it once
56+
.defaultfilters:
57+
- &moving_avg
58+
# we capture a new sample every 0.24 seconds, so the time can
59+
# be calculated from the number of samples as n * 0.24.
60+
sliding_window_moving_average:
61+
# we average over the past 2.88 seconds
62+
window_size: 12
63+
# we push a new value every 1.44 seconds
64+
send_every: 6
65+
- &invert
66+
# invert and filter out any values below 0.
67+
lambda: 'return max(-x, 0.0f);'
68+
- &pos
69+
# filter out any values below 0.
70+
lambda: 'return max(x, 0.0f);'
71+
- &abs
72+
# take the absolute value of the value
73+
lambda: 'return abs(x);'
74+
75+
sensor:
76+
- platform: emporia_vue
77+
i2c_id: i2c_a
78+
phases:
79+
- id: phase_a # Verify that this specific phase/leg is connected to correct input wire color on device listed below
80+
input: BLACK # Vue device wire color
81+
calibration: 0.022 # 0.022 is used as the default as starting point but may need adjusted to ensure accuracy
82+
# To calculate new calibration value use the formula <in-use calibration value> * <accurate voltage> / <reporting voltage>
83+
voltage:
84+
name: "Phase A Voltage"
85+
filters: [*moving_avg, *pos]
86+
- id: phase_b # Verify that this specific phase/leg is connected to correct input wire color on device listed below
87+
input: RED # Vue device wire color
88+
calibration: 0.022 # 0.022 is used as the default as starting point but may need adjusted to ensure accuracy
89+
# To calculate new calibration value use the formula <in-use calibration value> * <accurate voltage> / <reporting voltage>
90+
voltage:
91+
name: "Phase B Voltage"
92+
filters: [*moving_avg, *pos]
93+
- id: phase_c # Verify that this specific phase/leg is connected to correct input wire color on device listed below
94+
input: BLUE # Vue device wire color
95+
calibration: 0.022 # 0.022 is used as the default as starting point but may need adjusted to ensure accuracy
96+
# To calculate new calibration value use the formula <in-use calibration value> * <accurate voltage> / <reporting voltage>
97+
voltage:
98+
name: "Phase C Voltage"
99+
filters: [*moving_avg, *pos]
100+
ct_clamps:
101+
- phase_id: phase_a
102+
input: "A" # Verify the CT going to this device input also matches the phase/leg
103+
power:
104+
name: "Phase A Power"
105+
id: phase_a_power
106+
device_class: power
107+
filters: [*moving_avg, *pos]
108+
- phase_id: phase_b
109+
input: "B" # Verify the CT going to this device input also matches the phase/leg
110+
power:
111+
name: "Phase B Power"
112+
id: phase_b_power
113+
device_class: power
114+
filters: [*moving_avg, *pos]
115+
- phase_id: phase_c
116+
input: "C" # Verify the CT going to this device input also matches the phase/leg
117+
power:
118+
name: "Phase C Power"
119+
id: phase_c_power
120+
device_class: power
121+
filters: [*moving_avg, *pos]
122+
# Pay close attention to set the phase_id for each breaker by matching it to the phase/leg it connects to in the panel
123+
- { phase_id: phase_a, input: "1", power: { name: "Circuit 1 Power", id: cir1, filters: [ *moving_avg, *pos ] } }
124+
- { phase_id: phase_b, input: "2", power: { name: "Circuit 2 Power", id: cir2, filters: [ *moving_avg, *pos ] } }
125+
- { phase_id: phase_a, input: "3", power: { name: "Circuit 3 Power", id: cir3, filters: [ *moving_avg, *pos ] } }
126+
- { phase_id: phase_a, input: "4", power: { name: "Circuit 4 Power", id: cir4, filters: [ *moving_avg, *pos ] } }
127+
- { phase_id: phase_a, input: "5", power: { name: "Circuit 5 Power", id: cir5, filters: [ *moving_avg, *pos ] } }
128+
- { phase_id: phase_a, input: "6", power: { name: "Circuit 6 Power", id: cir6, filters: [ *moving_avg, *pos ] } }
129+
- { phase_id: phase_a, input: "7", power: { name: "Circuit 7 Power", id: cir7, filters: [ *moving_avg, *pos ] } }
130+
- { phase_id: phase_b, input: "8", power: { name: "Circuit 8 Power", id: cir8, filters: [ *moving_avg, *pos ] } }
131+
- { phase_id: phase_b, input: "9", power: { name: "Circuit 9 Power", id: cir9, filters: [ *moving_avg, *pos ] } }
132+
- { phase_id: phase_b, input: "10", power: { name: "Circuit 10 Power", id: cir10, filters: [ *moving_avg, *pos ] } }
133+
- { phase_id: phase_a, input: "11", power: { name: "Circuit 11 Power", id: cir11, filters: [ *moving_avg, *pos ] } }
134+
- { phase_id: phase_a, input: "12", power: { name: "Circuit 12 Power", id: cir12, filters: [ *moving_avg, *pos ] } }
135+
- { phase_id: phase_a, input: "13", power: { name: "Circuit 13 Power", id: cir13, filters: [ *moving_avg, *pos ] } }
136+
- { phase_id: phase_a, input: "14", power: { name: "Circuit 14 Power", id: cir14, filters: [ *moving_avg, *pos ] } }
137+
- { phase_id: phase_b, input: "15", power: { name: "Circuit 15 Power", id: cir15, filters: [ *moving_avg, *pos ] } }
138+
- { phase_id: phase_a, input: "16", power: { name: "Circuit 16 Power", id: cir16, filters: [ *moving_avg, *pos ] } }
139+
- platform: template
140+
name: "Total Power"
141+
lambda: return id(phase_a_power).state + id(phase_b_power).state + id(phase_c_power).state;
142+
update_interval: 1s
143+
id: total_power
144+
unit_of_measurement: "W"
145+
- platform: total_daily_energy
146+
name: "Total Daily Energy"
147+
power_id: total_power
148+
accuracy_decimals: 0
149+
- { power_id: cir1, platform: total_daily_energy, accuracy_decimals: 0, name: "Circuit 1 Daily Energy" }
150+
- { power_id: cir2, platform: total_daily_energy, accuracy_decimals: 0, name: "Circuit 2 Daily Energy" }
151+
- { power_id: cir3, platform: total_daily_energy, accuracy_decimals: 0, name: "Circuit 3 Daily Energy" }
152+
- { power_id: cir4, platform: total_daily_energy, accuracy_decimals: 0, name: "Circuit 4 Daily Energy" }
153+
- { power_id: cir5, platform: total_daily_energy, accuracy_decimals: 0, name: "Circuit 5 Daily Energy" }
154+
- { power_id: cir6, platform: total_daily_energy, accuracy_decimals: 0, name: "Circuit 6 Daily Energy" }
155+
- { power_id: cir7, platform: total_daily_energy, accuracy_decimals: 0, name: "Circuit 7 Daily Energy" }
156+
- { power_id: cir8, platform: total_daily_energy, accuracy_decimals: 0, name: "Circuit 8 Daily Energy" }
157+
- { power_id: cir9, platform: total_daily_energy, accuracy_decimals: 0, name: "Circuit 9 Daily Energy" }
158+
- { power_id: cir10, platform: total_daily_energy, accuracy_decimals: 0, name: "Circuit 10 Daily Energy" }
159+
- { power_id: cir11, platform: total_daily_energy, accuracy_decimals: 0, name: "Circuit 11 Daily Energy" }
160+
- { power_id: cir12, platform: total_daily_energy, accuracy_decimals: 0, name: "Circuit 12 Daily Energy" }
161+
- { power_id: cir13, platform: total_daily_energy, accuracy_decimals: 0, name: "Circuit 13 Daily Energy" }
162+
- { power_id: cir14, platform: total_daily_energy, accuracy_decimals: 0, name: "Circuit 14 Daily Energy" }
163+
- { power_id: cir15, platform: total_daily_energy, accuracy_decimals: 0, name: "Circuit 15 Daily Energy" }
164+
- { power_id: cir16, platform: total_daily_energy, accuracy_decimals: 0, name: "Circuit 16 Daily Energy" }

0 commit comments

Comments
 (0)