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

ZHAThermostat - display temperature of external sensor #202

Closed
jan666 opened this issue Jan 3, 2024 · 11 comments
Closed

ZHAThermostat - display temperature of external sensor #202

jan666 opened this issue Jan 3, 2024 · 11 comments
Labels
question Further information is requested

Comments

@jan666
Copy link

jan666 commented Jan 3, 2024

I am using a Ubisys H1 thermostat. In the latest firmware (1.5 / 1.5.1) they added the ability to bind external sensor to the thermostat. I bound a SONOFF sensor and this works great. But in Home I still see the temperature of the H1 internal sensor. It looks like they don't disable it and don't expose the temperature of the external sensor. So it would be nice to link the sensor to the thermostat in homebridge-deconz, too. Could you add this?

1216-1332-max

(this could be one item because the Thermostat uses the temperature of the sensor)

@ebaauw
Copy link
Owner

ebaauw commented Jan 3, 2024

they added the ability to bind external sensor to the thermostat.

That's a standard Zigbee feature, but not exposed by the deCONZ REST API. Homebridge deCONZ has no way of knowing whether such binding exists.

So it would be nice to link the sensor to the thermostat in homebridge-deconz, too. Could you add this?

No. I won't be combining multiple devices into a single accessory. And even if I would consider that, Homebridge deCONZ wouldn't know when to do this, as it has no knowledge of the Zigbee bindings.

It looks like they don't disable it and don't expose the temperature of the external sensor.

Maybe there's a setting on the H1 to report the temperature of the external sensor instead of the internal sensor? Otherwise: How does deCONZ expose the H1? If the temperature of the external sensor is exposed through some other REST API attribute, it might use it en lieu of the internal state/temperature. I cannot expose both on a single accessory, as that would break Eve history for the thermostat.

@ebaauw ebaauw added the question Further information is requested label Jan 3, 2024
@jan666
Copy link
Author

jan666 commented Jan 4, 2024

I think even deCONZ does not know there is a binding (I never found a way to view all bindings of a device)?

No. I won't be combining multiple devices into a single accessory. And even if I would consider that, Homebridge deCONZ wouldn't know when to do this, as it has no knowledge of the Zigbee bindings.

The question was to ask if that could be done manually. Something like linking 2 sensors together via resource-item (in homebridge-hue times). Because you're already merging multiple sensor endpoints to one accessory (temperature and humidity for example).

The H1 DDF was done for firmware version 1.4.0 and the binding feature was added in 1.5.0. It is exposed like this:

{
  "config": {
    "battery": 100,
    "group": "20006",
    "heatsetpoint": 1700,
    "mode": "heat",
    "offset": 0,
    "on": true,
    "reachable": true,
    "schedule": {
      "W127": [
        {
          "heatsetpoint": 1400,
          "localtime": "T00:00"
        },
        {
          "heatsetpoint": 1700,
          "localtime": "T07:00"
        },
        {
          "heatsetpoint": 2000,
          "localtime": "T16:00"
        },
        {
          "heatsetpoint": 1400,
          "localtime": "T20:30"
        }
      ]
    },
    "schedule_on": true,
    "unoccupiedheatsetpoint": 1600
  },
  "etag": "992b61a30a01a2137e2928aec4823b05",
  "lastannounced": null,
  "lastseen": "2024-01-04T06:17Z",
  "manufacturername": "ubisys",
  "modelid": "H1",
  "name": "Thermostat DG Erik",
  "state": {
    "lastupdated": "2024-01-04T06:17:49.094",
    "on": false,
    "temperature": 2200,
    "utc": "2024-01-04T06:17:43Z",
    "valve": 0
  },
  "swversion": "1.5.1",
  "type": "ZHAThermostat",
  "uniqueid": "00:1f:ee:00:00:00:98:af-01-0201"
}

The real temperature from the external SONOFF sensor is

  "name": "Sensor DG Erik",
  "state": {
    "lastupdated": "2024-01-04T06:18:53.965",
    "temperature": 1786
  },

I already looked at the clusters listed in the deCONZ UI but I can't find anything releated to the external sensor. Its only the display of the device that shows it. I don't know if there are clusters that deCONZ does not show?

