Hi.
I have probably the same device and the same problem and I would enjoy help as well.
Device normal info
- Brand: unknown
- Model: WIFI Smoke detector with temp and humidity sensor
Device info
{
"active_time": 1690391461,
"biz_type": 18,
"category": "ywbj",
"create_time": 1690391461,
"icon": "smart/icon/ay15427647462366edzT/13e5f1cb7df593e6b812947b9566d939.png",
"id": "bf7ac46e4576493b73586z",
"ip": "***",
"lat": "***",
"local_key": "***",
"lon": "***",
"model": "",
"name": "Smoke sensor",
"online": true,
"owner_id": "153986064",
"product_id": "fzb5up2iehjcrnqy",
"product_name": "WIFI TH&Smoke sensor",
"status": [
{
"code": "smoke_sensor_state",
"value": "normal"
},
{
"code": "battery_percentage",
"value": 100
},
{
"code": "muffling",
"value": false
},
{
"code": "temp_current",
"value": 247
},
{
"code": "humidity_value",
"value": 63
},
{
"code": "self_test",
"value": true
},
{
"code": "temp_alarm",
"value": "cancel"
}
],
"sub": false,
"time_zone": "+02:00",
"uid": "***",
"update_time": 1690752245,
"uuid": "7326d42ff642b61f"
}
Device specifications
2023-07-31 00:16:20.515 DEBUG (SyncWorker_0) [tuya_iot] Response: {
"result": {
"category": "ywbj",
"functions": [
{
"code": "muffling",
"type": "Boolean",
"values": "{}"
}
],
"status": [
{
"code": "smoke_sensor_state",
"type": "Enum",
"values": "{\"range\":[\"alarm\",\"normal\"]}"
},
{
"code": "battery_percentage",
"type": "Integer",
"values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
},
{
"code": "muffling",
"type": "Boolean",
"values": "{}"
},
{
"code": "temp_current",
"type": "Integer",
"values": "{\"unit\":\"℃\",\"min\":-100,\"max\":1000,\"scale\":1,\"step\":1}"
},
{
"code": "humidity_value",
"type": "Integer",
"values": "{\"unit\":\"%\",\"min\":1,\"max\":100,\"scale\":0,\"step\":1}"
},
{
"code": "self_test",
"type": "Boolean",
"values": "{}"
},
{
"code": "temp_alarm",
"type": "Enum",
"values": "{\"range\":[\"loweralarm\",\"upperalarm\",\"cancel\"]}"
}
]
},
"success": true,
"t": 1690755360426,
"tid": "aa1794bb2f2611eea260e28454ac584b"
}
I have tried to edit sensors.py myself, but I’m probably doing something incorrectly as the entities are not added in Home Assistant
--- sensor.py_orig
+++ sensor.py
@@ -737,0 +738,12 @@
+ TuyaSensorEntityDescription(
+ key=DPCode.TEMP_CURRENT,
+ translation_key="temperature",
+ device_class=SensorDeviceClass.TEMPERATURE,
+ state_class=SensorStateClass.MEASUREMENT,
+ ),
+ TuyaSensorEntityDescription(
+ key=DPCode.HUMIDITY_VALUE,
+ translation_key="humidity",
+ device_class=SensorDeviceClass.HUMIDITY,
+ state_class=SensorStateClass.MEASUREMENT,
+ ),