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
@@ -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