Просмотр исходного кода

fix(kaisai_proheat_airconditioner): use timestamps for energy sensor

Apparently this sensor resets too frequently for HA's built in total_increasing
algorithm to handle.

Instead, try using the total class with start time as last_reset timestamp.
Also include the end time as timestamp for reference.

Alternative to PR #5579 by @camel1cz which will not require
post-processing if it works.
Jason Rumney 6 дней назад
Родитель
Сommit
182b0bd4aa

+ 7 - 1
custom_components/tuya_local/devices/kaisai_proheat_airconditioner.yaml

@@ -159,10 +159,16 @@ entities:
         name: sensor
         type: integer
         unit: kWh
-        class: total_increasing
+        class: total
         optional: true
         mapping:
           - scale: 100
+      - id: 128
+        name: last_reset
+        type: unixtime
+      - id: 129
+        name: timestamp
+        type: unixtime
 
   - entity: sensor
     name: External fan speed