Bläddra i källkod

Add another generic smartplug variant to better match GNCC 16A one.

Issue #300

This smartplugv2 config is basically smartplugv2_energy with the energy sensor
removed (strangely it still seems to report the calibration for the energy
sensor though).

So it is more featured than the smartplugv1 and smartplugv2, but less featured
than smartplugv2_energy.

This config will not solve the bug reported that the switch does not work
from HA, but does reflect the state of the switch when switched on the
device itself or through the cloud.
Jason Rumney 3 år sedan
förälder
incheckning
05642bcf72
2 ändrade filer med 118 tillägg och 0 borttagningar
  1. 1 0
      ACKNOWLEDGEMENTS.md
  2. 117 0
      custom_components/tuya_local/devices/smartplugv3.yaml

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -146,3 +146,4 @@ Further device support has been made with the assistance of users.  Please consi
 - [iDontWantAUsername](https://github.com/iDontWantAUsername) for assistance supporting Grid Connect USB charger with power socket.
 - [engusz](https://github.com/engusz) for assistance supporting Avatto curtain switches and dual switch with timers.
 - [81k5](https://github.com/81k5) for assistance supporting Aubess smart switches.
+- [SvenMartin81](https://github.com/SvenMartin81) for assistance supporting another variant of common smartplug (via GNCC branded one)

+ 117 - 0
custom_components/tuya_local/devices/smartplugv3.yaml

@@ -0,0 +1,117 @@
+name: Advanced energy monitoring smartplug
+primary_entity:
+  entity: switch
+  class: outlet
+  dps:
+    - id: 1
+      type: boolean
+      name: switch
+    - id: 21
+      type: integer
+      name: test_bit
+    - id: 22
+      type: integer
+      name: voltage_calibration
+    - id: 23
+      type: integer
+      name: current_calibration
+    - id: 24
+      type: integer
+      name: power_calibration
+    - id: 25
+      type: integer
+      name: energy_calibration
+    - id: 26
+      type: bitfield
+      name: fault_code
+    - id: 41
+      type: string
+      name: cycle_timer
+    - id: 42
+      type: string
+      name: random_timer
+secondary_entities:
+  - entity: number
+    category: config
+    name: Timer
+    icon: "mdi:timer"
+    dps:
+      - id: 9
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: sensor
+    category: diagnostic
+    class: current
+    name: Current
+    dps:
+      - id: 18
+        name: sensor
+        type: integer
+        class: measurement
+        unit: mA
+  - entity: sensor
+    category: diagnostic
+    class: power
+    name: Power
+    dps:
+      - id: 19
+        name: sensor
+        type: integer
+        class: measurement
+        unit: W
+        mapping:
+          - scale: 10
+  - entity: sensor
+    category: diagnostic
+    class: voltage
+    name: Voltage
+    dps:
+      - id: 20
+        name: sensor
+        type: integer
+        class: measurement
+        unit: V
+        mapping:
+          - scale: 10
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    name: Error
+    dps:
+      - id: 26
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+  - entity: select
+    category: config
+    name: Initial state
+    icon: "mdi:toggle-switch"
+    dps:
+      - id: 38
+        type: string
+        name: option
+        mapping:
+          - dps_val: "on"
+            value: "On"
+          - dps_val: "off"
+            value: "Off"
+          - dps_val: memory
+            value: "Last State"
+  - entity: switch
+    name: Overcharge cutoff
+    category: config
+    icon: "mdi:battery-charging"
+    dps:
+      - id: 46
+        type: boolean
+        name: switch