Kogan Smart Plug and Tuya Local Notes
Summary
It is better to replace the hardware and run all devices locally, which is what I did here:
Kogan Smart Plug WB2S Replacement
However, before I did that, I wanted to see what was involved in running tuya local in home assistant. I have not given much detail here, but my YAML setup is below for reference.
Kogan Smart Plug Home Assistant Config
localtuya:
- host: 192.168.<redacted>
device_id: <redacted>
local_key: <redacted>
friendly_name: Kogan Plug Tuya
protocol_version: "3.3"
entities:
- platform: binary_sensor
friendly_name: Plug Status
id: 1
device_class: power
state_on: "true" # Optional
state_off: "false" # Optional
- platform: switch
friendly_name: Plug Switch
id: 1
current: 18 # Optional
current_consumption: 19 # Optional
voltage: 20 # Optional
- platform: sensor
friendly_name: Plug Voltage
id: 20
scaling: 0.1 # Optional
device_class: voltage # Optional
unit_of_measurement: "V" # Optional
- platform: sensor
friendly_name: Plug Power
id: 19
scaling: 0.1 # Optional
device_class: current # Optional
unit_of_measurement: "W" # Optional
- platform: sensor
friendly_name: Plug Current
id: 18
scaling: 0.1 # Optional
device_class: current # Optional
unit_of_measurement: "mA" # Optional
Other Links
Tuya’s datasheet for the WB2S
https://developer.tuya.com/en/docs/iot/wb2s-module-datasheet?id=K9ghecl7kc479
The Tuya Local GitHub
https://github.com/make-all/tuya-local
My notes on replacing the WB2S with another esp8266
https://zorruno.com/2021/kogan-smart-plug-no-esp8266/