Browse Source

Adding new device support for Homemate devices and Tomzn Energy Meter

Anuram P 8 months ago
parent
commit
23bfd63e7c

+ 75 - 0
custom_components/tuya_local/devices/homemate_2gang_switch.yaml

@@ -0,0 +1,75 @@
+name: HomeMate 2Gang Switch
+products:
+  - id: jbaaqtkiuyjyuwtq
+    name: HomeMate 2Gang Switch
+primary_entity:
+  entity: switch
+  name: Switch 1
+  dps:
+    - id: 1
+      name: switch
+      type: boolean
+secondary_entities:
+  - entity: switch
+    name: Switch 2
+    dps:
+      - id: 2
+        name: switch
+        type: boolean
+  - entity: switch
+    icon: "mdi:toggle-switch"
+    name: MasterSwitch
+    dps:
+      - id: 13
+        type: boolean
+        name: switch
+  - entity: number
+    category: config
+    icon: "mdi:timer"
+    name: Countdown_1
+    dps:
+      - id: 7
+        type: integer
+        name: value
+        unit: min
+        optional: true
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: number
+    category: config
+    icon: "mdi:timer"
+    name: Countdown_2
+    dps:
+      - id: 8
+        type: integer
+        name: value
+        unit: min
+        optional: true
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: select
+    name: Power on state
+    icon: "mdi:toggle-switch"
+    category: config
+    dps:
+      - id: 14
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: "off"
+            value: "Power Off"
+          - dps_val: "on"
+            value: "Power On"
+          - dps_val: "memory"
+            value: "Last state"
+          - dps_val: null
+            invalid: true

+ 119 - 0
custom_components/tuya_local/devices/homemate_4gang_switch.yaml

@@ -0,0 +1,119 @@
+name: HomeMate 4Gang Switch
+products:
+  - id: ai2cizw27dqsamlr
+    name: HomeMate 4Gang Switch
+primary_entity:
+  entity: switch
+  name: Switch 1
+  dps:
+    - id: 1
+      name: switch
+      type: boolean
+secondary_entities:
+  - entity: switch
+    name: Switch 2
+    dps:
+      - id: 2
+        name: switch
+        type: boolean
+  - entity: switch
+    name: Switch 3
+    dps:
+      - id: 3
+        name: switch
+        type: boolean
+  - entity: switch
+    name: Switch 4
+    dps:
+      - id: 4
+        name: switch
+        type: boolean
+  - entity: switch
+    icon: "mdi:toggle-switch"
+    name: MasterSwitch
+    dps:
+      - id: 13
+        type: boolean
+        name: switch
+  - entity: number
+    category: config
+    icon: "mdi:timer"
+    name: Countdown_1
+    dps:
+      - id: 7
+        type: integer
+        name: value
+        unit: min
+        optional: true
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: number
+    category: config
+    icon: "mdi:timer"
+    name: Countdown_2
+    dps:
+      - id: 8
+        type: integer
+        name: value
+        unit: min
+        optional: true
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: number
+    category: config
+    icon: "mdi:timer"
+    name: Countdown_3
+    dps:
+      - id: 9
+        type: integer
+        name: value
+        unit: min
+        optional: true
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: number
+    category: config
+    icon: "mdi:timer"
+    name: Countdown_4
+    dps:
+      - id: 10
+        type: integer
+        name: value
+        unit: min
+        optional: true
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: select
+    name: Power on state
+    icon: "mdi:toggle-switch"
+    category: config
+    dps:
+      - id: 14
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: "off"
+            value: "Power Off"
+          - dps_val: "on"
+            value: "Power On"
+          - dps_val: "memory"
+            value: "Last state"
+          - dps_val: null
+            invalid: true

+ 27 - 0
custom_components/tuya_local/devices/homemate_fan_regulator.yaml

@@ -0,0 +1,27 @@
+name: HomeMate Fan Regulator
+products:
+  - id: ewdmma4uccqydpmj
+    name: HomeMate Fan Regulator
+primary_entity:
+  entity: fan
+  dps:
+    - id: 1
+      name: switch
+      type: boolean
+    - id: 3
+      name: speed
+      type: integer
+      range:
+        min: 1
+        max: 5
+      # mapping:
+      #   - scale: 0.05
+secondary_entities:
+  - entity: lock
+    name: Child Lock
+    icon: "mdi:hand-back-right-off"
+    category: config
+    dps:
+      - id: 14
+        name: lock
+        type: boolean

+ 54 - 0
custom_components/tuya_local/devices/tomzn_energy_meter.yaml

@@ -0,0 +1,54 @@
+name: Energy meter
+products:
+  - id: sw9asyjj8j44frjl
+    name: Tomzn Energy Meter
+primary_entity:
+  entity: switch
+  dps:
+    - id: 1
+      type: boolean
+      name: switch
+secondary_entities:
+  - entity: sensor
+    class: current
+    category: diagnostic
+    dps:
+      - id: 18
+        type: integer
+        name: sensor
+        unit: A
+        class: measurement
+        mapping:
+          - scale: 1000
+  - entity: sensor
+    class: power
+    category: diagnostic
+    dps:
+      - id: 19
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    class: voltage
+    category: diagnostic
+    dps:
+      - id: 20
+        type: integer
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    class: energy
+    dps:
+      - id: 101
+        type: integer
+        name: sensor
+        unit: kWh
+        class: total_increasing
+        mapping:
+          - scale: 100