Преглед изворни кода

feat(ecostrad_iqceramicv2_radiator): add power, voltage and current sensors (#6297)

Adds power, voltage and current sensors to the Ecostrad iQ Ceramic v2
config, using previously unmapped dps:

- 118: voltage (V × 10)
- 119: power (W × 10)
- 120: current (mA)

These aren't in the cloud data model, so I worked the meanings out from
the values. Tested on my own heater while it was heating:

```
{"1": true, "3": 300, "32": "heating", "118": 2292, "119": 16868, "120": 6907, "121": 20}
```

That gives 229.2 V, 1686.8 W and 6.907 A. The heater reads 0 W / 0 A
when off. Volts × amps comes out within a few percent of the reported
power across several readings, and the other user's logs in #4799 fit
the same scales.

All three are marked optional. Dp 121 (always 20) is still unmapped.

AI-assisted: I've reviewed the change and tested it on my own Home
Assistant install.
Jon Wood пре 9 часа
родитељ
комит
6110bbe6c3
1 измењених фајлова са 35 додато и 0 уклоњено
  1. 35 0
      custom_components/tuya_local/devices/ecostrad_iqceramicv2_radiator.yaml

+ 35 - 0
custom_components/tuya_local/devices/ecostrad_iqceramicv2_radiator.yaml

@@ -119,3 +119,38 @@ entities:
             value: "45m"
           - dps_val: "60"
             value: "1h"
+  - entity: sensor
+    class: power
+    dps:
+      - id: 119
+        name: sensor
+        type: integer
+        optional: true
+        unit: W
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    class: voltage
+    category: diagnostic
+    dps:
+      - id: 118
+        name: sensor
+        type: integer
+        optional: true
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    class: current
+    category: diagnostic
+    dps:
+      - id: 120
+        name: sensor
+        type: integer
+        optional: true
+        unit: A
+        class: measurement
+        mapping:
+          - scale: 1000