ソースを参照

Add support for Bresser 7-in-1 ClimateConnect Tuya Smart Home Weather Centre

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

Modifies PR #181

Add tests for Jiahong Thermostat and correct issues found.

PR #181

Jiahong thermostat: Add a test for Fahrenheit setting

Betterlife heater: add tests and correct minor typo in config.

PR #184

Replace climate constants with enums where available.

- replace SUPPORT_* with ClimateEntityFeature enum
- replace HVAC_MODE_* with HVACMode enum
- replace CURRENT_HVAC_* with HVACAction enum
- For all entity types, do not return STATE_UNAVAILABLE, as it causes errors in 2022.5 and later (including in unit tests).

Issue #167

Replace cover, fan, humidifier, vacuum constants with enums. - SUPPORT_* replaced with *EntityFeature enums since HA 2022.05

Issue #167

Replace light constants with enums.

- SUPPORT_* replaced with LightEntityFeature enum
- COLOR_MODE_* replaced with ColorMode enum

This is the final change to complete issue #167.

Refactor common initialisation code into a helper.

Refactor platform init code.

Even though yaml config has not been supported for some time, the API for it was still there in each platform due to the config flow init calling it.
Refactor so that the config flow init does the work directly (which since the last commit is just one function call to a common function)and remove the unused old API.

Swap order of scaling and inverting.

Inversion uses min and max from the config, so needs to be done on the device scaled value, not the HA scale as was previously done.

Lefant M213: Adjust to work with M213S.

- Direction control returns forward in normal operation, which is not listed in the iot.tuya.com docs.  I think this applies to M213 as well.
- DPS 108 is not returned by M213S (or may be mode dependant).  Since it is not linked to any known function, remove it from the config to allow detection of the M213S as M213 compatible.

Remove dp 108 from Lefant test.

Since it has been removed for compatibility with M213S, remove from the test.

Protect against None values when calling upper().

When device is not available, mode can be None. Handle that.

Add an RGBCW lightbulb.

Based on Lepro RGBCW bulbs from Amazon.

Add variant of energy monitoring smart plug.

This one does not have the overcharge cutoff feature, and cycle_timer.

Issue #186

Lefant vacuum: remove unknown dp 106, to widen compatibility.

APOSEN A550 has the same config as Lefant m213S, but is missing dp 106 (as well as 108, which M213 has but M213S does not)

Since it is unknown, removing it should not harm functionality.

Issue #173

Add support for Eesee Adam dehumidifier

Issue #180

Add some comments about commented out lines in Lefant M213 config.
Update docs for recent changes.

goldair fan: mark climate entity as deprecated.

This should have been marked as deprecated when the fan entity was added.

Default brightness for rgbw mode to follow white brightness or full.

Defaulting to 0 causes the light to go out when first going into colour mode,
and it is necessary to use the brightness control to recover.

light: don't use rgbw for brightness.

W is basically how washed out it should look. Brightness should only come from
brightness.

Drop some frequent log messages down to debug level.

Reserve info for infrequent messages to avoid polluting the log.

Add Yandex lightbulb as variant of RGBCW lightbulb

For now this is documentation only, as product ids are not yet being used.

Issue #187

Add Hyundai Sahara (D030) dehumidifier

Issue #188

Fix RGB light tests.

After the previous fix for light brightness after switching to RGBW color mode, the brightness in the tests is incorrect, as the brightness dp was not set in the
test, but is used now to calculate the v in hsv.

Add tests for rgbcw_lightbulb.

Add Moes Temperature and Humidity switch.

Partial functionality, as the user only has the waterproof temperature probe, not the (non-waterproof) temperature and humidity probe, and several dp purposes have not been reverse engineered yet.

Issue #182

Yandex colour bulb is not working with rgbcw_lightbulb.yaml

Remove the product from the config, and note from README.
It seems this device will need optional dps, as it only returns the dps valid for the current mode.  But with those, it may work

Lefant M213: add fan_speed dp, separate cmd from status.

