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

Add support for Spa PB562 (#4846)

* Add support for Spa PB562

* Update spa_pb562.yaml

no step

* Update spa_pb562.yaml

Added configuration for Spa PB562 (Product ID: jbxvi3pbxjjlmec2). Includes climate control, jet pump, blower, lights, power monitoring, and scheduling for heating and filtration via minute-based number entities.

* Update spa_pb562.yaml

Edit Voltage and Power name

* Update spa_pb562.yaml

I have tested the time entity as suggested, but it is not currently supported by the integration for this device (it triggers a ValueError: does not support use as a time device). I have reverted to number (0-1439 minutes) as it is the only way to reliably control the schedules on the PB562.
I also specified the range: max: 1439 for the schedule entities because the DPS values represent the time in minutes from midnight (e.g., 600 = 10:00 AM). This is the standard format for this Joyonway controller.

Regarding climate vs water_heater: I am using climate with fixed: heat because the heating status (DP 111) is read-only. In my tests, the water_heater entity locks the temperature slider because it cannot find a switchable operation mode. climate is the only way to keep the temperature control functional for the user.

I have also cleaned up the names and added the manufacturer/model details as requested.

* Update spa_pb562.yaml

I fixed the validation errors. The hvac_mode is now handled via a mapping to satisfy the schema, as fixed was not accepted in the options block. I also ensured all mappings follow the expected format.

* Update spa_pb562.yaml

* Update spa_pb562.yaml

* Update spa_pb562.yaml

adding fault

* Update spa_pb562.yaml

* Update spa_pb562.yaml

* Update spa_pb562.yaml

* Update spa_pb562.yaml

Convert fault sensor (DPS 45) from sensor to binary_sensor with problem class.

Integrate heating state (DPS 111) as hvac_action within the climate entity.

Clean up redundant diagnostic entities.

Remove the LED name

* feat(joyonway_pb562_spacontroller): changes from review

- rename file per standard brand_model_type naming convention
- use time entities for time settings
- remove name from problem sensor so translations are used

PR #4846

---------

Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
Thomas 2 месяцев назад
Родитель
Сommit
2278671a61
1 измененных файлов с 127 добавлено и 0 удалено
  1. 127 0
      custom_components/tuya_local/devices/joyonway_pb562_spacontroller.yaml

+ 127 - 0
custom_components/tuya_local/devices/joyonway_pb562_spacontroller.yaml

@@ -0,0 +1,127 @@
+name: Spa
+products:
+  - id: jbxvi3pbxjjlmec2
+    manufacturer: Joyonway
+    model: PB562
+
+entities:
+  # --- THERMOSTAT ---
+  - entity: climate
+    translation_key: thermostat
+    dps:
+      - id: 3
+        type: integer
+        name: temperature
+        range:
+          min: 15
+          max: 40
+      - id: 24
+        type: integer
+        name: current_temperature
+      - id: 111
+        type: boolean
+        name: hvac_action
+        mapping:
+          - dps_val: true
+            value: heating
+          - dps_val: false
+            value: idle
+
+  # --- PUMPS & BLOWER ---
+  - entity: switch
+    name: Jet pump
+    dps:
+      - id: 104
+        type: boolean
+        name: switch
+
+  - entity: switch
+    name: Blower
+    dps:
+      - id: 125
+        type: boolean
+        name: switch
+
+  # --- LIGHT ---
+  - entity: light
+    dps:
+      - id: 123
+        type: boolean
+        name: switch
+
+  # --- SCHEDULES (MINUTES FROM MIDNIGHT) ---
+  - entity: time
+    name: Heating start
+    icon: mdi:clock-start
+    dps:
+      - id: 127
+        type: integer
+        name: minute
+        range:
+          min: 0
+          max: 1439
+
+  - entity: time
+    name: Heating end
+    icon: mdi:clock-end
+    dps:
+      - id: 128
+        type: integer
+        name: minute
+        range:
+          min: 0
+          max: 1439
+
+  - entity: time
+    name: Filtration start
+    icon: mdi:clock-start
+    dps:
+      - id: 137
+        type: integer
+        name: minute
+        range:
+          min: 0
+          max: 1439
+
+  - entity: time
+    name: Filtration end
+    icon: mdi:clock-end
+    dps:
+      - id: 138
+        type: integer
+        name: minute
+        range:
+          min: 0
+          max: 1439
+
+  # --- SENSORS ---
+  - entity: sensor
+    class: power
+    dps:
+      - id: 102
+        type: integer
+        name: sensor
+        unit: W
+
+  - entity: sensor
+    class: voltage
+    dps:
+      - id: 101
+        type: integer
+        name: sensor
+        unit: V
+
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 45
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 45
+        type: bitfield
+        name: fault_code