Skip to content

Commit

Permalink
Fix missing battery status for various Tuya sensors (#7951)
Browse files Browse the repository at this point in the history
  • Loading branch information
Smanar authored Sep 30, 2024
1 parent f3129fb commit 5d3b203
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 4 deletions.
32 changes: 30 additions & 2 deletions devices/tuya/_TZ3210_ncw88jfq_temp-hum-sensor.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,21 @@
"name": "attr/uniqueid"
},
{
"name": "config/battery"
"name":"config/battery",
"refresh.interval": 86400,
"read":{
"at":"0x0021",
"cl":"0x0001",
"ep":1,
"fn":"zcl:attr"
},
"parse":{
"at":"0x0021",
"cl":"0x0001",
"ep":1,
"eval":"Item.val = Attr.val/2"
},
"default":0
},
{
"name": "config/offset",
Expand Down Expand Up @@ -111,7 +125,21 @@
"name": "attr/uniqueid"
},
{
"name": "config/battery"
"name":"config/battery",
"refresh.interval": 86400,
"read":{
"at":"0x0021",
"cl":"0x0001",
"ep":1,
"fn":"zcl:attr"
},
"parse":{
"at":"0x0021",
"cl":"0x0001",
"ep":1,
"eval":"Item.val = Attr.val/2"
},
"default":0
},
{
"name": "config/offset",
Expand Down
17 changes: 15 additions & 2 deletions devices/tuya/ts0202_presence_sensor.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,21 @@
"name":"attr/uniqueid"
},
{
"name":"config/battery",
"default":0
"name":"config/battery",
"refresh.interval": 86400,
"read":{
"at":"0x0021",
"cl":"0x0001",
"ep":1,
"fn":"zcl:attr"
},
"parse":{
"at":"0x0021",
"cl":"0x0001",
"ep":1,
"eval":"Item.val = Attr.val/2"
},
"default":0
},
{
"name":"config/duration"
Expand Down

0 comments on commit 5d3b203

Please sign in to comment.