Is there a best practice how other manufacturer expose the external temperature? Maybe I could Ubisys ask to implement it like it.

@jan666
Copy link
Author

jan666 commented Jan 4, 2024

I already contacted Ubisys and they sent me their in-draft technical reference.

image

This is the temperature I am looking for:

image

So I guess the correct way is to expose this as config/externalsensortemp? And homebridge-deconz could use this as current temperature instead of state/temperature?

@ebaauw
Copy link
Owner

ebaauw commented Jan 4, 2024

The question was to ask if that could be done manually. Something like linking 2 sensors together via resource-item (in homebridge-hue times). Because you're already merging multiple sensor endpoints to one accessory (temperature and humidity for example).

Those are resources for the same device. You’re asking to combine (resources for) multiple devices into one accessory.

So I guess the correct way is to expose this as config/externalsensortemp? And homebridge-deconz could use this as current temperature instead of state/temperature?

Yes. I think it should probably be a state attribute, though. The resource item might already exist and be used for some other TRVs. https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/devices/generic/items/config_externalsensortemp_item.json

@jan666
Copy link
Author

jan666 commented Jan 4, 2024

I can't really get it to work. I tried

        {
          "name": "config/externalsensortemp",
          "refresh.interval": 3660,
          "parse": {
            "at": "0x0013",
            "cl": "0x0201",
            "ep": 1,
            "eval": "Item.val = Attr.val;",
            "fn": "zcl:attr"
          },
          "default": 0
        },

(basically copied from state/temperature, but changed the "at") but it always stays at

{
  "config": {
    "battery": 90,
    "externalsensortemp": 0,

this DDF stuff is a little bit confusing...

@ebaauw
Copy link
Owner

ebaauw commented Jan 4, 2024

I think you need to add the manufacturer code.

@jan666
Copy link
Author

jan666 commented Jan 5, 2024

You're right (again)

Now I have

{
  "config": {
    "battery": 100,
    "externalsensortemp": 1804,
    "group": "20006",
    "heatsetpoint": 1400,
    "mode": "heat",
    "offset": 0,
    "on": true,
    "reachable": true,
    "schedule": {
      "W127": [
        {
          "heatsetpoint": 1400,
          "localtime": "T00:00"
        },
        {
          "heatsetpoint": 1700,
          "localtime": "T07:00"
        },
        {
          "heatsetpoint": 2000,
          "localtime": "T16:00"
        },
        {
          "heatsetpoint": 1400,
          "localtime": "T20:30"
        }
      ]
    },
    "schedule_on": true,
    "unoccupiedheatsetpoint": 1600
  },
  "etag": "8e666c8d585b82ea807a8f5fe711daae",
  "lastannounced": null,
  "lastseen": "2024-01-05T05:51Z",
  "manufacturername": "ubisys",
  "modelid": "H1",
  "name": "Thermostat DG Erik",
  "state": {
    "lastupdated": "2024-01-03T11:45:26.565",
    "on": false,
    "temperature": 2200,
    "utc": null,
    "valve": 58
  },
  "swversion": "1.5.1",
  "type": "ZHAThermostat",
  "uniqueid": "00:1f:ee:00:00:00:98:af-01-0201"
}

@jan666
Copy link
Author

jan666 commented Jan 12, 2024

Sorry for the question - but will add this (config/externalsensortemp overrides state/temperature)? Should work for the Bosch II Thermostat too I think.

I made a pull request for the H1 DDF change

@ebaauw
Copy link
Owner

ebaauw commented Jan 12, 2024

Above commit adds a dynamic setting useExternalTemperature for thermostats that expose config/externalsensortemp. When set, Current Temperature will be based on config/externalsensortemp instead of on state/temperature. Note that Current Temperature will be updated only on the next poll.

Unfortunately, I cannot test this myself. Could you please try beta v1.0.10-0?

@jan666
Copy link
Author

jan666 commented Jan 12, 2024

$ ui put /accessories/<address> '{"useExternalTemperature": true}'
{
  "useExternalTemperature": true
}

Before:

image

After:

image

Works!

image

Thanks!

@ebaauw ebaauw closed this as completed Jan 30, 2024
@ebaauw
Copy link
Owner

ebaauw commented Feb 20, 2024

In v1.0.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants