Procházet zdrojové kódy

Powerworld PW58410: new config for primarily HVAC use

Due to this device combining Hot water and HVAC controls into a single
"mode" it needs to expose a subset of modes to the standard climate hvac_mode
to have a one to one mapping.

In the original config, there was an assumption that Hot Water would
be permanently on, so the modes exposed in the climate entity were the
combination "hot water+"heat/cool modes.

In the case where the unit is installed as HVAC only, this is not
appropriate so a different config is needed.

Issue #1530
Jason Rumney před 1 rokem
rodič
revize
d9484a586a

+ 610 - 0
custom_components/tuya_local/devices/powerworld_pw58410_hvaconly.yaml

@@ -0,0 +1,610 @@
+name: Heat pump
+products:
+  - id: 74jzzoqr2ghxyu1p
+    name: Powerworld PW58410
+primary_entity:
+  entity: climate
+  dps:
+    - id: 1
+      type: boolean
+      name: hvac_mode
+      mapping:
+        - dps_val: false
+          value: "off"
+        - dps_val: true
+          constraint: work_mode
+          conditions:
+            - dps_val: heat
+              value: heat
+            - dps_val: cool
+              value: cool
+            - dps_val: wth
+              value: "off"
+              hidden: true
+            - dps_val: wth_heat
+              value: heat
+              hidden: true
+            - dps_val: wth_cool
+              value: cool
+              hidden: true
+    - id: 2
+      type: string
+      name: preset_mode
+      mapping:
+        - dps_val: smart
+          value: comfort
+        - dps_val: strong
+          value: boost
+        - dps_val: mute
+          value: sleep
+    - id: 5
+      type: string
+      name: work_mode
+    - id: 6
+      type: string
+      name: temperature_unit
+      mapping:
+        - dps_val: f
+          value: F
+        - value: C
+    - id: 111
+      type: integer
+      optional: true
+      name: temperature
+      range:
+        min: 0
+        max: 99
+      mapping:
+        - constraint: hvac_mode
+          conditions:
+            - dps_val: [cool, wth_cool]
+              value_redirect: cool_temp
+    - id: 112
+      type: integer
+      name: cool_temp
+      optional: true
+      hidden: true
+      range:
+        min: 0
+        max: 99
+secondary_entities:
+  - entity: water_heater
+    dps:
+      - id: 1
+        type: boolean
+        name: operation_mode
+        mapping:
+          - dps_val: false
+            value: "off"
+          - dps_val: true
+            constraint: work_mode
+            conditions:
+              - dps_val: wth
+                value: Hot water
+              - dps_val: heat
+                value: Heating
+              - dps_val: cool
+                value: Cooling
+              - dps_val: wth_heat
+                value: Hot water + heating
+              - dps_val: wth_cool
+                value: Hot water + cooling
+      - id: 5
+        type: string
+        name: work_mode
+        hidden: true
+      - id: 6
+        type: string
+        name: temperature_unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
+      - id: 110
+        type: integer
+        name: temperature
+        range:
+          min: 0
+          max: 99
+      - id: 101
+        type: base64
+        optional: true
+        name: current_temperature
+        mapping:
+          - mask: "000000000000000000000000000000000000000000000000\
+                   00000000FFFFFFFF00000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+      - id: 118
+        type: string
+        optional: true
+        name: parameter_group_1
+      - id: 119
+        type: string
+        optional: true
+        name: parameter_group_2
+      - id: 120
+        type: string
+        optional: true
+        name: parameter_group_3
+      - id: 121
+        type: string
+        optional: true
+        name: parameter_group_4
+      - id: 122
+        type: string
+        optional: true
+        name: parameter_group_5
+      - id: 123
+        type: string
+        optional: true
+        name: parameter_group_6
+      - id: 124
+        type: string
+        optional: true
+        name: parameter_group_7
+      - id: 126
+        type: string
+        optional: true
+        name: parameter_group_8
+      - id: 140
+        type: string
+        optional: true
+        name: power_statistics
+  - entity: select
+    translation_key: temperature_unit
+    category: config
+    dps:
+      - id: 6
+        type: string
+        name: option
+        mapping:
+          - dps_val: c
+            value: celsius
+          - dps_val: f
+            value: fahrenheit
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 15
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 15
+        type: bitfield
+        name: fault_code
+      - id: 199
+        type: integer
+        optional: true
+        name: custom_fault_bit
+  - entity: button
+    name: Factory reset
+    class: restart
+    category: config
+    dps:
+      - id: 125
+        type: boolean
+        optional: true
+        name: button
+  - entity: sensor
+    name: Inlet temperature
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        mapping:
+          - mask: "FFFFFFFF0000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+      - id: 6
+        type: string
+        name: unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
+  - entity: sensor
+    name: Outlet temperature
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        mapping:
+          - mask: "00000000FFFFFFFF00000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+      - id: 6
+        type: string
+        name: unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
+  - entity: sensor
+    name: Ambient temperature
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        mapping:
+          - mask: "0000000000000000FFFFFFFF000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+      - id: 6
+        type: string
+        name: unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
+  - entity: sensor
+    name: Exhaust temperature
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        mapping:
+          - mask: "000000000000000000000000FFFFFFFF0000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+      - id: 6
+        type: string
+        name: unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
+  - entity: sensor
+    name: Air return temperature
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        mapping:
+          - mask: "00000000000000000000000000000000FFFFFFFF00000000\
+                   000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+      - id: 6
+        type: string
+        name: unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
+  - entity: sensor
+    name: Evaporator coil temperature
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        mapping:
+          - mask: "0000000000000000000000000000000000000000FFFFFFFF\
+                   000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+      - id: 6
+        type: string
+        name: unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
+  - entity: sensor
+    name: Cooling coil temperature
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        mapping:
+          - mask: "000000000000000000000000000000000000000000000000\
+                   FFFFFFFF0000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+      - id: 6
+        type: string
+        name: unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
+  - entity: sensor
+    name: Main EEV opening
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        mapping:
+          - mask: "000000000000000000000000000000000000000000000000\
+                   0000000000000000FFFFFFFF000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+  - entity: sensor
+    name: Secondary EEV opening
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        mapping:
+          - mask: "000000000000000000000000000000000000000000000000\
+                   000000000000000000000000FFFFFFFF0000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+  - entity: sensor
+    name: Compressor current
+    class: current
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        unit: A
+        mapping:
+          - mask: "000000000000000000000000000000000000000000000000\
+                   00000000000000000000000000000000FFFFFFFF00000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+  - entity: sensor
+    name: Heat sink temperature
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        mapping:
+          - mask: "000000000000000000000000000000000000000000000000\
+                   0000000000000000000000000000000000000000FFFFFFFF\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+      - id: 6
+        type: string
+        name: unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
+  - entity: sensor
+    name: DC bus voltage
+    class: voltage
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        unit: V
+        mapping:
+          - mask: "000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   FFFFFFFF0000000000000000000000000000000000000000\
+                   0000000000000000"
+  - entity: sensor
+    name: Compressor frequency
+    class: frequency
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        unit: Hz
+        mapping:
+          - mask: "000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   00000000FFFFFFFF00000000000000000000000000000000\
+                   0000000000000000"
+  - entity: sensor
+    name: Fan 1 speed
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        unit: rpm
+        mapping:
+          - mask: "000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000FFFFFFFF000000000000000000000000\
+                   0000000000000000"
+  - entity: sensor
+    name: Fan 2 speed
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        unit: rpm
+        mapping:
+          - mask: "000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   000000000000000000000000FFFFFFFF0000000000000000\
+                   0000000000000000"
+  - entity: sensor
+    class: pressure
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        unit: bar
+        mapping:
+          - mask: "000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   00000000000000000000000000000000FFFFFFFF00000000\
+                   0000000000000000"
+  - entity: sensor
+    name: Low pressure gas temperature
+    class: temperature
+    category: diagnostic
+    dps:
+      - id: 101
+        type: base64
+        optional: true
+        name: sensor
+        mapping:
+          - mask: "000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000000000000000000000000000FFFFFFFF\
+                   0000000000000000"
+      - id: 6
+        type: string
+        name: unit
+        mapping:
+          - dps_val: f
+            value: F
+          - value: C
+  - entity: sensor
+    name: Heating capacity
+    class: power
+    category: diagnostic
+    dps:
+      - id: 140
+        type: base64
+        optional: true
+        name: sensor
+        unit: kW
+        mapping:
+          - mask: "FFFFFFFF0000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+            scale: 10
+  - entity: sensor
+    class: volume_flow_rate
+    category: diagnostic
+    dps:
+      - id: 140
+        type: base64
+        optional: true
+        name: sensor
+        unit: m³/h
+        mapping:
+          - mask: "00000000FFFFFFFF00000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+            scale: 10
+  - entity: sensor
+    class: current
+    category: diagnostic
+    dps:
+      - id: 140
+        type: base64
+        optional: true
+        name: sensor
+        unit: A
+        mapping:
+          - mask: "0000000000000000FFFFFFFF000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+  - entity: sensor
+    class: voltage
+    category: diagnostic
+    dps:
+      - id: 140
+        type: base64
+        optional: true
+        name: sensor
+        unit: V
+        mapping:
+          - mask: "000000000000000000000000FFFFFFFF0000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+  - entity: sensor
+    class: power
+    category: diagnostic
+    dps:
+      - id: 140
+        type: base64
+        optional: true
+        name: sensor
+        unit: W
+        mapping:
+          - mask: "00000000000000000000000000000000FFFFFFFF00000000\
+                   000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+  - entity: sensor
+    name: Coefficient of performance
+    category: diagnostic
+    dps:
+      - id: 140
+        type: base64
+        optional: true
+        name: sensor
+        mapping:
+          - mask: "0000000000000000000000000000000000000000FFFFFFFF\
+                   000000000000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+            scale: 10
+  - entity: number
+    name: Pump speed
+    category: config
+    dps:
+      - id: 140
+        type: base64
+        optional: true
+        name: value
+        mapping:
+          - mask: "000000000000000000000000000000000000000000000000\
+                   FFFFFFFF0000000000000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"
+        range:
+          min: 0
+          max: 100
+  - entity: sensor
+    name: Pump speed
+    category: diagnostic
+    dps:
+      - id: 140
+        type: base64
+        optional: true
+        name: sensor
+        mapping:
+          - mask: "000000000000000000000000000000000000000000000000\
+                   00000000FFFFFFFF00000000000000000000000000000000\
+                   000000000000000000000000000000000000000000000000\
+                   0000000000000000"

+ 0 - 1
custom_components/tuya_local/devices/powerworld_pw58410_waterheater.yaml

@@ -88,7 +88,6 @@ primary_entity:
       name: power_statistics
 secondary_entities:
   - entity: climate
-    translation_key: heater
     dps:
       - id: 2
         type: string