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

addad "Smart P01" socket (#3875)

* addad smart_p01_socket.yaml

* changed name

* feat (smart_p01_socket): changes from review

- Device naming changes
- split schedules out to text entities
- remove expected non-working energy sensor

PR #3875

* Fix formatting issues in smart_p01_socket.yaml

---------

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

+ 111 - 0
custom_components/tuya_local/devices/smart_p01_socket.yaml

@@ -0,0 +1,111 @@
+name: Smartplug
+products:
+  - id: ocazi2dacnofqidn
+    model: P01
+entities:
+  - entity: switch
+    class: outlet
+    dps:
+      - id: 1
+        type: boolean
+        name: switch
+      - id: 20
+        type: integer
+        name: add_ele
+        optional: true
+  - entity: time
+    category: config
+    translation_key: timer
+    dps:
+      - id: 9
+        type: integer
+        name: second
+        range:
+          min: 0
+          max: 86399
+  - entity: sensor
+    class: current
+    category: diagnostic
+    dps:
+      - id: 21
+        type: integer
+        name: sensor
+        unit: mA
+        class: measurement
+  - entity: sensor
+    class: power
+    category: diagnostic
+    dps:
+      - id: 22
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    class: voltage
+    category: diagnostic
+    dps:
+      - id: 23
+        type: integer
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 29
+        type: bitfield
+        name: sensor
+        optional: true
+        mapping:
+          - dps_val: 0
+            value: false
+          - dps_val: null
+            value: false
+          - value: true
+      - id: 29
+        type: bitfield
+        name: fault_code
+        optional: true
+  - entity: select
+    translation_key: initial_state
+    category: config
+    dps:
+      - id: 38
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: '0'
+            value: 'off'
+          - dps_val: '1'
+            value: 'on'
+          - dps_val: '2'
+            value: memory
+          - dps_val: null
+            invalid: true
+  - entity: text
+    name: Random schedule
+    category: config
+    icon: "mdi:island"
+    hidden: true
+    dps:
+      - id: 42
+        type: base64
+        name: value
+        optional: true
+  - entity: text
+    name: Schedule
+    category: config
+    icon: "mdi:calendar-clock"
+    hidden: true
+    dps:
+      - id: 43
+        type: base64
+        name: value
+        optional: true