Skip to content

Instantly share code, notes, and snippets.

@patrickdk77
Created August 6, 2021 21:40
Show Gist options
  • Save patrickdk77/90c502a6ddef4d83372208b6a89c7caf to your computer and use it in GitHub Desktop.
Save patrickdk77/90c502a6ddef4d83372208b6a89c7caf to your computer and use it in GitHub Desktop.
substitutions:
# Change the disp_name to something you want
disp_name: Energy_Monitor
name: panelmonitor
tele: "${name}"
availability: "${name}/LWT"
heartbeat: 900s
# Interval of how often the power is updated
update_time: 10s
# Current Transformers:
# 20A/25mA SCT-006: 11143
# 30A/1V SCT-013-030: 8650
# 50A/1V SCT-013-050: 15420
# 80A/26.6mA SCT-010: 41660
# 100A/50ma SCT-013-000: 27518
# 120A/40mA: SCT-016: 41787
# 200A/100mA SCT-024: 27518
current_cal_sct_006: '11143'
current_cal_sct_013_030: '8650'
current_cal_sct_013_050: '15420'
current_cal_sct_010: '41660'
current_cal_sct_013_000v: '63452'
current_cal_sct_013_000: '2473'
current_cal_sct_016: '41368'
current_cal_sct_024: '27518'
# Jameco 9VAC Transformer:
# For meter versions:
# >= v1.3: 7305
# <= v1.2: 42620
voltage_cal: '7763'
voltage_cal240: '15525'
ct1_name: 'Upstairs AC'
ct1_delta: '10'
ct1_volt: "${voltage_cal240}"
ct1_clamp: "${current_cal_sct_013_050}"
ct2_name: 'Downstairs Airhandler'
ct2_delta: '10'
ct2_volt: "${voltage_cal240}"
ct2_clamp: "${current_cal_sct_013_000}"
ct3_name: 'Main A'
ct3_delta: '1'
ct3_volt: "${voltage_cal}"
ct3_clamp: "${current_cal_sct_016}"
ct4_name: 'Main B'
ct4_delta: '1'
ct4_volt: "${voltage_cal}"
ct4_clamp: "${current_cal_sct_016}"
ct5_name: 'Downstairs AC'
ct5_delta: '10'
ct5_volt: "${voltage_cal240}"
ct5_clamp: "${current_cal_sct_013_000v}"
ct6_name: 'Oven'
ct6_delta: '10'
ct6_volt: "${voltage_cal240}"
ct6_clamp: "${current_cal_sct_013_000v}"
ct7_name: 'Bed2 Bed3 Bath2'
ct7_delta: '10'
ct7_volt: "${voltage_cal}"
ct7_clamp: "${current_cal_sct_013_050}"
ct8_name: 'Masterbed'
ct8_delta: '10'
ct8_volt: "${voltage_cal}"
ct8_clamp: "${current_cal_sct_013_050}"
ct9_name: 'Livingroom'
ct9_delta: '10'
ct9_volt: "${voltage_cal}"
ct9_clamp: "${current_cal_sct_013_050}"
ct10_name: 'Kitchen2'
ct10_delta: '20'
ct10_volt: "${voltage_cal}"
ct10_clamp: "${current_cal_sct_013_050}"
ct11_name: 'Water Heater'
ct11_delta: '20'
ct11_volt: "${voltage_cal240}"
ct11_clamp: "${current_cal_sct_013_050}"
ct12_name: 'Upstairs Airhandler'
ct12_delta: '10'
ct12_volt: "${voltage_cal240}"
ct12_clamp: "${current_cal_sct_013_050}"
ct13_name: 'Entry Office'
ct13_delta: '10'
ct13_volt: "${voltage_cal}"
ct13_clamp: "${current_cal_sct_013_050}"
ct14_name: 'Kitchen1'
ct14_delta: '10'
ct14_volt: "${voltage_cal}"
ct14_clamp: "${current_cal_sct_013_050}"
ct15_name: 'Microwave'
ct15_delta: '10'
ct15_volt: "${voltage_cal}"
ct15_clamp: "${current_cal_sct_013_050}"
ct16_name: 'Loft Bath4'
ct16_delta: '10'
ct16_volt: "${voltage_cal}"
ct16_clamp: "${current_cal_sct_013_050}"
ct17_name: 'Garage Kitchen'
ct17_delta: '10'
ct17_volt: "${voltage_cal}"
ct17_clamp: "${current_cal_sct_013_050}"
ct18_name: 'Garage'
ct18_delta: '10'
ct18_volt: "${voltage_cal}"
ct18_clamp: "${current_cal_sct_013_050}"
esphome:
name: "${name}"
platform: ESP32
board: nodemcu-32s
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pass
fast_connect: off
manual_ip:
static_ip: !secret ip_panelmonitor
gateway: !secret ip_gateway
subnet: !secret ip_subnet
dns1: !secret ip_dns1
dns2: !secret ip_dns2
logger:
baud_rate: 0
# level: VERY_VERBOSE
#api:
ota:
mqtt:
id: mqttid
broker: !secret mqtt_broker
port: !secret mqtt_port
username: !secret mqtt_user
password: !secret mqtt_pass
discovery: true
discovery_retain: true
topic_prefix: "${tele}"
birth_message:
topic: "${availability}"
payload: "CONNECTED"
will_message:
topic: "${availability}"
payload: "DISCONNECTED"
shutdown_message:
topic: "${availability}"
payload: "DISCONNECTED"
# reboot_timeout: 0s
log_topic:
#web_server:
# port: 80
sun:
latitude: !secret latitude
longitude: !secret longitude
time:
- platform: sntp
timezone: !secret timezone
servers:
- !secret ip_ntp1
- !secret ip_ntp2
id: ntp_time
spi:
clk_pin: 18
miso_pin: 19
mosi_pin: 23
sensor:
- platform: wifi_signal
id: wifi_sig
name: ${disp_name} RSSI
unit_of_measurement: "dBm"
update_interval: 100s
filters:
- median:
window_size: 7
send_every: 5
send_first_at: 5
- or:
- heartbeat: ${heartbeat}
- delta: 3
#IC1 Main
- platform: atm90e32
cs_pin: 5
phase_a:
power:
name: ${disp_name} ${ct1_name} Watts
id: ct1Watts
filters:
- or:
- heartbeat: ${heartbeat}
- delta: ${ct1_delta}
gain_voltage: ${ct1_volt}
gain_ct: ${ct1_clamp}
phase_b:
power:
name: ${disp_name} ${ct2_name} Watts
id: ct2Watts
filters:
- or:
- heartbeat: ${heartbeat}
- delta: ${ct2_delta}
gain_voltage: ${ct2_volt}
gain_ct: ${ct2_clamp}
phase_c:
voltage:
name: ${disp_name} ${ct3_name} Volts
id: ic3Volts
accuracy_decimals: 1
current:
name: ${disp_name} ${ct3_name} Amps
id: ct3Amps
power:
name: ${disp_name} ${ct3_name} Watts
id: ct3Watts
gain_voltage: ${ct3_volt}
gain_ct: ${ct3_clamp}
frequency:
name: ${disp_name} Freq A Main
line_frequency: 60Hz
gain_pga: 1X
update_interval: ${update_time}
#IC2 Main
- platform: atm90e32
cs_pin: 4
phase_a:
voltage:
name: ${disp_name} ${ct4_name} Volts
id: ic4Volts
accuracy_decimals: 1
current:
name: ${disp_name} ${ct4_name} Amps
id: ct4Amps
power:
name: ${disp_name} ${ct4_name} Watts
id: ct4Watts
gain_voltage: ${ct4_volt}
gain_ct: ${ct4_clamp}
phase_b:
power:
name: ${disp_name} ${ct5_name} Watts
id: ct5Watts
filters:
- or:
- heartbeat: ${heartbeat}
- delta: ${ct5_delta}
gain_voltage: ${ct5_volt}
gain_ct: ${ct5_clamp}
phase_c:
power:
name: ${disp_name} ${ct6_name} Watts
id: ct6Watts
filters:
- or:
- heartbeat: ${heartbeat}
- delta: ${ct6_delta}
gain_voltage: ${ct6_volt}
gain_ct: ${ct6_clamp}
line_frequency: 60Hz
gain_pga: 1X
update_interval: ${update_time}
#IC1 AddOn 1
- platform: atm90e32
cs_pin: 0
phase_a:
power:
name: ${disp_name} ${ct7_name} Watts
id: ct7Watts
filters:
- or:
- heartbeat: ${heartbeat}
- delta: ${ct7_delta}
gain_voltage: ${ct7_volt}
gain_ct: ${ct7_clamp}
phase_b:
power:
name: ${disp_name} ${ct8_name} Watts
id: ct8Watts
filters:
- or:
- heartbeat: ${heartbeat}
- delta: ${ct8_delta}
gain_voltage: ${ct8_volt}
gain_ct: ${ct8_clamp}
phase_c:
power:
name: ${disp_name} ${ct9_name} Watts
id: ct9Watts
filters:
- or:
- heartbeat: ${heartbeat}
- delta: ${ct9_delta}
gain_voltage: ${ct9_volt}
gain_ct: ${ct9_clamp}
line_frequency: 60Hz
gain_pga: 1X
update_interval: ${update_time}
#IC2 AddOn 1
- platform: atm90e32
cs_pin: 16
phase_a:
power:
name: ${disp_name} ${ct10_name} Watts
id: ct10Watts
filters:
- or:
- heartbeat: ${heartbeat}
- delta: ${ct10_delta}
gain_voltage: ${ct10_volt}
gain_ct: ${ct10_clamp}
phase_b:
power:
name: ${disp_name} ${ct11_name} Watts
id: ct11Watts
filters:
- or:
- heartbeat: ${heartbeat}
- delta: ${ct11_delta}
gain_voltage: ${ct11_volt}
gain_ct: ${ct11_clamp}
phase_c:
power:
name: ${disp_name} ${ct12_name} Watts
id: ct12Watts
filters:
- or:
- heartbeat: ${heartbeat}
- delta: ${ct12_delta}
gain_voltage: ${ct12_volt}
gain_ct: ${ct12_clamp}
line_frequency: 60Hz
gain_pga: 1X
update_interval: ${update_time}
#IC1 AddOn 2
- platform: atm90e32
cs_pin: 27
phase_a:
power:
name: ${disp_name} ${ct13_name} Watts
id: ct13Watts
filters:
- or:
- heartbeat: ${heartbeat}
- delta: ${ct13_delta}
gain_voltage: ${ct13_volt}
gain_ct: ${ct13_clamp}
phase_b:
power:
name: ${disp_name} ${ct14_name} Watts
id: ct14Watts
filters:
- or:
- heartbeat: ${heartbeat}
- delta: ${ct14_delta}
gain_voltage: ${ct14_volt}
gain_ct: ${ct14_clamp}
phase_c:
power:
name: ${disp_name} ${ct15_name} Watts
id: ct15Watts
filters:
- or:
- heartbeat: ${heartbeat}
- delta: ${ct15_delta}
gain_voltage: ${ct15_volt}
gain_ct: ${ct15_clamp}
line_frequency: 60Hz
gain_pga: 1X
update_interval: ${update_time}
#IC2 AddOn 2
- platform: atm90e32
cs_pin: 17
phase_a:
power:
name: ${disp_name} ${ct16_name} Watts
id: ct16Watts
filters:
- or:
- heartbeat: ${heartbeat}
- delta: ${ct16_delta}
gain_voltage: ${ct16_volt}
gain_ct: ${ct16_clamp}
phase_b:
power:
name: ${disp_name} ${ct17_name} Watts
id: ct17Watts
filters:
- or:
- heartbeat: ${heartbeat}
- delta: ${ct17_delta}
gain_voltage: ${ct17_volt}
gain_ct: ${ct17_clamp}
phase_c:
power:
name: ${disp_name} ${ct18_name} Watts
id: ct18Watts
filters:
- or:
- heartbeat: ${heartbeat}
- delta: ${ct18_delta}
gain_voltage: ${ct18_volt}
gain_ct: ${ct18_clamp}
line_frequency: 60Hz
gain_pga: 1X
update_interval: ${update_time}
#Total Watts
- platform: template
name: ${disp_name} Total Watts
id: totalWatts
lambda: return id(ct3Watts).state + id(ct4Watts).state;
accuracy_decimals: 1
unit_of_measurement: W
icon: "mdi:flash-circle"
update_interval: ${update_time}
filters:
- or:
- heartbeat: ${heartbeat}
- delta: 3
#kWh Daily
- platform: total_daily_energy
name: ${disp_name} Total kWh
power_id: totalWatts
accuracy_decimals: 0
filters:
- multiply: 0.001
- or:
- heartbeat: ${heartbeat}
- delta: 1
unit_of_measurement: kWh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment