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

Merge C and F configs for Jiahong thermostat by adding a select option for the units.

Modifies PR #181
Jason Rumney 3 лет назад
Родитель
Сommit
ae2ae123af

+ 3 - 1
ACKNOWLEDGEMENTS.md

@@ -91,4 +91,6 @@ Further device support has been made with the assistance of users.  Please consi
 - [Swiftnesses](https://github.com/Swiftnesses) for assistance with Devola patio heaters.
 - [odeBuXTeR](https://github.com/odeBuXTeR) for contributing support for Poolex Q-line pool heatpumps.
 - [peterforeman](https:github.com/peterforeman) for assistance with improving Fairland/Madimack support.
-- [Krispkiwi](https://github.com/Krispkiwi) for assistance with M027 curtain modules.
+- [Krispkiwi](https://github.com/Krispkiwi) for assistance with M027 curtain modules and debugging Kogan Kettle.
+- [craibo](https://github.com/craibo) for contributing support for Jiahong ET-72W thermostats.
+- [x-keita](https://github.com/x-keita) for contributing support for Betterlife BL1500 IR heaters.

+ 2 - 0
README.md

@@ -46,6 +46,7 @@ the device will not work despite being listed below.
 - Ecostrad Accent iQ heating panels
 - Ecostrad iQ Ceramic radiators
 - Devola Patio heater
+- Betterlife BT1500 IR heater
 
 ### Air Conditioners / Heatpumps
 
@@ -91,6 +92,7 @@ the device will not work despite being listed below.
 - Beok TR9B thermostat _(rebadged as Vancoo and perhaps others)_
 - Hysen HY08WE-2 thermostat
 - Nashone MTS-700-WB thermostat smartplug
+- Jiahong ET-72W thermostat
 
 ### Fans
 - Goldair GCPF315 fan

+ 59 - 16
custom_components/tuya_local/devices/jiahong_et72w_thermostat_c.yaml → custom_components/tuya_local/devices/jiahong_et72w_thermostat.yaml

@@ -1,4 +1,4 @@
-name: Jiahong ET-72W Thermostat (C)
+name: Jiahong ET-72W Thermostat
 primary_entity:
   entity: climate
   dps:
@@ -18,6 +18,13 @@ primary_entity:
       mapping:
         - scale: 10
           step: 5
+          constraint: temperature_unit
+          conditions:
+            - dps_val: true
+              step: 30
+              range:
+                min: 120
+                max: 750
     - id: 103
       type: string
       name: hvac_mode
@@ -30,7 +37,6 @@ primary_entity:
               value: auto
             - dps_val: false
               value_redirect: power
-              value: "off"
         - dps_val: "Manual"
           icon: "mdi:fire"
           constraint: power
@@ -48,7 +54,6 @@ primary_entity:
               value: cool
             - dps_val: false
               value_redirect: power
-              value: "off"
     - id: 105
       type: integer
       name: current_temperature
@@ -65,26 +70,22 @@ primary_entity:
     - id: 106
       type: integer
       name: floor_temperature
-      readonly: true
+      hidden: true
       mapping:
         - scale: 10
     - id: 107
       name: temperature_unit
       type: boolean
-      readonly: true
+      hidden: true
       mapping:
         - dps_val: false
-          value: "C"
+          value: C
         - dps_val: true
-          value: "F"
+          value: F
     - id: 111
       type: string
       name: sensor
-      readonly: true
-    - id: 116
-      type: integer
-      name: energy_calibration
-      readonly: true
+      hidden: true
     - id: 118
       type: boolean
       name: hvac_action
@@ -144,10 +145,18 @@ secondary_entities:
       - id: 105
         type: integer
         name: sensor
-        unit: C
         class: measurement
         mapping:
           - scale: 10
+      - id: 107
+        name: unit
+        type: boolean
+        hidden: true
+        mapping:
+          - dps_val: false
+            value: C
+            dps_val: true
+            value: F
   - entity: sensor
     name: Floor Temperature
     class: temperature
@@ -157,10 +166,18 @@ secondary_entities:
       - id: 106
         type: integer
         name: sensor
-        unit: C
         class: measurement
         mapping:
           - scale: 10
+      - id: 107
+        name: unit
+        type: boolean
+        hidden: true
+        mapping:
+          - dps_val: false
+            value: C
+            dps_val: true
+            value: F
   - entity: sensor
     name: Energy
     class: energy
@@ -173,6 +190,24 @@ secondary_entities:
         class: total_increasing
         mapping:
           - scale: 10
+      - id: 116
+        type: integer
+        name: energy_calibration
+        readonly: true
+  - entity: select
+    category: config
+    name: Temperature Unit
+    dps:
+      - id: 107
+        name: option
+        type: boolean
+        mapping:
+          - dps_val: false
+            value: Celsius
+            icon: "mdi:temperature-celsius"
+          - dps_val: true
+            value: Fahrenheit
+            icon: "mdi:temperature-fahrenheit"
   - entity: number
     category: config
     name: Room Temperature Limit
@@ -181,13 +216,21 @@ secondary_entities:
       - id: 121
         type: integer
         name: value
-        unit: C
         range:
           min: 100
           max: 400
         mapping:
           - scale: 10
             step: 5
+      - id: 107
+        name: unit
+        type: boolean
+        hidden: true
+        mapping:
+          - dps_val: false
+            value: C
+            dps_val: true
+            value: F
   - entity: select
     category: config
     name: Temperature Sensor
@@ -222,4 +265,4 @@ secondary_entities:
           - dps_val: 2
             value: "7 (Adaptive)"
           - dps_val: 3
-            value: "5+1+1 (Adaptive)"
+            value: "5+1+1 (Adaptive)"

+ 0 - 225
custom_components/tuya_local/devices/jiahong_et72w_thermostat_f.yaml

@@ -1,225 +0,0 @@
-name: Jiahong ET-72W Thermostat (F)
-primary_entity:
-  entity: climate
-  dps:
-    - id: 101
-      type: boolean
-      name: power
-      mapping:
-        - dps_val: false
-          value: "off"
-      hidden: true
-    - id: 102
-      type: integer
-      name: temperature
-      range:
-        min: 120
-        max: 750
-      mapping:
-        - step: 30
-          scale: 10
-    - id: 103
-      type: string
-      name: hvac_mode
-      mapping:
-        - dps_val: "Smart"
-          icon: "mdi:calendar-sync"
-          constraint: power
-          conditions:
-            - dps_val: true
-              value: auto
-            - dps_val: false
-              value_redirect: power
-              value: "off"
-        - dps_val: "Manual"
-          icon: "mdi:fire"
-          constraint: power
-          conditions:
-            - dps_val: true
-              value: heat
-            - dps_val: false
-              value_redirect: power
-              value: "off"
-        - dps_val: "Anti_frozen"
-          icon: "mdi:snowflake"
-          constraint: power
-          conditions:
-            - dps_val: true
-              value: cool
-            - dps_val: false
-              value_redirect: power
-              value: "off"
-    - id: 105
-      type: integer
-      name: current_temperature
-      readonly: true
-      mapping:
-        - constraint: sensor
-          conditions:
-            - dps_val: '0'
-              scale: 10
-            - dps_val: '1'
-              value_redirect: floor_temperature
-            - dps_val: '2'
-              scale: 10
-    - id: 106
-      type: integer
-      name: floor_temperature
-      readonly: true
-      mapping:
-        - scale: 10
-    - id: 107
-      name: temperature_unit
-      type: boolean
-      readonly: true
-      mapping:
-        - dps_val: false
-          value: "C"
-        - dps_val: true
-          value: "F"
-    - id: 111
-      type: string
-      name: sensor
-      readonly: true
-    - id: 116
-      type: integer
-      name: energy_calibration
-      readonly: true
-    - id: 118
-      type: boolean
-      name: hvac_action
-      readonly: true
-      mapping:
-        - dps_val: true
-          constraint: power
-          conditions:
-            - dps_val: true
-              value: heating
-            - dps_val: false
-              value_redirect: power
-              value: "off"
-        - dps_val: false
-          constraint: power
-          conditions:
-            - dps_val: true
-              value: idle
-            - dps_val: false
-              value_redirect: power
-              value: "off"
-    - id: 104
-      type: integer
-      name: unknown_104
-      readonly: true
-    - id: 109
-      type: boolean
-      name: unknown_109
-      readonly: true
-    - id: 112
-      type: integer
-      name: unknown_112
-      readonly: true
-    - id: 113
-      type: integer
-      name: unknown_113
-      readonly: true
-secondary_entities:
-  - entity: lock
-    name: Screen Lock
-    category: config
-    dps:
-      - id: 108
-        type: boolean
-        name: lock
-        mapping:
-          - dps_val: true
-            icon: "mdi:hand-back-right-off"
-          - dps_val: false
-            icon: "mdi:hand-back-right"
-  - entity: sensor
-    name: Room Temperature
-    class: temperature
-    readonly: true
-    icon: "mdi:home-thermometer"
-    dps:
-      - id: 105
-        type: integer
-        name: sensor
-        unit: F
-        class: measurement
-        mapping:
-          - scale: 10
-  - entity: sensor
-    name: Floor Temperature
-    class: temperature
-    readonly: true
-    icon: "mdi:thermometer-lines"
-    dps:
-      - id: 106
-        type: integer
-        name: sensor
-        unit: F
-        class: measurement
-        mapping:
-          - scale: 10
-  - entity: sensor
-    name: Energy
-    class: energy
-    readonly: true
-    dps:
-      - id: 117
-        type: integer
-        name: sensor
-        unit: kWh
-        class: total_increasing
-        mapping:
-          - scale: 10
-  - entity: number
-    category: config
-    name: Room Temperature Limit
-    icon: "mdi:thermometer-chevron-down"
-    dps:
-      - id: 121
-        type: integer
-        name: value
-        unit: F
-        range:
-          min: 120
-          max: 750
-        mapping:
-          - step: 30
-            scale: 10
-  - entity: select
-    category: config
-    name: Temperature Sensor
-    icon: "mdi:thermometer-check"
-    dps:
-      - id: 111
-        type: string
-        name: option
-        mapping:
-          - dps_val: "0"
-            value: "Room"
-            icon: "mdi:home-thermometer"
-          - dps_val: "1"
-            value: "Floor"
-            icon: "mdi:heating-coil"
-          - dps_val: '2'
-            value: "Both"
-            icon: "mdi:thermometer"
-  - entity: select
-    category: config
-    name: Auto Schedule
-    icon: "mdi:calendar-sync"
-    dps:
-      - id: 110
-        type: integer
-        name: option
-        mapping:
-          - dps_val: 0
-            value: "7"
-          - dps_val: 1
-            value: "5+1+1"
-          - dps_val: 2
-            value: "7 (Adaptive)"
-          - dps_val: 3
-            value: "5+1+1 (Adaptive)"