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

Standardize problem binary sensors

- always use a problem binary sensor for error dps
- where dp is a bitfield, always include the raw value as a fault_code
  attribute on the problem binary sensor
- where a mapping to strings exists, always include it as a
  description attribute on the problem binary sensor
- include any other error related attributes on the problem sensor
- for vacuum entities that do not have error in the status, include
  the error attribute as hidden (as it duplicates the problem sensor
- update tests for the changes

Additionally there was some superfluous icon logic cleanup and other
minor improvements spotted while going through.
Jason Rumney 1 год назад
Родитель
Сommit
e940d593eb
100 измененных файлов с 884 добавлено и 708 удалено
  1. 18 15
      custom_components/tuya_local/devices/AlecoAir_D25_Traditio.yaml
  2. 3 3
      custom_components/tuya_local/devices/ZC34T-03-3A_swing_arm_opener.yaml
  3. 62 46
      custom_components/tuya_local/devices/abir_x8_vacuum.yaml
  4. 14 3
      custom_components/tuya_local/devices/akai_dryer.yaml
  5. 14 11
      custom_components/tuya_local/devices/alecoair_d12_dehumidifier.yaml
  6. 3 8
      custom_components/tuya_local/devices/alecoair_d12_home_dehumidifier.yaml
  7. 16 21
      custom_components/tuya_local/devices/alecoair_d14_dehumidifier.yaml
  8. 14 28
      custom_components/tuya_local/devices/alecoair_d16_dehumidifier.yaml
  9. 15 6
      custom_components/tuya_local/devices/andersson_gsh_heater.yaml
  10. 5 2
      custom_components/tuya_local/devices/aquaforte_vsp_poolpump.yaml
  11. 3 3
      custom_components/tuya_local/devices/aquatech_x6_water_heater.yaml
  12. 3 3
      custom_components/tuya_local/devices/arlec_12speed_tower_fan.yaml
  13. 3 3
      custom_components/tuya_local/devices/arlec_19speed_fan.yaml
  14. 3 3
      custom_components/tuya_local/devices/arlec_6speed_fan.yaml
  15. 14 7
      custom_components/tuya_local/devices/arlec_pa1123bkha_portable_air_conditioner.yaml
  16. 14 8
      custom_components/tuya_local/devices/arlec_panel_heater.yaml
  17. 4 0
      custom_components/tuya_local/devices/arlec_rf_transmitter.yaml
  18. 4 3
      custom_components/tuya_local/devices/arlec_thermostat_smartplug.yaml
  19. 3 0
      custom_components/tuya_local/devices/asip_0622_planter.yaml
  20. 4 1
      custom_components/tuya_local/devices/aubess_rainpoint_irrigation_system.yaml
  21. 3 3
      custom_components/tuya_local/devices/avatto_wt100_thermostat.yaml
  22. 14 6
      custom_components/tuya_local/devices/awow_th213_thermostat.yaml
  23. 3 6
      custom_components/tuya_local/devices/awow_th213v2_thermostat.yaml
  24. 0 1
      custom_components/tuya_local/devices/beca_bht006_thermostat_c.yaml
  25. 3 3
      custom_components/tuya_local/devices/beok_tgm50_thermostat.yaml
  26. 3 3
      custom_components/tuya_local/devices/beok_tgr81_thermostat_c.yaml
  27. 3 3
      custom_components/tuya_local/devices/beok_tol47_thermostat.yaml
  28. 3 3
      custom_components/tuya_local/devices/beok_tr8b_thermostat.yaml
  29. 5 0
      custom_components/tuya_local/devices/ble_hu06_lock.yaml
  30. 22 4
      custom_components/tuya_local/devices/blitzwolf_bwsh5_humidifier.yaml
  31. 3 3
      custom_components/tuya_local/devices/blumfeldt_cosmicbeam_heater.yaml
  32. 18 4
      custom_components/tuya_local/devices/bresser_weather_station.yaml
  33. 3 3
      custom_components/tuya_local/devices/breville_airdynamic3d_fan.yaml
  34. 4 0
      custom_components/tuya_local/devices/breville_lad208_dehumidifier.yaml
  35. 16 14
      custom_components/tuya_local/devices/bwt_heatpump.yaml
  36. 0 1
      custom_components/tuya_local/devices/calex_convector_heater.yaml
  37. 1 0
      custom_components/tuya_local/devices/carro_ph805_humidifier.yaml
  38. 6 10
      custom_components/tuya_local/devices/carson_cb.yaml
  39. 14 13
      custom_components/tuya_local/devices/casdon_td_pro_2.yaml
  40. 3 3
      custom_components/tuya_local/devices/cleverio_ad100_dehumidifier.yaml
  41. 3 3
      custom_components/tuya_local/devices/confortotal_minisplit.yaml
  42. 3 3
      custom_components/tuya_local/devices/daewoo_dhome_heatpump.yaml
  43. 3 3
      custom_components/tuya_local/devices/daizuki_heatpump.yaml
  44. 18 18
      custom_components/tuya_local/devices/deakon_evi_waterheatpump.yaml
  45. 3 3
      custom_components/tuya_local/devices/della_airconditioner.yaml
  46. 4 0
      custom_components/tuya_local/devices/depuley_smart_ceiling_fan.yaml
  47. 3 3
      custom_components/tuya_local/devices/djive_arc_fan.yaml
  48. 15 15
      custom_components/tuya_local/devices/doel_tiplus_litterbox.yaml
  49. 14 3
      custom_components/tuya_local/devices/dongguan_electric_curtain.yaml
  50. 3 3
      custom_components/tuya_local/devices/dry_pury_evo_dehumidifier.yaml
  51. 4 4
      custom_components/tuya_local/devices/dts238_7_energy_meter.yaml
  52. 4 4
      custom_components/tuya_local/devices/dual_power_monitor_smartplugv2.yaml
  53. 16 8
      custom_components/tuya_local/devices/eanons_humidifier.yaml
  54. 46 17
      custom_components/tuya_local/devices/ebac_dj4000_dehumidifier.yaml
  55. 16 16
      custom_components/tuya_local/devices/eeese_carl_dehumidifier.yaml
  56. 19 19
      custom_components/tuya_local/devices/eeese_otto_dehumidifier.yaml
  57. 0 17
      custom_components/tuya_local/devices/eesee_adam_dehumidifier.yaml
  58. 3 3
      custom_components/tuya_local/devices/electric_panel_heater.yaml
  59. 15 14
      custom_components/tuya_local/devices/electriq_cd12pro_dehumidifier.yaml
  60. 15 12
      custom_components/tuya_local/devices/electriq_cd12pwv2_dehumidifier.yaml
  61. 7 10
      custom_components/tuya_local/devices/elspet_cat_litterbox.yaml
  62. 3 3
      custom_components/tuya_local/devices/ems_waterheater.yaml
  63. 3 3
      custom_components/tuya_local/devices/emylo_energy_meter.yaml
  64. 3 3
      custom_components/tuya_local/devices/etersky_aroma_diffuser.yaml
  65. 3 6
      custom_components/tuya_local/devices/eurom_600_heater.yaml
  66. 3 6
      custom_components/tuya_local/devices/eurom_600_heater_v2.yaml
  67. 3 3
      custom_components/tuya_local/devices/eurom_601_heater.yaml
  68. 3 3
      custom_components/tuya_local/devices/eurom_alutherm_heater.yaml
  69. 3 3
      custom_components/tuya_local/devices/eurom_alutherm_heater_v2.yaml
  70. 14 6
      custom_components/tuya_local/devices/eurom_sani_bathroom_towel_radiator.yaml
  71. 24 28
      custom_components/tuya_local/devices/evotherm_eti_heatpump.yaml
  72. 21 13
      custom_components/tuya_local/devices/fairland_iphcr15_heatpump.yaml
  73. 17 12
      custom_components/tuya_local/devices/ferroli_titano_twin.yaml
  74. 0 1
      custom_components/tuya_local/devices/fisher_summer_air_conditioner.yaml
  75. 21 13
      custom_components/tuya_local/devices/gardenpac_heatpump.yaml
  76. 3 0
      custom_components/tuya_local/devices/garza_irrigation_system.yaml
  77. 27 22
      custom_components/tuya_local/devices/geyserwise_water_heater.yaml
  78. 16 34
      custom_components/tuya_local/devices/goldair_dehumidifier.yaml
  79. 3 6
      custom_components/tuya_local/devices/goldair_geco_heater.yaml
  80. 3 6
      custom_components/tuya_local/devices/goldair_gpcv_heater.yaml
  81. 3 17
      custom_components/tuya_local/devices/goldair_gpdh340_dehumidifier.yaml
  82. 9 11
      custom_components/tuya_local/devices/goldair_gpph_heater.yaml
  83. 14 3
      custom_components/tuya_local/devices/goodcell_ev_charger.yaml
  84. 15 3
      custom_components/tuya_local/devices/greenwind_dehumidifier.yaml
  85. 2 0
      custom_components/tuya_local/devices/heatstorm_dh100twi_heater.yaml
  86. 2 0
      custom_components/tuya_local/devices/heatstorm_hs1500_heater.yaml
  87. 15 10
      custom_components/tuya_local/devices/heatstorm_hs6000gc_heater.yaml
  88. 3 3
      custom_components/tuya_local/devices/hiper_bladeless_fan.yaml
  89. 3 3
      custom_components/tuya_local/devices/hjz_radiator.yaml
  90. 24 10
      custom_components/tuya_local/devices/honeywell_dehumidifier.yaml
  91. 17 4
      custom_components/tuya_local/devices/hyd_weair_plus_fan.yaml
  92. 3 3
      custom_components/tuya_local/devices/hydrotherm_dynamic_x8_water_heater.yaml
  93. 3 3
      custom_components/tuya_local/devices/hysen_hy08acf_thermostat.yaml
  94. 3 3
      custom_components/tuya_local/devices/hysen_hy08we2_thermostat.yaml
  95. 5 16
      custom_components/tuya_local/devices/hyundai_sahara_dehumidifier.yaml
  96. 16 0
      custom_components/tuya_local/devices/ihome_autovac_nova.yaml
  97. 4 4
      custom_components/tuya_local/devices/inkbird_bbq4t_thermometer.yaml
  98. 4 3
      custom_components/tuya_local/devices/inkbird_bbq4t_thermometerv2.yaml
  99. 3 3
      custom_components/tuya_local/devices/inkbird_ibbq4bw_thermometer.yaml
  100. 3 3
      custom_components/tuya_local/devices/inkbird_ihc200_humiditycontroller.yaml

+ 18 - 15
custom_components/tuya_local/devices/AlecoAir_D25_Traditio.yaml

@@ -1,7 +1,7 @@
 name: Dehumidifier
-products:
-  - id: bf1872f920fbb07813iiwn
-    name: AlecoAir D25
+# products:
+#   - id: UNKNOWN
+#     name: AlecoAir D25
 primary_entity:
   entity: humidifier
   class: dehumidifier
@@ -34,18 +34,6 @@ primary_entity:
     - id: 6
       type: integer
       name: current_humidity
-    - id: 19
-      name: fault_code
-      type: bitfield
-      # Docs mention E1 and E2, it isn't clear which is tank full, so for now
-      # treat both as that.
-      mapping:
-        - dps_val: 0
-          value: OK
-        - dps_val: 1
-          value: E1
-        - dps_val: 2
-          value: E2
 secondary_entities:
   - entity: fan
     dps:
@@ -87,7 +75,22 @@ secondary_entities:
         mapping:
           - dps_val: 0
             value: false
+            # Docs mention E1 and E2, it isn't clear which is tank full,
+            # so for now treat both as that.
           - value: true
+      - id: 19
+        name: fault_code
+        type: bitfield
+      - id: 19
+        type: bitfield
+        name: description
+        mapping:
+          - dps_val: 0
+            value: OK
+          - dps_val: 1
+            value: E1
+          - dps_val: 2
+            value: E2
   - entity: lock
     translation_key: child_lock
     category: config

+ 3 - 3
custom_components/tuya_local/devices/ZC34T-03-3A_swing_arm_opener.yaml

@@ -16,9 +16,6 @@ primary_entity:
           value: close
         - dps_val: stop
           value: stop
-    - id: 105
-      type: string
-      name: fault
 secondary_entities:
   - entity: lock
     dps:
@@ -67,6 +64,9 @@ secondary_entities:
           - dps_val: ""
             value: false
           - value: true
+      - id: 105
+        type: string
+        name: description
   - entity: switch
     name: Push notifications
     icon: "mdi:message-alert-outline"

+ 62 - 46
custom_components/tuya_local/devices/abir_x8_vacuum.yaml

@@ -112,52 +112,6 @@ primary_entity:
       type: string
       name: request
       optional: true
-    - id: 28
-      type: bitfield
-      name: error
-      mapping:
-        - dps_val: 2
-          value: left_wheel_hanging
-        - dps_val: 4
-          value: main_brush_stuck
-        - dps_val: 8
-          value: right_wheel_hanging
-        - dps_val: 16
-          value: left_wheel_jammed
-        - dps_val: 32
-          value: right_wheel_jammed
-        - dps_val: 64
-          value: cliff
-        - dps_val: 128
-          value: edge_sweeper_worn
-        - dps_val: 512
-          value: collision
-        - dps_val: 1024
-          value: dust_full
-        - dps_val: 4096
-          value: land_check
-        - dps_val: 32768
-          value: motor_jammed
-        - dps_val: 65536
-          value: overcurrent
-        - dps_val: 131072
-          value: docking_failure
-        - dps_val: 524288
-          value: jammed
-        - dps_val: 1048576
-          value: trapped
-        - dps_val: 2097152
-          value: laser_cover_stuck
-        - dps_val: 4194304
-          value: laser_blocked
-        - dps_val: 8388608
-          value: wall_sensors_blocked
-        - dps_val: 16777216
-          value: exclusion_zone_invalid
-        - dps_val: 33554432
-          value: charging_failure
-        - dps_val: 67108864
-          value: picked_up
     - id: 35
       type: string
       name: voice_data
@@ -254,6 +208,68 @@ secondary_entities:
       - id: 27
         type: boolean
         name: switch
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 28
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 28
+        type: bitfield
+        name: fault_code
+      - id: 28
+        type: bitfield
+        name: description
+        mapping:
+          - dps_val: 0
+            value: ok
+          - dps_val: 2
+            value: left_wheel_hanging
+          - dps_val: 4
+            value: main_brush_stuck
+          - dps_val: 8
+            value: right_wheel_hanging
+          - dps_val: 16
+            value: left_wheel_jammed
+          - dps_val: 32
+            value: right_wheel_jammed
+          - dps_val: 64
+            value: cliff
+          - dps_val: 128
+            value: edge_sweeper_worn
+          - dps_val: 512
+            value: collision
+          - dps_val: 1024
+            value: dust_full
+          - dps_val: 4096
+            value: land_check
+          - dps_val: 32768
+            value: motor_jammed
+          - dps_val: 65536
+            value: overcurrent
+          - dps_val: 131072
+            value: docking_failure
+          - dps_val: 524288
+            value: jammed
+          - dps_val: 1048576
+            value: trapped
+          - dps_val: 2097152
+            value: laser_cover_stuck
+          - dps_val: 4194304
+            value: laser_blocked
+          - dps_val: 8388608
+            value: wall_sensors_blocked
+          - dps_val: 16777216
+            value: exclusion_zone_invalid
+          - dps_val: 33554432
+            value: charging_failure
+          - dps_val: 67108864
+            value: picked_up
   - entity: switch
     name: Cliff detect
     category: config

+ 14 - 3
custom_components/tuya_local/devices/akai_dryer.yaml

@@ -25,10 +25,21 @@ primary_entity:
           value: "end"
         - dps_val: "err"
           value: "error"
-    - id: 7
-      name: fault_code
-      type: integer
 secondary_entities:
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 7
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 7
+        type: bitfield
+        name: fault_code
   - entity: button
     name: Start
     icon: "mdi:play"

+ 14 - 11
custom_components/tuya_local/devices/alecoair_d12_dehumidifier.yaml

@@ -31,17 +31,6 @@ primary_entity:
     - id: 6
       name: current_humidity
       type: integer
-    - id: 19
-      name: error
-      type: bitfield
-      # E2 might be a compressor fault.
-      mapping:
-        - dps_val: 0
-          value: OK
-        - dps_val: 1
-          value: "Water Tank Full or Removed"
-        - dps_val: 2
-          value: "E2 Compressor Fault"
 secondary_entities:
   - entity: fan
     dps:
@@ -102,3 +91,17 @@ secondary_entities:
           - dps_val: null
             value: false
           - value: true
+      - id: 19
+        type: bitfield
+        name: fault_code
+      - id: 19
+        name: description
+        type: bitfield
+        mapping:
+          - dps_val: 0
+            value: OK
+          - dps_val: 1
+            value: "Water Tank Full or Removed"
+          - dps_val: 2
+            # E2 might be a compressor fault.
+            value: "E2 Compressor Fault"

+ 3 - 8
custom_components/tuya_local/devices/alecoair_d12_home_dehumidifier.yaml

@@ -28,14 +28,6 @@ primary_entity:
         max: 80
       mapping:
         - step: 5
-    - id: 11
-      name: error
-      type: bitfield
-      mapping:
-        - dps_val: 0
-          value: OK
-        - dps_val: 8
-          value: tank
 secondary_entities:
   - entity: switch
     translation_key: ionizer
@@ -161,6 +153,9 @@ secondary_entities:
           - dps_val: 8
             value: false
           - value: true
+      - id: 11
+        type: bitfield
+        name: fault_code
   - entity: switch
     name: Inside drying
     dps:

+ 16 - 21
custom_components/tuya_local/devices/alecoair_d14_dehumidifier.yaml

@@ -6,13 +6,6 @@ primary_entity:
     - id: 1
       name: switch
       type: boolean
-      mapping:
-        - dps_val: false
-          icon: "mdi:air-humidifier-off"
-          icon_priority: 1
-        - dps_val: true
-          icon: "mdi:air-humidifier"
-          icon_priority: 4
     - id: 2
       name: humidity
       type: integer
@@ -29,27 +22,13 @@ primary_entity:
           value: normal
         - dps_val: laundry
           value: laundry
-          icon: "mdi:tshirt-crew-outline"
-          icon_priority: 3
         - dps_val: purify
           value: purify
-          icon: "mdi:air-filter"
-          icon_priority: 3
         - dps_val: sleep
           value: sleep
-          icon: "mdi:power-sleep"
-          icon_priority: 3
     - id: 16
       type: integer
       name: current_humidity
-    - id: 19
-      type: bitfield
-      name: error
-      mapping:
-        - dps_val: 1
-          icon: "mdi:cup-water"
-          icon_priority: 2
-      hidden: true
 secondary_entities:
   - entity: fan
     dps:
@@ -85,6 +64,17 @@ secondary_entities:
   - entity: binary_sensor
     translation_key: tank_full
     category: diagnostic
+    dps:
+      - id: 19
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 1
+            value: true
+          - value: false
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
     dps:
       - id: 19
         type: bitfield
@@ -92,7 +82,12 @@ secondary_entities:
         mapping:
           - dps_val: 0
             value: false
+          - dps_val: 1
+            value: false
           - value: true
+      - id: 19
+        type: bitfield
+        name: fault_code
   - entity: lock
     translation_key: child_lock
     category: config

+ 14 - 28
custom_components/tuya_local/devices/alecoair_d16_dehumidifier.yaml

@@ -9,13 +9,6 @@ primary_entity:
     - id: 1
       name: switch
       type: boolean
-      mapping:
-        - dps_val: false
-          icon: "mdi:air-humidifier-off"
-          icon_priority: 2
-        - dps_val: true
-          icon: "mdi:air-humidifier"
-          icon_priority: 4
     - id: 2
       name: humidity
       type: integer
@@ -32,34 +25,13 @@ primary_entity:
           value: normal
         - dps_val: laundry
           value: laundry
-          icon: "mdi:tshirt-crew-outline"
-          icon_priority: 3
         - dps_val: purify
           value: purify
-          icon: "mdi:air-filter"
-          icon_priority: 3
         - dps_val: sleep
           value: sleep
-          icon: "mdi:power-sleep"
-          icon_priority: 3
     - id: 16
       name: current_humidity
       type: integer
-    - id: 19
-      name: error
-      type: bitfield
-      # E2 might be a compressor fault.
-      mapping:
-        - dps_val: 0
-          value: OK
-        - dps_val: 1
-          value: "Water Tank Full or Removed"
-          icon: "mdi:cup-water"
-          icon_priority: 1
-        - dps_val: 2
-          value: "E2 Compressor Fault"
-          icon: "mdi:engine-off-outline"
-          icon_priority: 1
 secondary_entities:
   - entity: fan
     dps:
@@ -118,6 +90,20 @@ secondary_entities:
           - dps_val: null
             value: false
           - value: true
+      - id: 19
+        type: bitfield
+        name: fault_code
+      - id: 19
+        name: description
+        type: bitfield
+        # E2 might be a compressor fault.
+        mapping:
+          - dps_val: 0
+            value: OK
+          - dps_val: 1
+            value: "Water Tank Full or Removed"
+          - dps_val: 2
+            value: "E2 Compressor Fault"
   - entity: lock
     translation_key: child_lock
     category: config

+ 15 - 6
custom_components/tuya_local/devices/andersson_gsh_heater.yaml

@@ -32,9 +32,18 @@ primary_entity:
           value: boost
         - dps_val: af
           value: away
-    - id: 12
-      name: error
-      type: bitfield
-      mapping:
-        - dps_val: 0
-          value: "OK"
+secondary_entities:
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 12
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 12
+        type: bitfield
+        name: fault_code

+ 5 - 2
custom_components/tuya_local/devices/aquaforte_vsp_poolpump.yaml

@@ -167,10 +167,13 @@ secondary_entities:
         mapping:
           - dps_val: 0
             value: false
-          - default: true
+          - value: true
       - id: 2
         type: bitfield
-        name: fault
+        name: fault_code
+      - id: 2
+        type: bitfield
+        name: description
         mapping:
           - dps_val: 0
             value: "None"

+ 3 - 3
custom_components/tuya_local/devices/aquatech_x6_water_heater.yaml

@@ -36,9 +36,6 @@ primary_entity:
     - id: 7
       type: boolean
       name: defrosting
-    - id: 15
-      type: bitfield
-      name: fault_code
     - id: 16
       type: integer
       name: current_temperature
@@ -54,3 +51,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 15
+        type: bitfield
+        name: fault_code

+ 3 - 3
custom_components/tuya_local/devices/arlec_12speed_tower_fan.yaml

@@ -49,9 +49,6 @@ primary_entity:
     - id: 102
       name: oscillate
       type: boolean
-    - id: 8
-      type: bitfield
-      name: fault_code
 secondary_entities:
   - entity: select
     translation_key: timer
@@ -131,6 +128,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 8
+        type: bitfield
+        name: fault_code
   - entity: sensor
     class: temperature
     category: diagnostic

+ 3 - 3
custom_components/tuya_local/devices/arlec_19speed_fan.yaml

@@ -28,9 +28,6 @@ primary_entity:
     - id: 5
       name: oscillate
       type: boolean
-    - id: 24
-      name: fault_code
-      type: bitfield
 secondary_entities:
   - entity: number
     translation_key: timer
@@ -54,3 +51,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 24
+        name: fault_code
+        type: bitfield

+ 3 - 3
custom_components/tuya_local/devices/arlec_6speed_fan.yaml

@@ -49,9 +49,6 @@ primary_entity:
     - id: 101
       type: boolean
       name: oscillate
-    - id: 8
-      type: bitfield
-      name: fault_code
 secondary_entities:
   - entity: binary_sensor
     class: problem
@@ -64,6 +61,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 8
+        type: bitfield
+        name: fault_code
   - entity: select
     translation_key: timer
     category: config

+ 14 - 7
custom_components/tuya_local/devices/arlec_pa1123bkha_portable_air_conditioner.yaml

@@ -39,18 +39,11 @@ primary_entity:
     - id: 3
       type: integer
       name: current_temperature
-      readonly: true
       mapping:
         - constraint: temperature_unit
           conditions:
             - dps_val: true
               value_redirect: temp_current_f
-    - id: 20
-      name: error
-      type: bitfield
-      mapping:
-        - dps_val: 0
-          value: "OK"
     - id: 101
       name: mode
       type: string
@@ -102,6 +95,20 @@ primary_entity:
       hidden: true
       optional: true
 secondary_entities:
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 20
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 20
+        type: bitfield
+        name: fault_code
   - entity: number
     translation_key: timer
     category: config

+ 14 - 8
custom_components/tuya_local/devices/arlec_panel_heater.yaml

@@ -24,7 +24,6 @@ primary_entity:
     - id: 3
       name: current_temperature
       type: integer
-      readonly: true
     - id: 4
       name: preset_mode
       type: string
@@ -35,13 +34,6 @@ primary_entity:
           value: boost
         - dps_val: af
           value: away
-    - id: 12
-      name: error
-      type: bitfield
-      mapping:
-        - dps_val: 0
-          value: "OK"
-
 secondary_entities:
   - entity: lock
     translation_key: child_lock
@@ -70,3 +62,17 @@ secondary_entities:
         range:
           min: 0
           max: 24
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 12
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 12
+        type: bitfield
+        name: fault_code

+ 4 - 0
custom_components/tuya_local/devices/arlec_rf_transmitter.yaml

@@ -265,3 +265,7 @@ secondary_entities:
           - dps_val: null
             value: false
           - value: true
+      - id: 113
+        type: bitfield
+        optional: true
+        name: fault_code

+ 4 - 3
custom_components/tuya_local/devices/arlec_thermostat_smartplug.yaml

@@ -93,9 +93,6 @@ primary_entity:
     - id: 46
       type: integer
       name: current_humidity
-    - id: 50
-      type: bitfield
-      name: fault_code
 secondary_entities:
   - entity: switch
     class: switch
@@ -290,3 +287,7 @@ secondary_entities:
           - dps_val: null
             value: false
           - value: true
+      - id: 50
+        type: bitfield
+        optional: true
+        name: fault_code

+ 3 - 0
custom_components/tuya_local/devices/asip_0622_planter.yaml

@@ -61,6 +61,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 10
+        type: bitfield
+        name: fault_code
   - entity: select
     name: Watering
     icon: "mdi:watering-can"

+ 4 - 1
custom_components/tuya_local/devices/aubess_rainpoint_irrigation_system.yaml

@@ -105,8 +105,11 @@ secondary_entities:
     dps:
       - id: 105
         name: sensor
-        type: integer
+        type: bitfield
         mapping:
           - dps_val: 0
             value: false
           - value: true
+      - id: 105
+        type: bitfield
+        name: fault_code

+ 3 - 3
custom_components/tuya_local/devices/avatto_wt100_thermostat.yaml

@@ -63,9 +63,6 @@ primary_entity:
               value: "off"
         - dps_val: "1"
           value: heating
-    - id: 16
-      name: fault_code
-      type: bitfield
     - id: 21
       name: max_temperature
       type: integer
@@ -96,6 +93,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 16
+        name: fault_code
+        type: bitfield
   - entity: number
     name: Temperature calibration
     category: config

+ 14 - 6
custom_components/tuya_local/devices/awow_th213_thermostat.yaml

@@ -32,12 +32,6 @@ primary_entity:
           value: activity
         - dps_val: 4
           value: sleep
-    - id: 12
-      type: bitfield
-      name: error
-      mapping:
-        - dps_val: 0
-          value: OK
     - id: 102
       type: integer
       name: sensor
@@ -138,3 +132,17 @@ secondary_entities:
         range:
           min: 1
           max: 9
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 12
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 12
+        type: bitfield
+        name: fault_code

+ 3 - 6
custom_components/tuya_local/devices/awow_th213v2_thermostat.yaml

@@ -32,12 +32,6 @@ primary_entity:
           value: activity
         - dps_val: 4
           value: sleep
-    - id: 12
-      type: bitfield
-      name: error
-      mapping:
-        - dps_val: 0
-          value: OK
     - id: 105
       type: boolean
       name: hvac_action
@@ -121,3 +115,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 12
+        type: bitfield
+        name: fault_code

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

@@ -61,7 +61,6 @@ primary_entity:
     - id: 36
       type: string
       name: hvac_action
-      readonly: true
       mapping:
         - dps_val: close
           constraint: hvac_mode

+ 3 - 3
custom_components/tuya_local/devices/beok_tgm50_thermostat.yaml

@@ -65,9 +65,6 @@ primary_entity:
               value: "off"
         - dps_val: "1"
           value: heating
-    - id: 11
-      name: fault_code
-      type: bitfield
     - id: 15
       name: max_temperature
       type: integer
@@ -90,6 +87,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 11
+        name: fault_code
+        type: bitfield
   - entity: number
     name: Temperature hysteresis
     category: config

+ 3 - 3
custom_components/tuya_local/devices/beok_tgr81_thermostat_c.yaml

@@ -60,9 +60,6 @@ primary_entity:
               value: heating
             - dps_val: false
               value: "off"
-    - id: 45
-      name: fault_code
-      type: bitfield
 secondary_entities:
   - entity: number
     name: Calibration offset
@@ -121,6 +118,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 45
+        name: fault_code
+        type: bitfield
   - entity: number
     name: High temperature limit
     category: config

+ 3 - 3
custom_components/tuya_local/devices/beok_tol47_thermostat.yaml

@@ -57,9 +57,6 @@ primary_entity:
               value: "off"
         - dps_val: "1"
           value: heating
-    - id: 16
-      type: bitfield
-      name: fault_code
 secondary_entities:
   - entity: lock
     translation_key: child_lock
@@ -87,6 +84,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 16
+        type: bitfield
+        name: fault_code
   - entity: number
     name: Calibration offset
     category: config

+ 3 - 3
custom_components/tuya_local/devices/beok_tr8b_thermostat.yaml

@@ -103,9 +103,6 @@ primary_entity:
               value: "off"
             - dps_val: true
               value: idle
-    - id: 45
-      type: bitfield
-      name: fault_code
     - id: 101
       type: bitfield
       name: features
@@ -226,6 +223,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 45
+        type: bitfield
+        name: fault_code
   - entity: sensor
     class: battery
     dps:

+ 5 - 0
custom_components/tuya_local/devices/ble_hu06_lock.yaml

@@ -126,6 +126,11 @@ secondary_entities:
           - dps_val: "13"
             value: true
           - value: false
+      - id: 21
+        type: string
+        name: description
+        optional: true
+        persist: false
   - entity: binary_sensor
     name: Duress
     class: safety

+ 22 - 4
custom_components/tuya_local/devices/blitzwolf_bwsh5_humidifier.yaml

@@ -39,10 +39,6 @@ primary_entity:
     - id: 14
       name: current_humidity
       type: integer
-    - id: 22
-      name: fault_code
-      type: integer
-      optional: true
 secondary_entities:
   - entity: switch
     translation_key: uv_sterilization
@@ -174,7 +170,29 @@ secondary_entities:
     dps:
       - id: 22
         type: bitfield
+        optional: true
         name: sensor
         mapping:
           - dps_val: 1
             value: true
+          - value: false
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 22
+        type: bitfield
+        optional: true
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - dps_val: null
+            value: false
+          - dps_val: 1
+            value: false
+          - value: true
+      - id: 22
+        type: bitfield
+        optional: true
+        name: fault_code

+ 3 - 3
custom_components/tuya_local/devices/blumfeldt_cosmicbeam_heater.yaml

@@ -37,9 +37,6 @@ primary_entity:
           value: eco
         - dps_val: high
           value: boost
-    - id: 12
-      name: fault_code
-      type: bitfield
     - id: 101
       name: temperature_unit
       type: boolean
@@ -125,6 +122,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 12
+        name: fault_code
+        type: bitfield
   - entity: select
     translation_key: temperature_unit
     category: config

+ 18 - 4
custom_components/tuya_local/devices/bresser_weather_station.yaml

@@ -17,10 +17,6 @@ primary_entity:
         mapping:
           - scale: 10
         class: measurement
-    - id: 22
-      type: string
-      name: fault_type
-      optional: true
     - id: 68
       type: string
       name: com_index
@@ -124,6 +120,24 @@ secondary_entities:
             value: fc
           - dps_val: wm2
             value: W/m2
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 22
+        type: string
+        name: sensor
+        optional: true
+        mapping:
+          - dps_val: ""
+            value: false
+          - dps_val: null
+            value: false
+          - value: true
+      - id: 22
+        type: string
+        optional: true
+        name: description
   - entity: binary_sensor
     class: battery
     category: diagnostic

+ 3 - 3
custom_components/tuya_local/devices/breville_airdynamic3d_fan.yaml

@@ -33,9 +33,6 @@ primary_entity:
     - id: 5
       type: boolean
       name: oscillate
-    - id: 24
-      type: bitfield
-      name: fault_code
 secondary_entities:
   - entity: switch
     name: Vertical oscillation
@@ -107,3 +104,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 24
+        type: bitfield
+        name: fault_code

+ 4 - 0
custom_components/tuya_local/devices/breville_lad208_dehumidifier.yaml

@@ -181,3 +181,7 @@ secondary_entities:
           - dps_val: null
             value: false
           - value: true
+      - id: 11
+        type: bitfield
+        optional: true
+        name: fault_code

+ 16 - 14
custom_components/tuya_local/devices/bwt_heatpump.yaml

@@ -9,12 +9,8 @@ primary_entity:
       mapping:
         - dps_val: false
           value: "off"
-          icon: "mdi:hvac-off"
-          icon_priority: 1
         - dps_val: true
           value: "heat"
-          icon: "mdi:hot-tub"
-          icon_priority: 3
     - id: 2
       name: temperature
       type: integer
@@ -43,21 +39,22 @@ primary_entity:
           value: quiet_cool
         - dps_val: auto
           value: auto
-    - id: 9
-      type: integer
-      name: error
-      mapping:
-        - dps_val: 0
-          value: "OK"
-        - dps_val: 1
-          value: "Water Flow Protection"
-          icon: "mdi:water-pump-off"
-          icon_priority: 2
 secondary_entities:
   - entity: binary_sensor
     class: problem
     name: Water flow
     category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 1
+            value: true
+          - value: false
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
     dps:
       - id: 9
         type: bitfield
@@ -65,4 +62,9 @@ secondary_entities:
         mapping:
           - dps_val: 0
             value: false
+          - dps_val: 1
+            value: false
           - value: true
+      - id: 9
+        type: bitfield
+        name: fault_code

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

@@ -23,7 +23,6 @@ primary_entity:
         max: 35
     - id: 3
       name: current_temperature
-      readonly: true
       type: integer
       unit: C
       range:

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

@@ -104,6 +104,7 @@ secondary_entities:
         type: bitfield
         name: sensor
         mapping:
+          # not sure which value is actually the tank empty flag
           - dps_val: 0
             value: false
           - value: true

+ 6 - 10
custom_components/tuya_local/devices/carson_cb.yaml

@@ -67,16 +67,9 @@ primary_entity:
           value: "vertical"
         - dps_val: false
           value: "off"
-    - id: 106
-      name: fault_code
-      type: bitfield
     - id: 110
       name: model_code
       type: integer
-    - id: 111
-      name: fault_code2
-      type: bitfield
-      optional: true
 secondary_entities:
   - entity: select
     translation_key: temperature_unit
@@ -134,7 +127,7 @@ secondary_entities:
         name: sensor
         mapping:
           - dps_val: 0
-            constraint: fault_code2
+            constraint: fault_code_2
             conditions:
               - dps_val: 0
                 value: false
@@ -142,8 +135,11 @@ secondary_entities:
                 value: false
             value: true
           - value: true
+      - id: 106
+        name: fault_code
+        type: bitfield
       - id: 111
         type: bitfield
-        name: fault_code2
+        name: fault_code_2
         optional: true
-        hidden: true
+

+ 14 - 13
custom_components/tuya_local/devices/casdon_td_pro_2.yaml

@@ -138,7 +138,6 @@ secondary_entities:
       - id: 11
         name: sensor
         type: integer
-        readonly: true
         range:
           min: 0
           max: 1440
@@ -158,27 +157,30 @@ secondary_entities:
           - value: true
       - id: 13
         type: bitfield
-        name: fault_message
+        name: fault_code
+      - id: 13
+        type: bitfield
+        name: description
         mapping:
-          - value: "OK"
+          - value: unknown
           - dps_val: 0
-            value: "OK"
+            value: OK
           - dps_val: 1
-            value: "e1"
+            value: e1
           - dps_val: 2
-            value: "e2"
+            value: e2
           - dps_val: 4
-            value: "e3"
+            value: e3
           - dps_val: 8
-            value: "e4"
+            value: e4
           - dps_val: 16
-            value: "e5"
+            value: e5
           - dps_val: 32
-            value: "e6"
+            value: e6
           - dps_val: 64
-            value: "e7"
+            value: e7
           - dps_val: 128
-            value: "e8"
+            value: e8
 
   - entity: sensor
     class: enum
@@ -187,7 +189,6 @@ secondary_entities:
       - id: 102
         name: sensor
         type: string
-        readonly: true
         mapping:
           - dps_val: wait
             value: wait

+ 3 - 3
custom_components/tuya_local/devices/cleverio_ad100_dehumidifier.yaml

@@ -18,9 +18,6 @@ primary_entity:
           value: sleep
         - dps_val: High
           value: strong
-    - id: 12
-      type: integer
-      name: fault_code
 secondary_entities:
   - entity: binary_sensor
     class: problem
@@ -33,6 +30,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 12
+        type: bitfield
+        name: fault_code
   - entity: switch
     name: Air purifier
     category: config

+ 3 - 3
custom_components/tuya_local/devices/confortotal_minisplit.yaml

@@ -115,9 +115,6 @@ primary_entity:
           value: high
         - dps_val: mute
           value: quiet
-    - id: 22
-      type: bitfield
-      name: fault_code
     - id: 25
       name: preset_mode
       type: boolean
@@ -153,6 +150,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 22
+        type: bitfield
+        name: fault_code
   - entity: select
     name: Vertical swing
     icon: "mdi:angle-acute"

+ 3 - 3
custom_components/tuya_local/devices/daewoo_dhome_heatpump.yaml

@@ -44,9 +44,6 @@ primary_entity:
           value: low
         - dps_val: Hig
           value: high
-    - id: 22
-      type: bitfield
-      name: fault_code
     - id: 101
       type: boolean
       name: preset_mode
@@ -67,3 +64,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 22
+        type: bitfield
+        name: fault_code

+ 3 - 3
custom_components/tuya_local/devices/daizuki_heatpump.yaml

@@ -56,9 +56,6 @@ primary_entity:
           value: high
         - dps_val: strong
           value: strong
-    - id: 20
-      type: bitfield
-      name: fault_code
     - id: 105
       type: string
       name: sleep_mode
@@ -250,6 +247,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 20
+        type: bitfield
+        name: fault_code
   - entity: sensor
     class: pm25
     category: diagnostic

+ 18 - 18
custom_components/tuya_local/devices/deakon_evi_waterheatpump.yaml

@@ -57,24 +57,6 @@ primary_entity:
           value: defrosting
         - dps_val: antifrozen
           value: heating
-    - id: 109
-      type: string
-      name: error_code_table
-    - id: 110
-      type: string
-      name: error_code_table2
-    - id: 111
-      type: string
-      name: driver_error_code1
-    - id: 112
-      type: string
-      name: driver_error_code2
-    - id: 113
-      type: string
-      name: sen_sys_error_code1
-    - id: 114
-      type: string
-      name: sen_sys_error_code2
 secondary_entities:
   - entity: select
     name: Combined mode
@@ -125,6 +107,24 @@ secondary_entities:
       - id: 13
         type: bitfield
         name: fault_code
+      - id: 109
+        type: string
+        name: error_code_table
+      - id: 110
+        type: string
+        name: error_code_table2
+      - id: 111
+        type: string
+        name: driver_error_code1
+      - id: 112
+        type: string
+        name: driver_error_code2
+      - id: 113
+        type: string
+        name: sen_sys_error_code1
+      - id: 114
+        type: string
+        name: sen_sys_error_code2
   - entity: binary_sensor
     name: Anti-freeze
     class: cold

+ 3 - 3
custom_components/tuya_local/devices/della_airconditioner.yaml

@@ -77,9 +77,6 @@ primary_entity:
           value: vertical
         - dps_val: false
           value: "off"
-    - id: 107
-      type: bitfield
-      name: fault_code
 secondary_entities:
   - entity: switch
     name: Emergency heat
@@ -160,3 +157,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 107
+        type: bitfield
+        name: fault_code

+ 4 - 0
custom_components/tuya_local/devices/depuley_smart_ceiling_fan.yaml

@@ -217,6 +217,10 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 56
+        type: bitfield
+        optional: true
+        name: fault_code
   - entity: switch
     category: config
     name: Beep

+ 3 - 3
custom_components/tuya_local/devices/djive_arc_fan.yaml

@@ -32,9 +32,6 @@ primary_entity:
     - id: 5
       type: boolean
       name: oscillate
-    - id: 24
-      type: bitfield
-      name: fault_code
 secondary_entities:
   - entity: select
     category: config
@@ -66,6 +63,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 24
+        type: bitfield
+        name: fault_code
   - entity: switch
     translation_key: uv_sterilization
     dps:

+ 15 - 15
custom_components/tuya_local/devices/doel_tiplus_litterbox.yaml

@@ -59,21 +59,6 @@ secondary_entities:
       - id: 22
         type: bitfield
         name: fault_code
-      - id: 120
-        type: boolean
-        name: unknown_120
-      - id: 127
-        type: boolean
-        name: soft_mode
-      - id: 128
-        type: boolean
-        name: unknown_128
-      - id: 129
-        type: integer
-        name: unknown_129
-      - id: 135
-        type: boolean
-        name: dp_developer_mode
   - entity: button
     name: Clean
     icon: "mdi:shimmer"
@@ -213,6 +198,21 @@ secondary_entities:
       - id: 24
         type: string
         name: sensor
+      - id: 120
+        type: boolean
+        name: unknown_120
+      - id: 127
+        type: boolean
+        name: soft_mode
+      - id: 128
+        type: boolean
+        name: unknown_128
+      - id: 129
+        type: integer
+        name: unknown_129
+      - id: 135
+        type: boolean
+        name: dp_developer_mode
   - entity: select
     name: Litter type
     category: config

+ 14 - 3
custom_components/tuya_local/devices/dongguan_electric_curtain.yaml

@@ -30,9 +30,6 @@ primary_entity:
     - id: 7
       name: learning_state
       type: string
-    - id: 12
-      name: fault_code
-      type: bitfield
 secondary_entities:
   - entity: select
     category: config
@@ -63,6 +60,20 @@ secondary_entities:
         type: integer
         unit: lx
         class: measurement
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 12
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 12
+        type: bitfield
+        name: fault_code
   - entity: sensor
     class: battery
     category: diagnostic

+ 3 - 3
custom_components/tuya_local/devices/dry_pury_evo_dehumidifier.yaml

@@ -30,9 +30,6 @@ primary_entity:
     - id: 6
       name: current_humidity
       type: integer
-    - id: 19
-      type: bitfield
-      name: fault_code
 secondary_entities:
   - entity: fan
     dps:
@@ -107,3 +104,6 @@ secondary_entities:
           - dps_val: null
             value: false
           - value: true
+      - id: 19
+        type: bitfield
+        name: fault_code

+ 4 - 4
custom_components/tuya_local/devices/dts238_7_energy_meter.yaml

@@ -26,10 +26,6 @@ primary_entity:
       type: base64
       name: phase_c
       optional: true
-    - id: 10
-      type: bitfield
-      name: fault_code
-      optional: true
       # ov_cr, unbalance_alarm, ov_vol, undervoltage_alarm, miss_phase_alarm,
       # outage_alarm, magnetism_alarm, terminal_alarm, cover_alarm,
       # credit_alarm, no_balance_alarm, battery_alarm, meter_hardware_alarm
@@ -67,6 +63,10 @@ secondary_entities:
           - dps_val: null
             value: false
           - value: true
+      - id: 10
+        type: bitfield
+        name: fault_code
+        optional: true
   - entity: switch
     name: Prepay
     category: config

+ 4 - 4
custom_components/tuya_local/devices/dual_power_monitor_smartplugv2.yaml

@@ -24,10 +24,6 @@ primary_entity:
       type: integer
       name: ele_calibration
       optional: true
-    - id: 26
-      type: bitfield
-      name: fault_code
-      optional: true
     - id: 42
       type: string
       name: schedule
@@ -128,6 +124,10 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 26
+        type: bitfield
+        name: fault_code
+        optional: true
   - entity: select
     translation_key: initial_state
     category: config

+ 16 - 8
custom_components/tuya_local/devices/eanons_humidifier.yaml

@@ -9,14 +9,6 @@ primary_entity:
     - id: 4
       name: timer_min
       type: integer
-    - id: 9
-      name: error
-      type: integer
-      mapping:
-        - dps_val: 0
-          value: OK
-        - dps_val: 1
-          value: Water Level Low
     - id: 10
       name: switch
       type: boolean
@@ -112,7 +104,23 @@ secondary_entities:
       - id: 9
         name: sensor
         type: bitfield
+        mapping:
+          - dps_val: 1
+            value: true
+          - value: false
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
         mapping:
           - dps_val: 0
             value: false
+          - dps_val: 1
+            value: false
           - value: true
+      - id: 9
+        type: bitfield
+        name: fault_code

+ 46 - 17
custom_components/tuya_local/devices/ebac_dj4000_dehumidifier.yaml

@@ -41,23 +41,6 @@ primary_entity:
     - id: 6
       type: integer
       name: current_humidity
-    - id: 9
-      type: boolean
-      name: defrosst
-      optional: true
-    - id: 13
-      type: boolean
-      name: uv
-      optional: true
-    - id: 19
-      type: bitfield
-      name: fault_code
-    - id: 27
-      type: integer
-      name: total_runtime
-    - id: 28
-      type: boolean
-      name: runtime_reset
 secondary_entities:
   - entity: fan
     dps:
@@ -157,3 +140,49 @@ secondary_entities:
             value: 7h
           - dps_val: 8h
             value: 8h
+  - entity: binary_sensor
+    class: defrost
+    category: diagnostic
+    dps:
+      - id: 9
+        type: boolean
+        name: sensor
+        optional: true
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 19
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 19
+        type: bitfield
+        name: fault_code
+  - entity: switch
+    translation_key: uv_sterilization
+    category: config
+    dps:
+      - id: 13
+        type: boolean
+        name: switch
+        optional: true
+  - entity: sensor
+    name: Runtime
+    class: duration
+    category: diagnostic
+    dps:
+      - id: 27
+        type: integer
+        name: sensor
+        unit: h
+  - entity: button
+    name: Runtime reset
+    category: config
+    dps:
+      - id: 28
+        type: boolean
+        name: button

+ 16 - 16
custom_components/tuya_local/devices/eeese_carl_dehumidifier.yaml

@@ -6,13 +6,6 @@ primary_entity:
     - id: 1
       name: switch
       type: boolean
-      mapping:
-        - dps_val: false
-          icon: "mdi:air-humidifier-off"
-          icon_priority: 2
-        - dps_val: true
-          icon: "mdi:air-humidifier"
-          icon_priority: 4
     - id: 2
       name: humidity
       type: integer
@@ -31,24 +24,26 @@ primary_entity:
           value: auto
         - dps_val: laundry
           value: laundry
-          icon: "mdi:t-shirt-crew"
-          icon_priority: 3
         - dps_val: purify
           value: purify
     - id: 16
       type: integer
       name: current_humidity
-    - id: 19
-      type: bitfield
-      name: error
-      mapping:
-        - dps_val: 1
-          icon: "mdi:cup-water"
-          icon_priority: 1
 secondary_entities:
   - entity: binary_sensor
     translation_key: tank_full
     category: diagnostic
+    dps:
+      - id: 19
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 1
+            value: true
+          - value: false
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
     dps:
       - id: 19
         type: bitfield
@@ -56,7 +51,12 @@ secondary_entities:
         mapping:
           - dps_val: 0
             value: false
+          - dps_val: 1
+            value: false
           - value: true
+      - id: 19
+        type: bitfield
+        name: fault_code
   - entity: lock
     translation_key: child_lock
     category: config

+ 19 - 19
custom_components/tuya_local/devices/eeese_otto_dehumidifier.yaml

@@ -6,13 +6,6 @@ primary_entity:
     - id: 1
       name: switch
       type: boolean
-      mapping:
-        - dps_val: false
-          icon: "mdi:air-humidifier-off"
-          icon_priority: 2
-        - dps_val: true
-          icon: "mdi:air-humidifier"
-          icon_priority: 4
     - id: 2
       name: humidity
       type: integer
@@ -29,27 +22,27 @@ primary_entity:
           value: normal
         - dps_val: Clothdrying
           value: laundry
-          icon: "mdi:t-shirt-crew"
-          icon_priority: 3
         - dps_val: SLeeping
           value: sleep
-          icon: "mdi:sleep"
-          icon_priority: 3
     - id: 6
       type: integer
       name: current_humidity
-    - id: 19
-      type: bitfield
-      name: error
-      optional: true
-      mapping:
-        - dps_val: 1
-          icon: "mdi:cup-water"
-          icon_priority: 1
 secondary_entities:
   - entity: binary_sensor
     translation_key: tank_full
     category: diagnostic
+    dps:
+      - id: 19
+        type: bitfield
+        name: sensor
+        optional: true
+        mapping:
+          - dps_val: 1
+            value: true
+          - value: false
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
     dps:
       - id: 19
         type: bitfield
@@ -60,7 +53,14 @@ secondary_entities:
             value: false
           - dps_val: null
             value: false
+          - dps_val: 1
+            value: false
           - value: true
+      - id: 19
+        type: bitfield
+        optional: true
+        name: fault_code
+
   - entity: switch
     name: Swing
     icon: "mdi:cached"

+ 0 - 17
custom_components/tuya_local/devices/eesee_adam_dehumidifier.yaml

@@ -6,13 +6,6 @@ primary_entity:
     - id: 1
       name: switch
       type: boolean
-      mapping:
-        - dps_val: false
-          icon: "mdi:air-humidifier-off"
-          icon_priority: 1
-        - dps_val: true
-          icon: "mdi:air-humidifier"
-          icon_priority: 4
     - id: 2
       name: humidity
       type: integer
@@ -29,19 +22,9 @@ primary_entity:
           value: normal
         - dps_val: laundry
           value: boost
-          icon: "mdi:tshirt-crew-outline"
-          icon_priority: 3
     - id: 16
       type: integer
       name: current_humidity
-    - id: 19
-      type: bitfield
-      name: error
-      mapping:
-        - dps_val: 1
-          icon: "mdi:cup-water"
-          icon_priority: 2
-      hidden: true
 secondary_entities:
   - entity: fan
     dps:

+ 3 - 3
custom_components/tuya_local/devices/electric_panel_heater.yaml

@@ -38,9 +38,6 @@ primary_entity:
           value: eco
         - dps_val: high
           value: boost
-    - id: 12
-      name: fault_code
-      type: bitfield
     - id: 101
       name: hvac_action
       type: boolean
@@ -144,6 +141,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 12
+        name: fault_code
+        type: bitfield
   - entity: select
     translation_key: temperature_unit
     category: config

+ 15 - 14
custom_components/tuya_local/devices/electriq_cd12pro_dehumidifier.yaml

@@ -6,13 +6,6 @@ primary_entity:
     - id: 1
       name: switch
       type: boolean
-      mapping:
-        - dps_val: false
-          icon: "mdi:air-humidifier-off"
-          icon_priority: 1
-        - dps_val: true
-          icon: "mdi:air-humidifier"
-          icon_priority: 3
     - id: 2
       type: integer
       name: humidity
@@ -31,18 +24,11 @@ primary_entity:
           value: normal
         - dps_val: Laundry
           value: laundry
-          icon: "mdi:tshirt-crew-outline"
-          icon_priority: 2
         - dps_val: Fan
           value: purify
-          icon: "mdi:air-purifier"
-          icon_priority: 2
     - id: 6
       name: current_humidity
       type: integer
-    - id: 19
-      name: fault_code
-      type: integer
 secondary_entities:
   - entity: fan
     dps:
@@ -119,5 +105,20 @@ secondary_entities:
         mapping:
           - dps_val: 1
             value: true
+          - value: false
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 19
+        type: bitfield
+        name: sensor
+        mapping:
           - dps_val: 0
             value: false
+          - dps_val: 1
+            value: false
+          - value: true
+      - id: 19
+        type: bitfield
+        name: fault_code

+ 15 - 12
custom_components/tuya_local/devices/electriq_cd12pwv2_dehumidifier.yaml

@@ -6,13 +6,6 @@ primary_entity:
     - id: 1
       name: switch
       type: boolean
-      mapping:
-        - dps_val: false
-          icon: "mdi:air-humidifier-off"
-          icon_priority: 1
-        - dps_val: true
-          icon: "mdi:air-humidifier"
-          icon_priority: 3
     - id: 2
       type: integer
       name: humidity
@@ -29,14 +22,9 @@ primary_entity:
           value: auto
         - dps_val: "Air_purifier"
           value: purify
-          icon: "mdi:air-purifier"
-          icon_priority: 2
     - id: 6
       type: integer
       name: current_humidity
-    - id: 19
-      type: integer
-      name: error_code
 secondary_entities:
   - entity: light
     translation_key: display
@@ -62,5 +50,20 @@ secondary_entities:
         mapping:
           - dps_val: 1
             value: true
+          - value: false
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 19
+        type: bitfield
+        name: sensor
+        mapping:
           - dps_val: 0
             value: false
+          - dps_val: 1
+            value: false
+          - value: true
+      - id: 19
+        type: bitfield
+        name: fault_code

+ 7 - 10
custom_components/tuya_local/devices/elspet_cat_litterbox.yaml

@@ -145,21 +145,18 @@ secondary_entities:
             value: false
           - value: true
       - id: 118
-        type: integer
+        type: bitfield
         name: fault_code
+      - id: 118
+        type: bitfield
+        name: description
         mapping:
           - dps_val: 0
-            value: "None"
-            icon: "mdi:check-circle"
+            value: ok
           - dps_val: 1
-            value: "Stuck"
-            icon: "mdi:alert"
+            value: stuck
           - dps_val: 2
-            value: "Dislocation"
-            icon: "mdi:alert"
-          - dps_val: 3
-            value: "Both"
-            icon: "mdi:alert"
+            value: dislocation
   - entity: sensor
     name: Clean count
     icon: "mdi:counter"

+ 3 - 3
custom_components/tuya_local/devices/ems_waterheater.yaml

@@ -31,9 +31,6 @@ primary_entity:
       type: string
       name: mode
       hidden: true
-    - id: 9
-      type: bitfield
-      name: fault_code
 secondary_entities:
   - entity: sensor
     class: temperature
@@ -54,3 +51,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 9
+        type: bitfield
+        name: fault_code

+ 3 - 3
custom_components/tuya_local/devices/emylo_energy_meter.yaml

@@ -18,9 +18,6 @@ primary_entity:
       name: phase_a
       optional: true
       force: true
-    - id: 10
-      type: bitfield
-      name: fault_code
     - id: 17
       type: string
       name: alarm
@@ -37,6 +34,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 10
+        type: bitfield
+        name: fault_code
   - entity: switch
     name: Prepayment
     category: config

+ 3 - 3
custom_components/tuya_local/devices/etersky_aroma_diffuser.yaml

@@ -16,9 +16,6 @@ primary_entity:
           value: 100
         - dps_val: small
           value: 50
-    - id: 11
-      name: fault_code
-      type: bitfield
 secondary_entities:
   - entity: switch
     name: Power
@@ -111,3 +108,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 11
+        name: fault_code
+        type: bitfield

+ 3 - 6
custom_components/tuya_local/devices/eurom_600_heater.yaml

@@ -22,12 +22,6 @@ primary_entity:
     - id: 5
       type: integer
       name: current_temperature
-    - id: 6
-      type: bitfield
-      mapping:
-        - dps_val: 0
-          value: "OK"
-      name: error
 secondary_entities:
   - entity: binary_sensor
     category: diagnostic
@@ -40,3 +34,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 6
+        type: bitfield
+        name: fault_code

+ 3 - 6
custom_components/tuya_local/devices/eurom_600_heater_v2.yaml

@@ -21,12 +21,6 @@ primary_entity:
     - id: 5
       type: integer
       name: current_temperature
-    - id: 7
-      type: bitfield
-      mapping:
-        - dps_val: 0
-          value: "OK"
-      name: error
 secondary_entities:
   - entity: binary_sensor
     category: diagnostic
@@ -39,3 +33,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 7
+        type: bitfield
+        name: fault_code

+ 3 - 3
custom_components/tuya_local/devices/eurom_601_heater.yaml

@@ -29,9 +29,6 @@ primary_entity:
         - dps_val: true
           value: eco
       name: preset_mode
-    - id: 13
-      type: bitfield
-      name: error
 secondary_entities:
   - entity: binary_sensor
     category: diagnostic
@@ -44,3 +41,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 13
+        type: bitfield
+        name: fault_code

+ 3 - 3
custom_components/tuya_local/devices/eurom_alutherm_heater.yaml

@@ -35,9 +35,6 @@ primary_entity:
       name: mode
       type: string
       hidden: true
-    - id: 12
-      name: fault_code
-      type: bitfield
     - id: 101
       name: fan_mode
       type: string
@@ -70,6 +67,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 12
+        name: fault_code
+        type: bitfield
   - entity: select
     name: Schedule
     icon: "mdi:calendar-clock"

+ 3 - 3
custom_components/tuya_local/devices/eurom_alutherm_heater_v2.yaml

@@ -53,9 +53,6 @@ primary_entity:
           value: comfort
         - dps_val: true
           value: eco
-    - id: 21
-      name: fault_code
-      type: bitfield
 secondary_entities:
   - entity: binary_sensor
     class: problem
@@ -68,3 +65,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 21
+        name: fault_code
+        type: bitfield

+ 14 - 6
custom_components/tuya_local/devices/eurom_sani_bathroom_towel_radiator.yaml

@@ -49,12 +49,6 @@ primary_entity:
       type: integer
       optional: true
       hidden: true
-    - id: 12
-      name: error
-      type: bitfield
-      mapping:
-        - dps_val: 0
-          value: OK
     - id: 101
       type: string
       name: hvac_action
@@ -127,3 +121,17 @@ secondary_entities:
         type: integer
         name: sensor
         unit: C
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 12
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 12
+        type: bitfield
+        name: fault_code

+ 24 - 28
custom_components/tuya_local/devices/evotherm_eti_heatpump.yaml

@@ -49,9 +49,6 @@ primary_entity:
       name: work_mode
       type: string
       optional: true
-    - id: 15
-      name: fault_code
-      type: bitfield
     - id: 16
       name: current_temperature
       type: integer
@@ -70,10 +67,6 @@ primary_entity:
         - dps_val: Defrosting
           value: preheating
         - value: idle
-          constraint: hvac_mode
-          conditions:
-            - dps_val: false
-              value: "off"
     - id: 101
       name: temperature
       type: integer
@@ -99,9 +92,6 @@ primary_entity:
       mapping:
         - scale: 10
       hidden: true
-    - id: 103
-      name: new_fault_1
-      type: bitfield
     - id: 104
       name: auto_temp
       type: integer
@@ -112,31 +102,13 @@ primary_entity:
       mapping:
         - scale: 10
       hidden: true
-    - id: 107
-      name: new_fault_2
-      type: bitfield
     - id: 109
       name: unit_type
       type: bitfield
-    - id: 110
-      name: new_driver_fault_1
-      type: bitfield
-    - id: 111
-      name: new_driver_fault_2
-      type: bitfield
     - id: 117
       name: frequency
       type: string
       optional: true
-    - id: 118
-      name: fault_2
-      type: bitfield
-    - id: 119
-      name: fault_3
-      type: bitfield
-    - id: 120
-      name: driver_fault_1
-      type: bitfield
 secondary_entities:
   - entity: select
     translation_key: temperature_unit
@@ -161,6 +133,30 @@ secondary_entities:
           - dps_val: Fault
             value: true
           - value: false
+      - id: 15
+        name: fault_code
+        type: bitfield
+      - id: 103
+        name: new_fault_1
+        type: bitfield
+      - id: 107
+        name: new_fault_2
+        type: bitfield
+      - id: 110
+        name: new_driver_fault_1
+        type: bitfield
+      - id: 111
+        name: new_driver_fault_2
+        type: bitfield
+      - id: 118
+        name: fault_2
+        type: bitfield
+      - id: 119
+        name: fault_3
+        type: bitfield
+      - id: 120
+        name: driver_fault_1
+        type: bitfield
   - entity: sensor
     name: Heating coil temperature
     class: temperature

+ 21 - 13
custom_components/tuya_local/devices/fairland_iphcr15_heatpump.yaml

@@ -65,19 +65,6 @@ primary_entity:
     - id: 108
       type: integer
       name: max_temperature
-    - id: 115
-      type: bitfield
-      name: error
-      mapping:
-        - dps_val: 0
-          value: OK
-        - dps_val: 4
-          value: Water Flow Protection
-          icon: "mdi:water-pump-off"
-          icon_priority: 2
-    - id: 116
-      type: bitfield
-      name: error_2
     - id: 117
       name: preset_mode
       type: boolean
@@ -110,3 +97,24 @@ secondary_entities:
           - dps_val: 4
             value: true
           - value: false
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 116
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: true
+            constraint: fault_code
+            conditions:
+              - dps_val: [0, 4]
+                value: false
+          - value: true
+      - id: 115
+        type: bitfield
+        name: fault_code
+      - id: 116
+        type: bitfield
+        name: fault_code_2

+ 17 - 12
custom_components/tuya_local/devices/ferroli_titano_twin.yaml

@@ -35,18 +35,6 @@ primary_entity:
     - id: 10
       type: integer
       name: current_temperature
-    - id: 101
-      type: bitfield
-      name: fault_code
-      mapping:
-        - dps_val: 1
-          value: E2 Operating without water
-        - dps_val: 2
-          value: E3 NTC temperature sensor
-        - dps_val: 4
-          value: E4 Water overheating
-        - dps_val: 16
-          value: E6 clock RTC failure
 secondary_entities:
   - entity: switch
     name: Anti-legionella
@@ -71,6 +59,23 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 101
+        type: bitfield
+        name: fault_code
+      - id: 101
+        type: bitfield
+        name: description
+        mapping:
+          - dps_val: 0
+            value: OK
+          - dps_val: 1
+            value: E2 Operating without water
+          - dps_val: 2
+            value: E3 NTC temperature sensor
+          - dps_val: 4
+            value: E4 Water overheating
+          - dps_val: 16
+            value: E6 clock RTC failure
   - entity: binary_sensor
     name: Heating status
     class: running

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

@@ -417,7 +417,6 @@ secondary_entities:
       - id: 131
         type: boolean
         name: sensor
-        readonly: true
         optional: true
       - id: 110
         type: bitfield

+ 21 - 13
custom_components/tuya_local/devices/gardenpac_heatpump.yaml

@@ -55,19 +55,6 @@ primary_entity:
     - id: 108
       type: integer
       name: max_temperature
-    - id: 115
-      type: bitfield
-      name: error
-      mapping:
-        - dps_val: 0
-          value: OK
-        - dps_val: 4
-          value: Water Flow Protection
-          icon: "mdi:water-pump-off"
-          icon_priority: 2
-    - id: 116
-      type: bitfield
-      name: error_2
     - id: 117
       name: preset_mode
       type: boolean
@@ -100,3 +87,24 @@ secondary_entities:
           - dps_val: 4
             value: true
           - value: false
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 116
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: true
+            constraint: fault_code
+            conditions:
+              - dps_val: [0, 4]
+                value: false
+          - value: true
+      - id: 115
+        type: bitfield
+        name: fault_code
+      - id: 116
+        type: bitfield
+        name: fault_code_2

+ 3 - 0
custom_components/tuya_local/devices/garza_irrigation_system.yaml

@@ -90,3 +90,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 120
+        type: bitfield
+        name: fault_code

+ 27 - 22
custom_components/tuya_local/devices/geyserwise_water_heater.yaml

@@ -24,28 +24,6 @@ primary_entity:
     - id: 10
       type: integer
       name: current_temperature
-    - id: 20
-      type: bitfield
-      name: fault_code
-      mapping:
-        - dps_val: 1
-          value: Earth leak
-        - dps_val: 2
-          value: Dry burn
-        - dps_val: 4
-          value: Wt sensor fault
-        - dps_val: 8
-          value: Heating loss
-        - dps_val: 16
-          value: Over temperature
-        - dps_val: 32
-          value: Water leak
-        - dps_val: 64
-          value: Comm failure
-        - dps_val: 128
-          value: Ct probe fault
-        - dps_val: 256
-          value: Pump failure
     - id: 103
       type: integer
       name: temperature
@@ -78,6 +56,33 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 20
+        type: bitfield
+        name: fault_code
+      - id: 20
+        type: bitfield
+        name: description
+        mapping:
+          - dps_val: 0
+            value: ok
+          - dps_val: 1
+            value: Earth leak
+          - dps_val: 2
+            value: Dry burn
+          - dps_val: 4
+            value: Wt sensor fault
+          - dps_val: 8
+            value: Heating loss
+          - dps_val: 16
+            value: Over temperature
+          - dps_val: 32
+            value: Water leak
+          - dps_val: 64
+            value: Comm failure
+          - dps_val: 128
+            value: Ct probe fault
+          - dps_val: 256
+            value: Pump failure
   - entity: binary_sensor
     name: Solar
     class: running

+ 16 - 34
custom_components/tuya_local/devices/goldair_dehumidifier.yaml

@@ -10,13 +10,6 @@ primary_entity:
     - id: 1
       name: switch
       type: boolean
-      mapping:
-        - dps_val: false
-          icon: "mdi:air-humidifier-off"
-          icon_priority: 3
-        - dps_val: true
-          icon: "mdi:air-humidifier"
-          icon_priority: 6
     - id: 2
       name: mode
       type: string
@@ -29,8 +22,6 @@ primary_entity:
           value: boost
         - dps_val: "3"
           value: laundry
-          icon: "mdi:tshirt-crew-outline"
-          icon_priority: 5
     - id: 4
       type: integer
       name: humidity
@@ -39,37 +30,12 @@ primary_entity:
         max: 80
       mapping:
         - step: 5
-    - id: 5
-      type: boolean
-      name: air_clean_on
-      hidden: true
-      mapping:
-        - dps_val: true
-          icon: "mdi:air-purifier"
-          icon_priority: 4
-    - id: 11
-      type: bitfield
-      name: error
-      mapping:
-        - dps_val: 8
-          value: "Tank full or missing"
-          icon: "mdi:cup-water"
-          icon_priority: 1
-        - dps_val: 0
-          value: "OK"
     - id: 101
       type: boolean
       name: unknown_101
     - id: 104
       type: integer
       name: current_humidity
-    - id: 105
-      type: boolean
-      name: defrosting
-      mapping:
-        - dps_val: true
-          icon: "mdi:snowflake-melt"
-          icon_priority: 2
 secondary_entities:
   - entity: fan
     dps:
@@ -130,6 +96,17 @@ secondary_entities:
   - entity: binary_sensor
     translation_key: tank_full
     category: diagnostic
+    dps:
+      - id: 11
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 8
+            value: true
+          - value: false
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
     dps:
       - id: 11
         type: bitfield
@@ -137,7 +114,12 @@ secondary_entities:
         mapping:
           - dps_val: 0
             value: false
+          - dps_val: 8
+            value: false
           - value: true
+      - id: 11
+        type: bitfield
+        name: fault_code
   - entity: binary_sensor
     translation_key: defrost
     category: diagnostic

+ 3 - 6
custom_components/tuya_local/devices/goldair_geco_heater.yaml

@@ -25,12 +25,6 @@ primary_entity:
     - id: 5
       type: integer
       name: timer
-    - id: 6
-      type: bitfield
-      mapping:
-        - dps_val: 0
-          value: "OK"
-      name: error
 secondary_entities:
   - entity: lock
     translation_key: child_lock
@@ -61,3 +55,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 6
+        type: bitfield
+        name: fault_code

+ 3 - 6
custom_components/tuya_local/devices/goldair_gpcv_heater.yaml

@@ -25,12 +25,6 @@ primary_entity:
     - id: 5
       type: integer
       name: timer
-    - id: 6
-      type: bitfield
-      mapping:
-        - dps_val: 0
-          value: "OK"
-      name: error
     - id: 7
       type: string
       mapping:
@@ -69,3 +63,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 6
+        type: bitfield
+        name: fault_code

+ 3 - 17
custom_components/tuya_local/devices/goldair_gpdh340_dehumidifier.yaml

@@ -9,13 +9,6 @@ primary_entity:
     - id: 1
       name: switch
       type: boolean
-      mapping:
-        - dps_val: false
-          icon: "mdi:air-humidifier-off"
-          icon_priority: 3
-        - dps_val: true
-          icon: "mdi:air-humidifier"
-          icon_priority: 4
     - id: 2
       name: mode
       type: string
@@ -39,16 +32,6 @@ primary_entity:
         max: 80
       mapping:
         - step: 5
-    - id: 11
-      type: bitfield
-      name: error
-      mapping:
-        - dps_val: 16
-          value: Tank full or missing
-          icon: "mdi:cup-water"
-          icon_priority: 1
-        - dps_val: 0
-          value: OK
     - id: 104
       type: integer
       name: current_humidity
@@ -129,6 +112,9 @@ secondary_entities:
           - dps_val: 16
             value: false
           - value: true
+      - id: 11
+        type: bitfield
+        name: fault_code
   - entity: binary_sensor
     name: Filter clean required
     class: problem

+ 9 - 11
custom_components/tuya_local/devices/goldair_gpph_heater.yaml

@@ -9,12 +9,8 @@ primary_entity:
       mapping:
         - dps_val: false
           value: "off"
-          icon: "mdi:radiator-disabled"
-          icon_priority: 1
         - dps_val: true
           value: "heat"
-          icon: "mdi:radiator"
-          icon_priority: 3
       name: hvac_mode
     - id: 2
       type: integer
@@ -50,18 +46,17 @@ primary_entity:
         - dps_val: AF
           value: away
       name: preset_mode
-    - id: 12
-      type: bitfield
+    - id: 101
+      type: string
+      name: hvac_action
       mapping:
-        - dps_val: 0
-          value: OK
-      name: error
+        - dps_val: stop
+          value: idle
+        - value: heating
     - id: 101
       type: string
       mapping:
         - dps_val: "stop"
-          icon: "mdi:radiator-disabled"
-          icon_priority: 2
           constraint: swing_mode
           conditions:
             - dps_val: stop
@@ -188,3 +183,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 12
+        type: bitfield
+        name: fault_code

+ 14 - 3
custom_components/tuya_local/devices/goodcell_ev_charger.yaml

@@ -47,9 +47,6 @@ primary_entity:
           value: Charging ended
         - dps_val: charger_fault
           value: Charger fault
-    - id: 10
-      type: bitfield
-      name: fault_code
     - id: 11
       type: string
       optional: true
@@ -90,6 +87,20 @@ primary_entity:
       optional: true
       name: online_state
 secondary_entities:
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 10
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 10
+        type: bitfield
+        name: fault_code
   - entity: button
     name: Clear energy
     class: restart

+ 15 - 3
custom_components/tuya_local/devices/greenwind_dehumidifier.yaml

@@ -24,9 +24,21 @@ primary_entity:
       range:
         min: 20
         max: 80
-    - id: 15
-      name: error
-      type: integer
     - id: 18
       name: current_humidity
       type: integer
+secondary_entities:
+  - 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

+ 2 - 0
custom_components/tuya_local/devices/heatstorm_dh100twi_heater.yaml

@@ -127,6 +127,8 @@ secondary_entities:
         type: bitfield
         name: description
         mapping:
+          - dps_val: 0
+            value: ok
           - dps_val: 1
             value: Temp sensor fault
           - dps_val: 2

+ 2 - 0
custom_components/tuya_local/devices/heatstorm_hs1500_heater.yaml

@@ -112,6 +112,8 @@ secondary_entities:
         type: bitfield
         name: description
         mapping:
+          - dps_val: 0
+            value: ok
           - dps_val: 1
             value: Temp sensor fault
           - dps_val: 2

+ 15 - 10
custom_components/tuya_local/devices/heatstorm_hs6000gc_heater.yaml

@@ -46,16 +46,6 @@ primary_entity:
           value: eco
         - dps_val: High
           value: boost
-    - id: 13
-      type: bitfield
-      name: fault_code
-      mapping:
-        - dps_val: 1
-          value: Temp sensor fault
-        - dps_val: 2
-          value: Tilt over
-        - dps_val: 3
-          value: Over-voltage
     - id: 19
       type: string
       name: temperature_unit
@@ -115,6 +105,21 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 13
+        type: bitfield
+        name: fault_code
+      - id: 13
+        type: bitfield
+        name: description
+        mapping:
+          - dps_val: 0
+            value: ok
+          - dps_val: 1
+            value: Temp sensor fault
+          - dps_val: 2
+            value: Tilt over
+          - dps_val: 4
+            value: Over-voltage
   - entity: select
     translation_key: temperature_unit
     category: config

+ 3 - 3
custom_components/tuya_local/devices/hiper_bladeless_fan.yaml

@@ -46,9 +46,6 @@ primary_entity:
     - id: 8
       name: oscillate
       type: boolean
-    - id: 13
-      name: fault_code
-      type: bitfield
 secondary_entities:
   - entity: select
     translation_key: timer
@@ -96,6 +93,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 13
+        name: fault_code
+        type: bitfield
   - entity: light
     dps:
       - id: 101

+ 3 - 3
custom_components/tuya_local/devices/hjz_radiator.yaml

@@ -28,9 +28,6 @@ primary_entity:
           value: eco
         - dps_val: "2"
           value: away
-    - id: 21
-      type: bitfield
-      name: fault_code
 secondary_entities:
   - entity: lock
     category: config
@@ -79,3 +76,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 21
+        type: bitfield
+        name: fault_code

+ 24 - 10
custom_components/tuya_local/devices/honeywell_dehumidifier.yaml

@@ -24,16 +24,6 @@ primary_entity:
           value: eco
         - dps_val: 2
           value: boost
-    - id: 15
-      name: error
-      type: bitfield
-      mapping:
-        - dps_val: 0
-          value: OK
-        - dps_val: 1
-          value: Sensor fault
-        - dps_val: 2
-          value: Temperature fault
     - id: 18
       name: current_humidity
       type: integer
@@ -46,3 +36,27 @@ secondary_entities:
       - id: 25
         type: boolean
         name: sensor
+  - 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: 15
+        name: description
+        type: bitfield
+        mapping:
+          - dps_val: 0
+            value: OK
+          - dps_val: 1
+            value: Sensor fault
+          - dps_val: 2
+            value: Temperature fault

+ 17 - 4
custom_components/tuya_local/devices/hyd_weair_plus_fan.yaml

@@ -70,10 +70,6 @@ primary_entity:
     - id: 10
       type: integer
       name: current_temperature
-    - id: 13
-      type: integer
-      name: fault
-      optional: true
     - id: 103
       type: boolean
       name: mode
@@ -113,6 +109,23 @@ secondary_entities:
         name: sensor
         type: integer
         unit: min
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 13
+        type: bitfield
+        optional: true
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - dps_val: null
+            value: false
+          - value: true
+      - id: 13
+        type: bitfield
+        name: fault_code
   - entity: switch
     name: Beep
     dps:

+ 3 - 3
custom_components/tuya_local/devices/hydrotherm_dynamic_x8_water_heater.yaml

@@ -36,9 +36,6 @@ primary_entity:
       type: string
       name: work_mode
       hidden: true
-    - id: 21
-      type: bitfield
-      name: fault_code
 secondary_entities:
   - entity: binary_sensor
     class: problem
@@ -51,3 +48,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 21
+        type: bitfield
+        name: fault_code

+ 3 - 3
custom_components/tuya_local/devices/hysen_hy08acf_thermostat.yaml

@@ -66,9 +66,6 @@ primary_entity:
           conditions:
             - dps_val: ventilate
               invalid: true
-    - id: 13
-      type: bitfield
-      name: fault_code
     - id: 103
       type: integer
       name: max_temperature
@@ -128,6 +125,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 13
+        type: bitfield
+        name: fault_code
   - entity: switch
     translation_key: sleep
     category: config

+ 3 - 3
custom_components/tuya_local/devices/hysen_hy08we2_thermostat.yaml

@@ -46,9 +46,6 @@ primary_entity:
           hidden: true
         - dps_val: Holiday
           value: away
-    - id: 12
-      type: bitfield
-      name: fault_code
     - id: 101
       type: boolean
       name: temperature_unit
@@ -377,3 +374,6 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 12
+        type: bitfield
+        name: fault_code

+ 5 - 16
custom_components/tuya_local/devices/hyundai_sahara_dehumidifier.yaml

@@ -37,22 +37,6 @@ primary_entity:
           value: sleep
           icon: "mdi:power-sleep"
           icon_priority: 3
-    - id: 19
-      name: error
-      type: bitfield
-      # Docs mention E1 and E2, it isn't clear which is tank full, so for now
-      # treat both as that.
-      mapping:
-        - dps_val: 0
-          value: OK
-        - dps_val: 1
-          value: E1
-          icon: "mdi:cup-water"
-          icon_priority: 2
-        - dps_val: 2
-          value: E2
-          icon: "mdi:cup-water"
-          icon_priority: 2
 secondary_entities:
   - entity: fan
     dps:
@@ -90,6 +74,11 @@ secondary_entities:
         type: bitfield
         name: sensor
         mapping:
+          # Docs mention E1 and E2, it isn't clear which is tank full,
+          # so for now treat both as that.
           - dps_val: 0
             value: false
           - value: true
+      - id: 19
+        type: bitfield
+        name: fault_code

+ 16 - 0
custom_components/tuya_local/devices/ihome_autovac_nova.yaml

@@ -132,7 +132,23 @@ primary_entity:
     - id: 110
       type: bitfield
       name: error
+      hidden: true
     - id: 111
       type: integer
       name: event_report
       optional: true
+secondary_entities:
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 110
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 110
+        type: bitfield
+        name: fault_code

+ 4 - 4
custom_components/tuya_local/devices/inkbird_bbq4t_thermometer.yaml

@@ -14,10 +14,6 @@ primary_entity:
       mapping:
         - scale: 100
       unit: F
-    - id: 13
-      type: bitfield
-      name: fault_code
-      optional: true
     - id: 111
       type: integer
       name: unknown_111
@@ -79,6 +75,10 @@ secondary_entities:
           - dps_val: null
             value: false
           - value: true
+      - id: 13
+        type: bitfield
+        name: fault_code
+        optional: true
   - entity: select
     translation_key: temperature_unit
     category: config

+ 4 - 3
custom_components/tuya_local/devices/inkbird_bbq4t_thermometerv2.yaml

@@ -17,9 +17,6 @@ primary_entity:
           endianness: little
           scale: 100
       unit: F
-    - id: 111
-      type: bitfield
-      name: fault_code
 secondary_entities:
   - entity: sensor
     name: Temperature probe 2
@@ -84,6 +81,10 @@ secondary_entities:
           - dps_val: null
             value: false
           - value: true
+      - id: 111
+        type: bitfield
+        optional: true
+        name: fault_code
   - entity: select
     translation_key: temperature_unit
     category: config

+ 3 - 3
custom_components/tuya_local/devices/inkbird_ibbq4bw_thermometer.yaml

@@ -14,9 +14,6 @@ primary_entity:
       mapping:
         - scale: 100
       unit: F
-    - id: 13
-      type: bitfield
-      name: fault_code
 secondary_entities:
   - entity: sensor
     name: Temperature probe 2
@@ -67,6 +64,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 13
+        type: bitfield
+        name: fault_code
   - entity: select
     translation_key: temperature_unit
     category: config

+ 3 - 3
custom_components/tuya_local/devices/inkbird_ihc200_humiditycontroller.yaml

@@ -5,9 +5,6 @@ products:
 primary_entity:
   entity: humidifier
   dps:
-    - id: 12
-      type: bitfield
-      name: fault_code
     - id: 104
       type: integer
       name: current_humidity
@@ -33,6 +30,9 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 12
+        type: bitfield
+        name: fault_code
   - entity: number
     name: Calibration
     category: config

Некоторые файлы не были показаны из-за большого количества измененных файлов