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

Add support for Tesla S300 air purifier

Issue #1936
Jason Rumney 1 год назад
Родитель
Сommit
a83bf81eb6

+ 2 - 1
ACKNOWLEDGEMENTS.md

@@ -590,4 +590,5 @@ Further device support has been made with the assistance of users. Please consid
 - [rac146](https://github.com/rac146) for contributing support for Zemismart ZM25R2 roller shades.
 - [Nuwisam](https://github.com/Nuwisam) for contributing doc fixes.
 - [jorgeal94](https://github.com/jorgeal94) for assisting with support for another Tongou QCB2 circuit breaker variant and compatible Tongou SMR1 circuit breaker.
-- [ifumadjiev](https:github.com/ifumadjiev) for assisting with support for Gosund SP112 USB smartplug.
+- [ifumadjiev](https://github.com/ifumadjiev) for assisting with support for Gosund SP112 USB smartplug.
+- [Trychlik](https://github.com/Trychlik) for assisting with support for Tesla S300 air purifier.

+ 1 - 1
DEVICES.md

@@ -252,7 +252,7 @@
 - Soho SO-350WUI Air Purifier
 - Soleusair A02 and A10 air purifiers
 - Stadler Form Roger air purifier
-- Tesla Smart Pro and Mini air purifiers
+- Tesla S300, Smart Pro and Mini air purifiers
 - Vork VK6067AW air purifier
 
 ### Dehumidifiers

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

@@ -1,6 +1,7 @@
 name: Tesla smart air purifier mini
 products:
   - id: sgodozglgymucvq2
+    name: Tesla Air Mini
 primary_entity:
   entity: fan
   translation_only_key: fan_with_presets

+ 2 - 1
custom_components/tuya_local/devices/tesla_air_purifier_pro.yaml

@@ -1,6 +1,7 @@
-name: Tesla Pro M smart air purifier
+name: Air purifier
 products:
   - id: 3hjcrjktvkoim7zu
+    name: Tesla Air Pro M
 primary_entity:
   entity: fan
   translation_only_key: fan_with_presets

+ 172 - 0
custom_components/tuya_local/devices/tesla_s300_purifier.yaml

@@ -0,0 +1,172 @@
+name: Air purifier
+products:
+  - id: 7v1gn9wmbqvtcqkc
+    name: Tesla Air S300
+primary_entity:
+  entity: fan
+  dps:
+    - id: 1
+      type: boolean
+      name: switch
+    - id: 4
+      type: string
+      name: speed
+      mapping:
+        - dps_val: "1"
+          value: 14
+        - dps_val: "2"
+          value: 28
+        - dps_val: "3"
+          value: 42
+        - dps_val: "4"
+          value: 57
+        - dps_val: "5"
+          value: 71
+        - dps_val: "6"
+          value: 85
+        - dps_val: "7"
+          value: 100
+secondary_entities:
+  - entity: sensor
+    class: pm25
+    category: diagnostic
+    dps:
+      - id: 2
+        type: integer
+        name: sensor
+        unit: ugm3
+        class: measurement
+  - entity: sensor
+    name: Filter
+    category: diagnostic
+    dps:
+      - id: 5
+        type: integer
+        name: sensor
+        unit: "%"
+  - entity: switch
+    translation_key: ionizer
+    category: config
+    dps:
+      - id: 6
+        type: boolean
+        name: switch
+  - entity: lock
+    translation_key: child_lock
+    category: config
+    dps:
+      - id: 7
+        type: boolean
+        name: lock
+        optional: true
+        mapping:
+          - dps_val: null
+            value: false
+            hidden: true
+  - entity: switch
+    translation_key: uv_sterilization
+    category: config
+    dps:
+      - id: 9
+        type: boolean
+        name: switch
+  - entity: button
+    name: Filter reset
+    class: restart
+    category: config
+    dps:
+      - id: 11
+        type: boolean
+        optional: true
+        name: button
+  - entity: select
+    translation_key: timer
+    category: config
+    dps:
+      - id: 18
+        type: string
+        name: option
+        mapping:
+          - dps_val: cancel
+            value: "Off"
+          - dps_val: "1h"
+            value: "1 hour"
+          - dps_val: "2h"
+            value: "2 hours"
+          - dps_val: "3h"
+            value: "3 hours"
+          - dps_val: "4h"
+            value: "4 hours"
+          - dps_val: "5h"
+            value: "5 hours"
+          - dps_val: "6h"
+            value: "6 hours"
+          - dps_val: "7h"
+            value: "7 hours"
+          - dps_val: "8h"
+            value: "8 hours"
+          - dps_val: "9h"
+            value: "9 hours"
+          - dps_val: "10h"
+            value: "10 hours"
+          - dps_val: "11h"
+            value: "11 hours"
+          - dps_val: "12h"
+            value: "12 hours"
+  - entity: sensor
+    name: Air quality
+    class: enum
+    category: diagnostic
+    dps:
+      - id: 21
+        type: string
+        name: sensor
+        mapping:
+          - dps_val: great
+            value: Great
+          - dps_val: mild
+            value: Mild
+          - dps_val: good
+            value: Good
+          - dps_val: medium
+            value: Medium
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 22
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 22
+        type: bitfield
+        name: fault_code
+  - entity: switch
+    name: Mute
+    icon: "mdi:volume-mute"
+    category: config
+    dps:
+      - id: 104
+        type: boolean
+        name: switch
+  - entity: select
+    name: Light
+    icon: "mdi:lightbulb"
+    dps:
+      - id: 105
+        type: string
+        name: option
+        mapping:
+          - dps_val: "off"
+            value: "Off"
+          - dps_val: orange
+            value: Orange
+          - dps_val: green
+            value: Green
+          - dps_val: blue
+            value: Blue
+          - dps_val: yellow
+            value: Yellow