- additional dps identified for status and fan speed (suction level)
- changes in generic vacuum to allow separation of commands from status.

Status basically follows command, though it does distinguish charging and standby states when docked.  There are possibly other states such as errors...

Add support for AlecoAir D14 dehumidifier.

Issue #189

Update bresser_weather_station.yaml

Revert "Add support for AlecoAir D14 dehumidifier."

This reverts commit 52a83bfde24ea9af619e6d8893bf720799781de1.

Revert "Lefant M213: add fan_speed dp, separate cmd from status."

This reverts commit 595efe6430fbc57b476657a302e0eb01afd34634.

Revert "Yandex colour bulb is not working with rgbcw_lightbulb.yaml"

This reverts commit 56d56d044513ceb922ef1951f3dd8825fd9f1d3b.

Revert "Add Moes Temperature and Humidity switch."

This reverts commit 79af66d2e6155663a25009077be8379e7d71fea2.

Revert "Fix RGB light tests."

This reverts commit 609e680df9187854670591f6802cb6edd7c8724c.

Revert "Add Hyundai Sahara (D030) dehumidifier"

This reverts commit cf92cee878f2adde1bfe22d3541f0053721556d9.

Revert "Add Yandex lightbulb as variant of RGBCW lightbulb"

This reverts commit f8301caec7f0af80a942ae1d57d3d060caa0a131.

Revert "Drop some frequent log messages down to debug level."

This reverts commit da4912bc7a62466a12578b057e1e5c5c55adb109.

Revert "light: don't use rgbw for brightness."

This reverts commit fb5a86f4505e0556ba921a1d68b4c6a80ac64b42.

Revert "Default brightness for rgbw mode to follow white brightness or full."

This reverts commit 369464c4bf05041f9e0dc3dad5a1de1a1a46d6d5.

Revert "goldair fan: mark climate entity as deprecated."

This reverts commit dbd120e4d9d01b7460115dcbf83e4a116c81f1f8.

Revert "Add support for Eesee Adam dehumidifier"

This reverts commit dd59eb1c9dbd695b297cbecaa47bf4d0e235fec1.

Revert "Lefant vacuum: remove unknown dp 106, to widen compatibility."

This reverts commit 8ec4acdbed45aba99f487b0448e1e599dd6801c9.

Revert "Add variant of energy monitoring smart plug."

This reverts commit 40269f64d647a2e99340dee675d2470bd3219f35.

Revert "Add an RGBCW lightbulb."

This reverts commit 8fab7c506a809040c88f6e7d19f5945b87e7e4ad.

Revert "Protect against None values when calling upper()."

This reverts commit 6a39d241bc2ff5db9ac61f3b5741d15d2098030a.

Revert "Remove dp 108 from Lefant test."

This reverts commit caf133629f2d129258c5e206ced5337a55390d1e.

Revert "Lefant M213: Adjust to work with M213S."

This reverts commit 0e75a12aecf33096aa3a3a54185dfcae41313b9d.

Revert "Swap order of scaling and inverting."

This reverts commit 90128866f74312287337a57c176921b224bd656d.

Revert "Refactor platform init code."

This reverts commit 6b1cc07377f6c94c682f9471a674a67f773af25d.

Revert "Refactor common initialisation code into a helper."

This reverts commit 815811996681e440cd0dbc4bac4f75d6945a4697.

Revert "Replace light constants with enums."

This reverts commit 00b80165e4f0102c0eac033640d02a1df592853a.

Revert "Replace cover, fan, humidifier, vacuum constants with enums."

This reverts commit 83dccce39b50ed68a42806695c3d8f95abd9502e.

Revert "Replace climate constants with enums where available."

This reverts commit 4e105606a14e20d2e5417923809dae78cbe0d68d.

Revert "Betterlife heater: add tests and correct minor typo in config."

This reverts commit 61cb2b627472fe4cabf01ce940a71b4aa66e4a90.

Revert "Jiahong thermostat: Add a test for Fahrenheit setting"

This reverts commit 5fc5fbc9d5b0c649fcfab600f78a92c5b2395ab2.

