To contribute to this page, edit the following file
TuYa TS0121_plug #
Model | TS0121_plug |
Vendor | TuYa |
Description | 10A UK or 16A EU smart plug |
Exposes | switch (state), power, current, voltage, energy, power_outage_memory, linkquality |
Picture | ![]() |
White-label | BlitzWolf BW-SHP13 |
Notes #
Device type specific configuration #
How to use device type specific configuration
measurement_poll_interval
: This device does not support reporting electric measurements so it is polled instead. The default poll interval is 60 seconds.
Exposes #
Switch #
The current state of this switch is in the published state under the state
property (value is ON
or OFF
).
To control this switch publish a message to topic zigbee2mqtt/FRIENDLY_NAME/set
with payload {"state": "ON"}
, {"state": "OFF"}
or {"state": "TOGGLE"}
.
To read the current state of this switch publish a message to topic zigbee2mqtt/FRIENDLY_NAME/get
with payload {"state": ""}
.
Power (numeric) #
Instantaneous measured power.
Value can be found in the published state on the power
property.
To read (/get
) the value publish a message to topic zigbee2mqtt/FRIENDLY_NAME/get
with payload {"power": ""}
.
It’s not possible to write (/set
) this value.
The unit of this value is W
.
Current (numeric) #
Instantaneous measured electrical current.
Value can be found in the published state on the current
property.
To read (/get
) the value publish a message to topic zigbee2mqtt/FRIENDLY_NAME/get
with payload {"current": ""}
.
It’s not possible to write (/set
) this value.
The unit of this value is A
.
Voltage (numeric) #
Measured electrical potential value.
Value can be found in the published state on the voltage
property.
To read (/get
) the value publish a message to topic zigbee2mqtt/FRIENDLY_NAME/get
with payload {"voltage": ""}
.
It’s not possible to write (/set
) this value.
The unit of this value is V
.
Energy (numeric) #
Sum of consumed energy.
Value can be found in the published state on the energy
property.
To read (/get
) the value publish a message to topic zigbee2mqtt/FRIENDLY_NAME/get
with payload {"energy": ""}
.
It’s not possible to write (/set
) this value.
The unit of this value is kWh
.
Power_outage_memory (enum) #
Recover state after power outage.
Value can be found in the published state on the power_outage_memory
property.
It’s not possible to read (/get
) this value.
To write (/set
) a value publish a message to topic zigbee2mqtt/FRIENDLY_NAME/set
with payload {"power_outage_memory": NEW_VALUE}
.
The possible values are: on
, off
, restore
.
Linkquality (numeric) #
Link quality (signal strength).
Value can be found in the published state on the linkquality
property.
It’s not possible to read (/get
) or write (/set
) this value.
The minimal value is 0
and the maximum value is 255
.
The unit of this value is lqi
.
Manual Home Assistant configuration #
Although Home Assistant integration through MQTT discovery is preferred, manual integration is possible with the following configuration:
switch:
- platform: "mqtt"
state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
availability_topic: "zigbee2mqtt/bridge/state"
payload_off: "OFF"
payload_on: "ON"
value_template: "{{ value_json.state }}"
command_topic: "zigbee2mqtt/<FRIENDLY_NAME>/set"
sensor:
- platform: "mqtt"
state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
availability_topic: "zigbee2mqtt/bridge/state"
unit_of_measurement: "W"
value_template: "{{ value_json.power }}"
icon: "mdi:flash"
sensor:
- platform: "mqtt"
state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
availability_topic: "zigbee2mqtt/bridge/state"
unit_of_measurement: "A"
value_template: "{{ value_json.current }}"
icon: "mdi:current-ac"
sensor:
- platform: "mqtt"
state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
availability_topic: "zigbee2mqtt/bridge/state"
unit_of_measurement: "V"
value_template: "{{ value_json.voltage }}"
icon: "mdi:alpha-v"
sensor:
- platform: "mqtt"
state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
availability_topic: "zigbee2mqtt/bridge/state"
unit_of_measurement: "kWh"
value_template: "{{ value_json.energy }}"
icon: "mdi:power-plug"
sensor:
- platform: "mqtt"
state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
availability_topic: "zigbee2mqtt/bridge/state"
value_template: "{{ value_json.power_outage_memory }}"
sensor:
- platform: "mqtt"
state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
availability_topic: "zigbee2mqtt/bridge/state"
unit_of_measurement: "lqi"
value_template: "{{ value_json.linkquality }}"
icon: "mdi:signal"