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

DDF for Sonoff TRVZB Thermostat #7357

Merged
merged 3 commits into from
Mar 28, 2024
Merged

Conversation

fox34
Copy link
Contributor

@fox34 fox34 commented Nov 15, 2023

As discussed in #7334. Thank you @Smanar!

  • Product name : TRVZB
  • Manufacturer : SONOFF
  • Model identifier : TRVZB

@SwoopX SwoopX linked an issue Dec 11, 2023 that may be closed by this pull request
1 task
Copy link
Collaborator

@SwoopX SwoopX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there,

I'm afraid, the DDF requires some significant changes to be considered. The suggested file would be barely functional.

{
"name": "attr/uniqueid"
},
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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": [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add additional thermostat bindings

{
          "at": "0x0012",
          "dt": "0x29",
          "min": 1,
          "max": 3600,
          "change": "0x00000001"
        },
        {
          "at": "0x001C",
          "dt": "0x30",
          "min": 1,
          "max": 3600
        }

Comment on lines 96 to 98
"min": 30,
"max": 360,
"change": "0x0000000A"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the values to:

          "min": 60,
          "max": 300,
          "change": "0x00000064"

Comment on lines 69 to 71
{
"name": "state/on"
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This item is not supported, so please remove.

Comment on lines 59 to 61
{
"name": "config/mode"
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
]
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the default value and add "refresh.interval": 3660 instead.

Comment on lines 62 to 65
{
"name": "config/offset",
"default": 0
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
        },

@Smanar
Copy link
Collaborator

Smanar commented Jan 10, 2024

@fox34 are you still here ?

@fox34
Copy link
Contributor Author

fox34 commented Jan 10, 2024

I made the requested changes, however:

Please investigate which modes are supported by the device.

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.

@fox34 fox34 requested a review from SwoopX January 11, 2024 08:44
@Smanar
Copy link
Collaborator

Smanar commented Jan 11, 2024

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.
From Z2M they are using same

.withSystemMode(['off', 'auto', 'heat'], ea.ALL, 'Mode of the thermostat')

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


                {
                    "name": "config/locked",
                    "read": {
                        "at": "0x0000",
                        "cl": "0xFC11",
                        "ep": 1,
                        "fn": "zcl:attr"
                    },
                    "write": {
                        "at": "0x0000",
                        "cl": "0xFC11",
                        "dt": "0x30",
                        "ep": 1,
                        "eval": "Item.val ? 1 : 0;",
                        "fn": "zcl:attr"
                    },
                    "parse": {
                        "at": "0x0000",
                        "cl": "0xFC11",
                        "ep": 1,
                        "eval": "Item.val = Attr.val",
                        "fn": "zcl:attr"
                    },
                    "default": false,
                    "refresh.interval": 84000
                },

for the lock/unlock

Copy link
Collaborator

@SwoopX SwoopX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok for me wrt the requested changes, thanks!

@manup
Copy link
Member

manup commented Feb 5, 2024

So ready for merging? :)

@Smanar
Copy link
Collaborator

Smanar commented Feb 5, 2024

For me yes, have checked again ,all @SwoopX remark are resolved.

@coives
Copy link

coives commented Mar 14, 2024

When merging?

@SwoopX SwoopX added this to the v2.27.0-beta milestone Mar 21, 2024
@manup manup merged commit 5e399d1 into dresden-elektronik:master Mar 28, 2024
1 check passed
@manup manup changed the title DDF for SONOFF TRVZB Thermostat DDF for Sonoff TRVZB Thermostat Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Device Request: SONOFF TRVZB Thermostat
5 participants