DDF for Sonoff TRVZB Thermostat - #7357
Conversation
SwoopX
left a comment
There was a problem hiding this comment.
Hi there,
I'm afraid, the DDF requires some significant changes to be considered. The suggested file would be barely functional.
| { | ||
| "name": "attr/uniqueid" | ||
| }, | ||
| { |
There was a problem hiding this comment.
The battery reading and checkin is missing:
{
"name": "config/battery",
"awake": true,
"parse": {
"at": "0x0021",
"cl": "0x0001",
"ep": 1,
"eval": "Item.val = Attr.val / 2;",
"fn": "zcl:attr"
},
"read": {
"fn": "none"
}
},
{
"name": "config/checkin",
},
| "name": "state/lastupdated" | ||
| }, | ||
| { | ||
| "name": "state/temperature" |
There was a problem hiding this comment.
The defaults for this item are tailored for temperature measurement sensors and hence, will not work here. Please replace it by the following:
"name": "state/temperature",
"refresh.interval": 3660,
"parse": {
"at": "0x0000",
"cl": "0x0201",
"ep": 1,
"eval": "Item.val = Attr.val;",
"fn": "zcl:attr"
},
"read": {
"at": "0x0000",
"cl": "0x0201",
"ep": 1,
"fn": "zcl:attr"
}
| ] | ||
| } | ||
| ], | ||
| "bindings": [ |
There was a problem hiding this comment.
The battery binding is missing:
{
"bind": "unicast",
"src.ep": 1,
"dst.ep": 1,
"cl": "0x0001",
"report": [
{
"at": "0x0021",
"dt": "0x20",
"min": 3600,
"max": 43200,
"change": "0x00000002"
}
]
},
| "min": 30, | ||
| "max": 360, | ||
| "change": "0x0000000A" | ||
| } |
There was a problem hiding this comment.
Please add additional thermostat bindings
{
"at": "0x0012",
"dt": "0x29",
"min": 1,
"max": 3600,
"change": "0x00000001"
},
{
"at": "0x001C",
"dt": "0x30",
"min": 1,
"max": 3600
}
| "min": 30, | ||
| "max": 360, | ||
| "change": "0x0000000A" |
There was a problem hiding this comment.
Please change the values to:
"min": 60,
"max": 300,
"change": "0x00000064"
| { | ||
| "name": "state/on" | ||
| }, |
There was a problem hiding this comment.
This item is not supported, so please remove.
| { | ||
| "name": "config/mode" | ||
| }, |
There was a problem hiding this comment.
Please investigate which modes are supported by the device. The code below must be amended according to the findings:
{
"name": "config/mode",
"refresh.interval": 3660,
"read": {
"at": "0x001C",
"cl": "0x0201",
"ep": 1,
"fn": "zcl:attr"
},
"parse": {
"at": "0x001C",
"cl": "0x0201",
"ep": 1,
"eval": "if (Attr.val == 0) { Item.val = 'off' } else if (Attr.val == 1) { Item.val = 'auto' } else if (Attr.val == 4) { Item.val = 'heat' };",
"fn": "zcl:attr"
},
"write": {
"at": "0x001C",
"cl": "0x0201",
"dt": "0x10",
"ep": 1,
"eval": "if (Item.val == 'off') { 0 } else if (Item.val == 'auto') { 1 } else if (Item.val == 'heat') { 4 };",
"fn": "zcl:attr"
},
"default": "heat"
},
| "0x0000", | ||
| "0x0201" | ||
| ] | ||
| }, |
There was a problem hiding this comment.
In order to make use of the config/mode item, the following code must be added and contain the actually usable settings (see respetive item comment)
"meta": {
"values": {
"config/mode": {"off": 0, "auto": 1, "heat": 4}
}
},
| }, | ||
| { | ||
| "name": "config/heatsetpoint", | ||
| "default": 0 |
There was a problem hiding this comment.
Please remove the default value and add "refresh.interval": 3660 instead.
| { | ||
| "name": "config/offset", | ||
| "default": 0 | ||
| }, |
There was a problem hiding this comment.
Please replace by the code below:
{
"name": "config/offset",
"refresh.interval": 3660,
"read": {
"at": "0x0010",
"cl": "0x0201",
"ep": 1,
"fn": "zcl:attr"
},
"parse": {
"at": "0x0010",
"cl": "0x0201",
"ep": 1,
"eval": "Item.val = Attr.val * 10;",
"fn": "zcl:attr"
},
"write": {
"at": "0x0010",
"cl": "0x0201",
"dt": "0x28",
"ep": 1,
"eval": "Item.val / 10;",
"fn": "zcl:attr"
},
"range": [-250, 250],
"default": 0
},
|
@fox34 are you still here ? |
|
I made the requested changes, however:
How would I do this? The device can be toggled between automatic and manual operation (and turned off, obviously). Automatic mode can (only?) be configured in the "official" SONOFF app, which I cannot use because I do not own the SONOFF gateway. |
Yes, it's fine, just check wich one mode you can use on it.
And they have too problem with the "auto" mode, it seem this device don't use zigbee classic request, and use instead a personnal one > Koenkk/zigbee-herdsman-converters#6443 And BTW, they have too found some others request on the special cluster, for exemple can try for the lock/unlock |
SwoopX
left a comment
There was a problem hiding this comment.
Looks ok for me wrt the requested changes, thanks!
|
So ready for merging? :) |
|
For me yes, have checked again ,all @SwoopX remark are resolved. |
|
When merging? |
As discussed in #7334. Thank you @Smanar!