To contribute to this page, edit the following file

TuYa TS0222 #

Model TS0222
Vendor TuYa
Description Light intensity sensor
Exposes battery, illuminance, illuminance_lux, linkquality
Picture TuYa TS0222

Notes #

Device type specific configuration #

How to use device type specific configuration

Exposes #

Battery (numeric) #

Remaining battery in %. Value can be found in the published state on the battery property. It’s not possible to read (/get) or write (/set) this value. The minimal value is 0 and the maximum value is 100. The unit of this value is %.

Illuminance (numeric) #

Raw measured illuminance. Value can be found in the published state on the illuminance property. It’s not possible to read (/get) or write (/set) this value.

Illuminance_lux (numeric) #

Measured illuminance in lux. Value can be found in the published state on the illuminance_lux property. It’s not possible to read (/get) or write (/set) this value. The unit of this value is lx.

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:

sensor:
  - platform: "mqtt"
    state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
    availability_topic: "zigbee2mqtt/bridge/state"
    value_template: "{{ value_json.battery }}"
    unit_of_measurement: "%"
    device_class: "battery"
    state_class: "measurement"

sensor:
  - platform: "mqtt"
    state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
    availability_topic: "zigbee2mqtt/bridge/state"
    value_template: "{{ value_json.illuminance }}"
    device_class: "illuminance"
    enabled_by_default: false
    state_class: "measurement"

sensor:
  - platform: "mqtt"
    state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
    availability_topic: "zigbee2mqtt/bridge/state"
    value_template: "{{ value_json.illuminance_lux }}"
    unit_of_measurement: "lx"
    device_class: "illuminance"
    state_class: "measurement"

sensor:
  - platform: "mqtt"
    state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
    availability_topic: "zigbee2mqtt/bridge/state"
    value_template: "{{ value_json.linkquality }}"
    unit_of_measurement: "lqi"
    enabled_by_default: false
    icon: "mdi:signal"
    state_class: "measurement"