myStrom: fixed multiplier and simpler totals

This commit is contained in:
2024-12-06 15:59:23 +01:00
parent 9ae7166c1a
commit d4dc82ce4d
+9 -23
View File
@@ -82,30 +82,16 @@ sensor:
unit_of_measurement: "W" unit_of_measurement: "W"
accuracy_decimals: 0 accuracy_decimals: 0
filters: filters:
# Map from sensor -> measured value (pulse/min -> W), - multiply: 3.29E-02 # pulse/min -> W
# taken from https://github.com/mightea/esphome-mystrom-devices
- calibrate_linear:
- 0.0 -> 1.55
- 2698.5 -> 85
- 4397.25 -> 146
- 30900 -> 1005
- 44634.56 -> 1439
- 59643.75 -> 1930
# Correct 1.55W for the power usage of the plug.
- offset: -1.55
# Make everything below 1W appear as just 0W.
- lambda: if (x < 1) return 0; return x;
- platform: integration total:
sensor: mystrom_power_consumption name: "Energy consumption"
name: "Power consumption total" unit_of_measurement: "kWh"
time_unit: "h" device_class: "energy"
unit_of_measurement: "kWh" state_class: "total_increasing"
device_class: "energy" accuracy_decimals: 3
state_class: "total_increasing" filters:
accuracy_decimals: 2 - multiply: 5.48E-07 # pulses -> kWh
filters:
- multiply: 0.001
- platform: tmp102 - platform: tmp102
id: mystrom_temperature id: mystrom_temperature