Added some themes, but mostly updated power monitor to better wrangle the sensors and udpate_intervals to save DB space

This commit is contained in:
CeeWeasel
2026-03-14 16:26:42 -04:00
parent a272421a33
commit 149fac6ec0
18 changed files with 3632 additions and 239 deletions
@@ -104,9 +104,6 @@ action:
- switch.adaptive_lighting_bedroom
- switch.adaptive_lighting_adapt_brightness_bedroom
- switch.adaptive_lighting_adapt_color_bedroom
- action: switch.turn_off
target:
entity_id: switch.adaptive_lighting_sleep_mode_bedroom
default:
- action: switch.turn_off
target:
@@ -11,3 +11,8 @@ action:
data: {}
target:
entity_id: media_player.ma_bedroom_hub
- action: switch.turn_off
data: {}
target:
entity_id: switch.adaptive_lighting_sleep_mode_bedroom
@@ -14,3 +14,8 @@ action:
volume: 0.35
repeat: all
shuffle: false
- action: switch.turn_on
data: {}
target:
entity_id: switch.adaptive_lighting_sleep_mode_bedroom
File diff suppressed because it is too large Load Diff
+2
View File
@@ -27,6 +27,8 @@ packages:
esp8266:
board: nodemcuv2
captive_portal:
# font:
# - file: 'fonts/mdi.ttf'
# id: mdi_weather
@@ -12,48 +12,78 @@ sensor:
current:
name: ${ct7_name} ${amp_label}
id: ct7Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct7_name} ${watt_label}
id: ct7Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal1}
gain_ct: ${current_cal_ct7}
phase_b:
current:
name: ${ct8_name} ${amp_label}
id: ct8Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct8_name} ${watt_label}
id: ct8Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal1}
gain_ct: ${current_cal_ct8}
phase_c:
current:
name: ${ct9_name} ${amp_label}
id: ct9Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct9_name} ${watt_label}
id: ct9Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal1}
gain_ct: ${current_cal_ct9}
line_frequency: ${electric_freq}
@@ -71,48 +101,78 @@ sensor:
current:
name: ${ct10_name} ${amp_label}
id: ct10Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct10_name} ${watt_label}
id: ct10Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal2}
gain_ct: ${current_cal_ct10}
phase_b:
current:
name: ${ct11_name} ${amp_label}
id: ct11Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct11_name} ${watt_label}
id: ct11Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal2}
gain_ct: ${current_cal_ct11}
phase_c:
current:
name: ${ct12_name} ${amp_label}
id: ct12Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct12_name} ${watt_label}
id: ct12Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal2}
gain_ct: ${current_cal_ct12}
line_frequency: ${electric_freq}
@@ -121,25 +181,25 @@ sensor:
enable_offset_calibration: ${offset_calibration}
enable_gain_calibration: ${gain_calibration}
#Total A AddOn1
- platform: template
name: Add-on 1 Total ${amp_label}
id: totalAmpsAddOn1
lambda: return id(ct7Amps).state + id(ct8Amps).state + id(ct9Amps).state + id(ct10Amps).state + id(ct11Amps).state + id(ct12Amps).state ;
accuracy_decimals: 2
unit_of_measurement: A
device_class: current
update_interval: ${update_time}
# #Total A AddOn1
# - platform: template
# name: Add-on 1 Total ${amp_label}
# id: totalAmpsAddOn1
# lambda: return id(ct7Amps).state + id(ct8Amps).state + id(ct9Amps).state + id(ct10Amps).state + id(ct11Amps).state + id(ct12Amps).state ;
# accuracy_decimals: 2
# unit_of_measurement: A
# device_class: current
# update_interval: ${update_time}
#Total W AddOn1
- platform: template
name: Add-on 1 Total ${watt_label}
id: totalWattsAddOn1
lambda: return id(ct7Watts).state + id(ct8Watts).state + id(ct9Watts).state + id(ct10Watts).state + id(ct11Watts).state + id(ct12Watts).state ;
accuracy_decimals: 2
unit_of_measurement: W
device_class: power
update_interval: ${update_time}
# #Total W AddOn1
# - platform: template
# name: Add-on 1 Total ${watt_label}
# id: totalWattsAddOn1
# lambda: return id(ct7Watts).state + id(ct8Watts).state + id(ct9Watts).state + id(ct10Watts).state + id(ct11Watts).state + id(ct12Watts).state ;
# accuracy_decimals: 2
# unit_of_measurement: W
# device_class: power
# update_interval: ${update_time}
#kWh From CT 7
- platform: total_daily_energy
@@ -148,6 +208,7 @@ sensor:
power_id: ct7Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -159,6 +220,7 @@ sensor:
power_id: ct8Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -170,6 +232,7 @@ sensor:
power_id: ct9Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -181,6 +244,7 @@ sensor:
power_id: ct10Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -192,6 +256,7 @@ sensor:
power_id: ct11Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -203,6 +268,7 @@ sensor:
power_id: ct12Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -12,48 +12,78 @@ sensor:
current:
name: ${ct13_name} ${amp_label}
id: ct13Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct13_name} ${watt_label}
id: ct13Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal1}
gain_ct: ${current_cal_ct13}
phase_b:
current:
name: ${ct14_name} ${amp_label}
id: ct14Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct14_name} ${watt_label}
id: ct14Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal1}
gain_ct: ${current_cal_ct14}
phase_c:
current:
name: ${ct15_name} ${amp_label}
id: ct15Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct15_name} ${watt_label}
id: ct15Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal1}
gain_ct: ${current_cal_ct15}
line_frequency: ${electric_freq}
@@ -71,48 +101,78 @@ sensor:
current:
name: ${ct16_name} ${amp_label}
id: ct16Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct16_name} ${watt_label}
id: ct16Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal2}
gain_ct: ${current_cal_ct16}
phase_b:
current:
name: ${ct17_name} ${amp_label}
id: ct17Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct17_name} ${watt_label}
id: ct17Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal2}
gain_ct: ${current_cal_ct17}
phase_c:
current:
name: ${ct18_name} ${amp_label}
id: ct18Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct18_name} ${watt_label}
id: ct18Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal2}
gain_ct: ${current_cal_ct18}
line_frequency: ${electric_freq}
@@ -121,25 +181,25 @@ sensor:
enable_offset_calibration: ${offset_calibration}
enable_gain_calibration: ${gain_calibration}
#Total A AddOn2
- platform: template
name: Add-on 2 Total ${amp_label}
id: totalAmpsAddOn2
lambda: return id(ct13Amps).state + id(ct14Amps).state + id(ct15Amps).state + id(ct16Amps).state + id(ct17Amps).state + id(ct18Amps).state ;
accuracy_decimals: 2
unit_of_measurement: A
device_class: current
update_interval: ${update_time}
# #Total A AddOn2
# - platform: template
# name: Add-on 2 Total ${amp_label}
# id: totalAmpsAddOn2
# lambda: return id(ct13Amps).state + id(ct14Amps).state + id(ct15Amps).state + id(ct16Amps).state + id(ct17Amps).state + id(ct18Amps).state ;
# accuracy_decimals: 2
# unit_of_measurement: A
# device_class: current
# update_interval: ${update_time}
#Total W AddOn2
- platform: template
name: Add-on 2 Total ${watt_label}
id: totalWattsAddOn2
lambda: return id(ct13Watts).state + id(ct14Watts).state + id(ct15Watts).state + id(ct16Watts).state + id(ct17Watts).state + id(ct18Watts).state ;
accuracy_decimals: 2
unit_of_measurement: W
device_class: power
update_interval: ${update_time}
# #Total W AddOn2
# - platform: template
# name: Add-on 2 Total ${watt_label}
# id: totalWattsAddOn2
# lambda: return id(ct13Watts).state + id(ct14Watts).state + id(ct15Watts).state + id(ct16Watts).state + id(ct17Watts).state + id(ct18Watts).state ;
# accuracy_decimals: 2
# unit_of_measurement: W
# device_class: power
# update_interval: ${update_time}
#kWh From CT 13
- platform: total_daily_energy
@@ -148,6 +208,7 @@ sensor:
power_id: ct13Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -159,6 +220,7 @@ sensor:
power_id: ct14Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -170,6 +232,7 @@ sensor:
power_id: ct15Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -181,6 +244,7 @@ sensor:
power_id: ct16Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -192,6 +256,7 @@ sensor:
power_id: ct17Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -203,6 +268,7 @@ sensor:
power_id: ct18Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -13,48 +13,78 @@ sensor:
current:
name: ${ct19_name} ${amp_label}
id: ct19Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct19_name} ${watt_label}
id: ct19Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal1}
gain_ct: ${current_cal_ct19}
phase_b:
current:
name: ${ct20_name} ${amp_label}
id: ct20Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct20_name} ${watt_label}
id: ct20Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal1}
gain_ct: ${current_cal_ct20}
phase_c:
current:
name: ${ct21_name} ${amp_label}
id: ct21Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct21_name} ${watt_label}
id: ct21Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal1}
gain_ct: ${current_cal_ct21}
line_frequency: ${electric_freq}
@@ -72,48 +102,78 @@ sensor:
current:
name: ${ct22_name} ${amp_label}
id: ct22Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct22_name} ${watt_label}
id: ct22Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 5.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal2}
gain_ct: ${current_cal_ct22}
phase_b:
current:
name: ${ct23_name} ${amp_label}
id: ct23Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct23_name} ${watt_label}
id: ct23Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal2}
gain_ct: ${current_cal_ct23}
phase_c:
current:
name: ${ct24_name} ${amp_label}
id: ct24Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct24_name} ${watt_label}
id: ct24Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal2}
gain_ct: ${current_cal_ct24}
line_frequency: ${electric_freq}
@@ -122,25 +182,25 @@ sensor:
enable_offset_calibration: ${offset_calibration}
enable_gain_calibration: ${gain_calibration}
#Total A AddOn3
- platform: template
name: Add-on 3 Total ${amp_label}
id: totalAmpsAddOn3
lambda: return id(ct19Amps).state + id(ct20Amps).state + id(ct21Amps).state + id(ct22Amps).state + id(ct23Amps).state + id(ct24Amps).state ;
accuracy_decimals: 2
unit_of_measurement: A
device_class: current
update_interval: ${update_time}
# #Total A AddOn3
# - platform: template
# name: Add-on 3 Total ${amp_label}
# id: totalAmpsAddOn3
# lambda: return id(ct19Amps).state + id(ct20Amps).state + id(ct21Amps).state + id(ct22Amps).state + id(ct23Amps).state + id(ct24Amps).state ;
# accuracy_decimals: 2
# unit_of_measurement: A
# device_class: current
# update_interval: ${update_time}
#Total W AddOn3
- platform: template
name: Add-on 3 Total ${watt_label}
id: totalWattsAddOn3
lambda: return id(ct19Watts).state + id(ct20Watts).state + id(ct21Watts).state + id(ct22Watts).state + id(ct23Watts).state + id(ct24Watts).state ;
accuracy_decimals: 2
unit_of_measurement: W
device_class: power
update_interval: ${update_time}
# #Total W AddOn3
# - platform: template
# name: Add-on 3 Total ${watt_label}
# id: totalWattsAddOn3
# lambda: return id(ct19Watts).state + id(ct20Watts).state + id(ct21Watts).state + id(ct22Watts).state + id(ct23Watts).state + id(ct24Watts).state ;
# accuracy_decimals: 2
# unit_of_measurement: W
# device_class: power
# update_interval: ${update_time}
#kWh From CT 19
- platform: total_daily_energy
@@ -149,6 +209,7 @@ sensor:
power_id: ct19Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -160,6 +221,7 @@ sensor:
power_id: ct20Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -171,6 +233,7 @@ sensor:
power_id: ct21Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -182,6 +245,7 @@ sensor:
power_id: ct22Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -193,6 +257,7 @@ sensor:
power_id: ct23Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -204,6 +269,7 @@ sensor:
power_id: ct24Watts
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -9,56 +9,88 @@ sensor:
voltage:
name: Voltage 1
id: ic1Volts
accuracy_decimals: 1
entity_category: diagnostic
accuracy_decimals: ${voltage_accuracy_decimals}
filters:
# Only log if voltage moves by 0.5V, or every 5 mins regardless
- or:
- delta: ${voltage_delta}
- heartbeat: ${voltage_heartbeat}
current:
name: ${ct1_name} ${amp_label}
id: ct1Amps
# The max value for current that the meter can output is 65.535. If you expect to measure current over 65A,
# divide the gain_ct by 2 (120A CT) or 4 (200A CT) and multiply the current and power values by 2 or 4 by uncommenting the filter below
# filters:
# - multiply: 2
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct1_name} ${watt_label}
id: ct1Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 5.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_grid}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal1}
gain_ct: ${current_cal_ct1}
phase_b:
current:
name: ${ct2_name} ${amp_label}
id: ct2Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct2_name} ${watt_label}
id: ct2Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 2.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_appliances}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal1}
gain_ct: ${current_cal_ct2}
phase_c:
current:
name: ${ct3_name} ${amp_label}
id: ct3Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct3_name} ${watt_label}
id: ct3Watts
accuracy_decimals: 1
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 2.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_appliances}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal1}
gain_ct: ${current_cal_ct3}
frequency:
@@ -77,56 +109,81 @@ sensor:
cs_pin: ${main_ic2}
id: ${main_meter_id2}
phase_a:
#this voltage is only needed if monitoring 2 voltages
# voltage:
# name: Voltage 2
# id: ic2Volts
# accuracy_decimals: 1
current:
name: ${ct4_name} ${amp_label}
id: ct4Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct4_name} ${watt_label}
id: ct4Watts
accuracy_decimals: ${watt_accuracy_decimals}
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 2.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_grid}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal2}
gain_ct: ${current_cal_ct4}
phase_b:
current:
name: ${ct5_name} ${amp_label}
id: ct5Amps
id: ct5
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct5_name} ${watt_label}
id: ct5Watts
accuracy_decimals: ${watt_accuracy_decimals}
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 2.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal2}
gain_ct: ${current_cal_ct5}
phase_c:
current:
name: ${ct6_name} ${amp_label}
id: ct6Amps
entity_category: diagnostic
accuracy_decimals: ${amp_accuracy_decimals}
filters:
# Drop noise below 0.02A, then log 0.05A changes or every 60s
- lambda: "return x < 0.02 ? 0 : x;"
- or:
- delta: ${amp_delta}
- throttle: ${amp_throttle}
power:
name: ${ct6_name} ${watt_label}
id: ct6Watts
accuracy_decimals: ${watt_accuracy_decimals}
filters:
- lambda: |-
if (x < 0) return x * -1;
return x;
# Convert negative to positive (absolute value)
- lambda: "return abs(x);"
# Clip "ghost" watts when the device is off
- lambda: "return x < 2.0 ? 0 : x;"
- or:
- throttle: 60s
- delta: 2.0
- delta: ${watt_delta_lights}
- throttle: ${watt_throttle}
gain_voltage: ${voltage_cal2}
gain_ct: ${current_cal_ct6}
#this is only needed if monitoring 2 voltages
@@ -142,33 +199,50 @@ sensor:
#Total A Main
################
- platform: template
name: Mainboard Total ${amp_label}
id: totalAmpsMain
lambda: return id(ct1Amps).state + id(ct2Amps).state + id(ct3Amps).state + id(ct4Amps).state + id(ct5Amps).state + id(ct6Amps).state ;
accuracy_decimals: 2
unit_of_measurement: A
device_class: current
update_interval: ${update_time}
# - platform: template
# name: Mainboard Total ${amp_label}
# id: totalAmpsMain
# entity_category: diagnostic
# lambda: return id(ct1Amps).state + id(ct2Amps).state + id(ct3Amps).state + id(ct4Amps).state + id(ct5Amps).state + id(ct6Amps).state ;
# accuracy_decimals: ${amp_accuracy_decimals}
# unit_of_measurement: A
# device_class: current
# update_interval: ${update_time}
# filters:
# # Drop noise below 0.02A, then log 0.05A changes or every 60s
# - lambda: "return x < 0.02 ? 0 : x;"
# - or:
# - delta: ${amp_delta}
# - throttle: ${amp_throttle}
#Total W Main
#################
- platform: template
name: Mainboard Total ${watt_label}
id: totalWattsMain
lambda: return id(ct1Watts).state + id(ct2Watts).state + id(ct3Watts).state + id(ct4Watts).state + id(ct5Watts).state + id(ct6Watts).state ;
accuracy_decimals: 1
unit_of_measurement: W
device_class: power
update_interval: ${update_time}
# - platform: template
# name: Mainboard Total ${watt_label}
# id: totalWattsMain
# lambda: return id(ct1Watts).state + id(ct2Watts).state + id(ct3Watts).state + id(ct4Watts).state + id(ct5Watts).state + id(ct6Watts).state ;
# accuracy_decimals: ${watt_accuracy_decimals}
# unit_of_measurement: ${watt_label}
# device_class: power
# update_interval: ${update_time}
# filters:
# # Convert negative to positive (absolute value)
# - lambda: "return abs(x);"
# # Clip "ghost" watts when the device is off
# - lambda: "return x < 2.0 ? 0 : x;"
# - or:
# - delta: ${watt_delta_grid}
# - throttle: ${watt_throttle}
#kWh From CT 1
- platform: total_daily_energy
name: ${ct1_name} ${kwh_label}
id: ct1Kwh
power_id: ct1Watts
accuracy_decimals: 3
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -178,8 +252,10 @@ sensor:
name: ${ct2_name} ${kwh_label}
id: ct2Kwh
power_id: ct2Watts
accuracy_decimals: 3
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -189,8 +265,10 @@ sensor:
name: ${ct3_name} ${kwh_label}
id: ct3Kwh
power_id: ct3Watts
accuracy_decimals: 3
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -200,8 +278,10 @@ sensor:
name: ${ct4_name} ${kwh_label}
id: ct4Kwh
power_id: ct4Watts
accuracy_decimals: 3
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -211,8 +291,10 @@ sensor:
name: ${ct5_name} ${kwh_label}
id: ct5Kwh
power_id: ct5Watts
accuracy_decimals: 3
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -222,8 +304,10 @@ sensor:
name: ${ct6_name} ${kwh_label}
id: ct6Kwh
power_id: ct6Watts
accuracy_decimals: 3
filters:
- multiply: 0.001
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
@@ -9,10 +9,10 @@ text_sensor:
phase_status:
phase_a:
name: "${ct1_name} Status"
phase_b:
name: "${ct2_name} Status"
phase_c:
name: "${ct3_name} Status"
# phase_b:
# name: "${ct2_name} Status"
# phase_c:
# name: "${ct3_name} Status"
frequency_status:
name: "Frequency Status 1"
@@ -21,10 +21,10 @@ text_sensor:
phase_status:
phase_a:
name: "${ct4_name} Status"
phase_b:
name: "${ct5_name} Status"
phase_c:
name: "${ct6_name} Status"
# phase_b:
# name: "${ct5_name} Status"
# phase_c:
# name: "${ct6_name} Status"
#this is only needed if monitoring 2 voltages
# freq_status:
# name: "Frequency Status 2"
+3
View File
@@ -134,6 +134,9 @@ sensor:
} else {
return x;
}
- or:
- throttle: 60s
- delta: 1
binary_sensor:
- platform: template
+3
View File
@@ -125,6 +125,9 @@ sensor:
} else {
return x;
}
- or:
- throttle: 60s
- delta: 1
unit_of_measurement: lbs
accuracy_decimals: 0
+35 -27
View File
@@ -13,7 +13,6 @@
substitutions:
devicename: power-monitor
#disp_name: power-monitor
disp_name: power-monitor
friendly_name: 'Power Monitor'
entity_name: power_monitor
@@ -21,22 +20,28 @@ substitutions:
static_ip: !secret power-monitor-ip
platform: ESP32
board: nodemcu-32s
#update_time: 500ms
update_time: 5s
update_time: 2s
kwh_report_interval: 60s
watt_heartbeat: 60s
throttle_time: 60s
watt_delta: "50.0"
#watt_delta: "5.0"
#grid_watt_delta: "10.0"
grid_watt_delta: "200.0"
#fast_update_time: 10s
#medium_update_time: 30s
#slow_update_time: 60s
watt_delta_lights: "2.0"
watt_delta_appliances: "10.0"
watt_delta_grid: "100.0"
watt_throttle: 60s
watt_accuracy_decimals: 1
watt_label: W
amp_delta: 0.05
amp_throttle: 60s
amp_accuracy_decimals: 2
amp_label: A
voltage_delta: 0.5
voltage_heartbeat: 300s
voltage_accuracy_decimals: 1
voltage_label: V
kwh_throttle: 60s
kwh_label: kWh
main_meter_name1: Meter 1-3
main_meter_name2: Meter 4-6
main_meter_id1: meter_main1
@@ -170,6 +175,8 @@ esp32:
# ESPHome v2025.7.0 update to allow more than 6 SPI hardware devices on ESP-IDF
type: esp-idf
captive_portal:
spi:
clk_pin: ${spi_clk}
miso_pin: ${spi_miso}
@@ -236,22 +243,23 @@ sensor:
# name: Frequency 2
## Comment out to show amps and watts per meter board in Home Assistant
- id: !extend totalAmpsMain
internal: true
- id: !extend totalWattsMain
internal: true
- id: !extend totalAmpsAddOn1
internal: true
- id: !extend totalWattsAddOn1
internal: true
- id: !extend totalAmpsAddOn2
internal: true
- id: !extend totalWattsAddOn2
internal: true
- id: !extend totalAmpsAddOn3
internal: true
- id: !extend totalWattsAddOn3
internal: true
## These were commented out altogether, so they wouldn't be calculated, even if they remained internal
# - id: !extend totalAmpsMain
# internal: true
# - id: !extend totalWattsMain
# # internal: true
# - id: !extend totalAmpsAddOn1
# internal: true
# - id: !extend totalWattsAddOn1
# internal: true
# - id: !extend totalAmpsAddOn2
# internal: true
# - id: !extend totalWattsAddOn2
# internal: true
# - id: !extend totalAmpsAddOn3
# internal: true
# - id: !extend totalWattsAddOn3
# internal: true
- id: !extend ${addon3_id1}
phase_a:
@@ -384,7 +392,7 @@ sensor:
power_id: totalWattsFromGrid
filters:
- multiply: 0.001
# - heartbeat: ${kwh_report_interval}
- throttle: ${kwh_throttle}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
File diff suppressed because it is too large Load Diff
+11
View File
@@ -0,0 +1,11 @@
# DO NOT EDIT THIS FILE.
# This file will be reset with updates.
# If you want to customize it, copy the content in another folder and file and change the name.
# https://www.home-assistant.io/integrations/frontend/#defining-themes
Mushroom Shadow:
# Home Assistant override
ha-card-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.16)
ha-card-border-width: 0
modes:
light: {}
dark: {}
@@ -0,0 +1,22 @@
# DO NOT EDIT THIS FILE.
# This file will be reset with updates.
# If you want to customize it, copy the content in another folder and file and change the name.
# https://www.home-assistant.io/integrations/frontend/#defining-themes
Mushroom Square Shadow:
# Home Assistant override
ha-badge-border-radius: 6px
ha-card-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.16)
ha-card-border-width: 0
ha-card-border-radius: 6px
ha-card-features-border-radius: 6px
ha-tile-icon-border-radius: 6px
# Layout
mush-spacing: 8px
# Elements
mush-icon-border-radius: 6px
mush-control-border-radius: 6px
# Chips
mush-chip-border-radius: 6px
modes:
light: {}
dark: {}
+20
View File
@@ -0,0 +1,20 @@
# DO NOT EDIT THIS FILE.
# This file will be reset with updates.
# If you want to customize it, copy the content in another folder and file and change the name.
# https://www.home-assistant.io/integrations/frontend/#defining-themes
Mushroom Square:
# Home Assistant override
ha-badge-border-radius: 6px
ha-card-border-radius: 6px
ha-card-features-border-radius: 6px
ha-tile-icon-border-radius: 6px
# Layout
mush-spacing: 8px
# Elements
mush-icon-border-radius: 6px
mush-control-border-radius: 6px
# Chips
mush-chip-border-radius: 6px
modes:
light: {}
dark: {}
+9
View File
@@ -0,0 +1,9 @@
# DO NOT EDIT THIS FILE.
# This file will be reset with updates.
# If you want to customize it, copy the content in another folder and file and change the name.
# https://www.home-assistant.io/integrations/frontend/#defining-themes
Mushroom:
# Nothing here as it's the default HA theme since 2022.11
modes:
light: {}
dark: {}