Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Smartlife Plant Sensor SGS01 #88

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions custom_components/tuya_ble/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,61 @@ class TuyaBLECategorySensorMapping:
],
},
),
"zwjcy": TuyaBLECategorySensorMapping(
products={
"gvygg3m8": [ # Smartlife Plant Sensor SGS01
TuyaBLETemperatureMapping(
dp_id=5,
coefficient=10.0,
description=SensorEntityDescription(
key="temp_current",
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
),
),
TuyaBLESensorMapping(
dp_id=3,
description=SensorEntityDescription(
key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
),
),
TuyaBLESensorMapping(
dp_id=14,
description=SensorEntityDescription(
key="battery_state",
icon="mdi:battery",
device_class=SensorDeviceClass.ENUM,
entity_category=EntityCategory.DIAGNOSTIC,
options=[
BATTERY_STATE_LOW,
BATTERY_STATE_NORMAL,
BATTERY_STATE_HIGH,
],
),
icons=[
"mdi:battery-alert",
"mdi:battery-50",
"mdi:battery-check",
],
),
TuyaBLEBatteryMapping(
dp_id=15,
description=SensorEntityDescription(
key="battery_percentage",
device_class=SensorDeviceClass.BATTERY,
native_unit_of_measurement=PERCENTAGE,
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.MEASUREMENT,
),

),
],
},
),
"znhsb": TuyaBLECategorySensorMapping(
products={
"cdlandip": # Smart water bottle
Expand Down