Revert "Add tests for Jiahong Thermostat and correct issues found."

This reverts commit a4203e8034e377a926b8f8861d80635b7e467f90.

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

This reverts commit c95a0e98511f9f5ddad3b011260ce19a6b8ce1fc.
myhomeiot 3 年 前
コミット
6c9756d290

+ 322 - 0
custom_components/tuya_local/devices/bresser_weather_station.yaml

@@ -0,0 +1,322 @@
+# Bresser 7-in-1 ClimateConnect Tuya Smart Home Weather Centre
+# https://www.bresser.de/en/Weather-Time/BRESSER-7-in-1-ClimateConnect-Tuya-Smart-Home-Weather-Centre.html
+name: Bresser ClimateConnect
+products:
+  - id: 8qk6p78udvbjwlof
+    name: Bresser Weather Station
+    model: C6085A
+primary_entity:
+  entity: sensor
+  name: Indoor Temperature
+  class: temperature
+  dps:
+    - id: 1
+      <<: &temperature
+        type: integer
+        name: sensor
+        unit: C
+        mapping:
+          - scale: 10
+        class: measurement
+        readonly: true
+#    - id: 22
+#      type: string
+#      name: fault_type
+    - id: 58
+      type: string
+      name: wind_direct
+    - id: 68
+      type: string
+      name: com_index
+secondary_entities:
+  - entity: sensor
+    name: Indoor Humidity
+    class: humidity
+    dps:
+      - id: 2
+        <<: &humidity
+          type: integer
+          name: sensor
+          unit: "%"
+          class: measurement
+          readonly: true
+  - entity: binary_sensor
+    name: Base Station Battery
+    class: battery
+    category: diagnostic
+    dps:
+      - id: 3
+        <<: &battery
+          type: string
+          name: sensor
+          mapping:
+            - dps_val: low
+              value: true
+            - dps_val: high
+              value: false
+  - entity: select
+    name: Temperature Unit
+    icon: mdi:thermometer
+    category: config
+    dps:
+      - id: 9
+        type: string
+        name: option
+        mapping:
+          - dps_val: c
+            value: "°C"
+          - dps_val: f
+            value: "°F"
+  - entity: select
+    name: Wind Speed Unit
+    icon: mdi:weather-windy
+    category: config
+    dps:
+      - id: 10
+        type: string
+        name: option
+        mapping:
+          - dps_val: m_s
+            value: m/s
+          - dps_val: km_h
+            value: km/h
+          - dps_val: knots
+            value: knots
+          - dps_val: mph
+            value: mph
+  - entity: select
+    name: Pressure Unit
+    icon: mdi:gauge
+    category: config
+    dps:
+      - id: 11
+        type: string
+        name: option
+        mapping:
+          - dps_val: hpa
+            value: hPa
+          - dps_val: inhg
+            value: inHg
+          - dps_val: mmhg
+            value: mmHg
+  - entity: select
+    name: Rain Unit
+    icon: mdi:weather-rainy
+    category: config
+    dps:
+      - id: 12
+        type: string
+        name: option
+        mapping:
+          - dps_val: mm
+            value: mm
+          - dps_val: inch
+            value: inch
+  - entity: select
+    name: Light Intensity Unit
+    icon: mdi:brightness-5
+    category: config
+    dps:
+      - id: 13
+        type: string
+        name: option
+        mapping:
+          - dps_val: lux
+            value: lux
+          - dps_val: fc
+            value: fc
+          - dps_val: wm2
+            value: W/m2
+  - entity: binary_sensor
+    name: Battery
+    class: battery
+    category: diagnostic
+    dps:
+      - id: 30
+        <<: *battery
+#  - entity: binary_sensor
+#    name: Battery Ch1
+#    class: battery
+#    category: diagnostic
+#    dps:
+#      - id: 31
+#        <<: *battery
+#  - entity: binary_sensor
+#    name: Battery Ch2
+#    class: battery
+#    category: diagnostic
+#    dps:
+#      - id: 32
+#        <<: *battery
+#  - entity: binary_sensor
+#    name: Battery Ch3
+#    class: battery
+#    category: diagnostic
+#    dps:
+#      - id: 33
+#        <<: *battery
+  - entity: sensor
+    name: Temperature
+    class: temperature
+    dps:
+      - id: 38
+        <<: *temperature
+  - entity: sensor
+    name: Humidity
+    class: humidity
+    dps:
+      - id: 39
+        <<: *humidity
+#  - entity: sensor
+#    name: Temperature Ch1
+#    class: temperature
+#    dps:
+#      - id: 40
+#        <<: *temperature
+#  - entity: sensor
+#    name: Humidity Ch1
+#    class: humidity
+#    dps:
+#      - id: 41
+#        <<: *humidity
+#  - entity: sensor
+#    name: Temperature Ch2
+#    class: temperature
+#    dps:
+#      - id: 42
+#        <<: *temperature
+#  - entity: sensor
+#    name: Humidity Ch2
+#    class: humidity
+#    dps:
+#      - id: 43
+#        <<: *humidity
+#  - entity: sensor
+#    name: Temperature Ch3
+#    class: temperature
+#    dps:
+#      - id: 44
+#        <<: *temperature
+#  - entity: sensor
+#    name: Humidity Ch3
+#    class: humidity
+#    dps:
+#      - id: 45
+#        <<: *humidity
+  - entity: sensor
+    name: Pressure
+    class: pressure
+    dps:
+      - id: 54
+        type: integer
+        name: sensor
+        unit: hPa
+        mapping:
+          - scale: 10
+        class: measurement
+        readonly: true
+  - entity: sensor
+    name: Pressure Drop
+    class: pressure
+    dps:
+      - id: 55
+        type: integer
+        name: sensor
+        unit: hPa
+        class: measurement
+        readonly: true
+  - entity: sensor
+    name: Wind Speed
+    icon: mdi:weather-windy
+    dps:
+      - id: 56
+        <<: &wind_speed
+          type: integer
+          name: sensor
+          unit: m/s
+          mapping:
+            - scale: 10
+          class: measurement
+          readonly: true
+  - entity: sensor
+    name: Wind Gust
+    icon: mdi:weather-windy
+    dps:
+      - id: 57
+        <<: *wind_speed
+  - entity: sensor
+    name: Rain
+    icon: mdi:weather-rainy
+    dps:
+      - id: 60
+        <<: &rain
+          type: integer
+          name: sensor
+          mapping:
+            - scale: 1000
+          class: measurement
+          readonly: true
+        unit: mm
+  - entity: sensor
+    name: Rainfall Rate
+    icon: mdi:weather-pouring
+    dps:
+      - id: 61
+        <<: *rain
+        unit: mm/h
+  - entity: sensor
+    name: UV Index
+    icon: mdi:weather-sunny
+    dps:
+      - id: 62
+        type: integer
+        name: sensor
+        unit: UV Index
+        mapping:
+          - scale: 10
+        class: measurement
+        readonly: true
+  - entity: sensor
+    name: Light Intensity
+    class: illuminance
+    dps:
+      - id: 63
+        type: integer
+        name: sensor
+        unit: lx
+        class: measurement
+        readonly: true
+  - entity: sensor
+    name: Dew Point
+    class: temperature
+    dps:
+      - id: 64
+        <<: *temperature
+  - entity: sensor
+    name: Feels Like Temperature
+    class: temperature
+    dps:
+      - id: 65
+        <<: *temperature
+  - entity: sensor
+    name: Heat Index
+    class: temperature
+    dps:
+      - id: 66
+        <<: *temperature
+  - entity: sensor
+    name: Wind Chill Index
+    class: temperature
+    dps:
+      - id: 67
+        <<: *temperature
+  - entity: sensor
+    name: Wind Bearing
+    icon: mdi:compass-outline
+    dps:
+      - id: 101
+        type: integer
+        name: sensor
+        unit: "°"
+        class: measurement
+        readonly: true