ebaauw / homebridge-hue

Homebridge plugin for Philips Hue
Apache License 2.0
898 stars 91 forks source link

Problem With TRV TS0601 Thermostat #1032

Closed pillemats closed 2 years ago

pillemats commented 3 years ago

hi ebaauw

i spend some days to get my zigbee thermostates to work.

my hardware:

i can add the trv to deconz and they will work great with API.

Bildschirmfoto 2021-10-16 um 22 03 31

I tried all of the funktions with the deconz guys and the supportet me great! Many thanks!

Now the problem:

The TRV will shown correctly as an trv in homekit and i can change the temperature but i cant change the state. Mode off and manuall wont work if i change to off, it will switch directly to automatic back. also in some cases the temperatur will not correctly transmitted. The TRV says 15 grad and in Homekit 2 grad

IMG_0020 IMG_0622 2

the guys from deconz say this is an homebridge issue and i hope you can help me!!!

Thank you very much

ebaauw commented 3 years ago

i can add the trv to deconz and they will work great with API.

Are you sure? It's reporting a current temperature of 2°C. That would explain why HomeKit reports that value.

the guys from deconz say this is an homebridge issue and i hope you can help me!!!

It's not so much a Homebridge issue, as it is a difference between HomeKit and Zigbee (or probably even the Tuya device, since they hardly follow the Zigbee standard). HomeKit expects a Current Heating/Cooling State and a Target Heating/Cooling State. You set the target state through the Home app, and it reports the current state through the colour fo the temperature on the tile. The current state takes values off, heating, and cooling. The target state takes values off, heating, cooling, auto, where the latter means: automatically switch between heating and cooling. So that value only makes sense for thermostats that actually support cooling, unlike TRVs.

Back in the day (before I fully understood the HomeKit support for thermostats), I made a hack for the Eurotronic Spirit, which actually support three operating modes for the valve: closed, open, temperature controlled. I incorrectly mapped these to Target Heating/Cooling State values off, heating, auto. For other TRVs, the characteristic is exposed, but not yet implemented, as I don't know how these work. I'm happy to add support for thus TRV, but I need documentation on what the API attributes mean, and what values they can take. Also, the wrongly reported current temperature needs to be fixed in deCONZ (or in the device firmware).

pillemats commented 3 years ago
  1. you are right, this was an deconz problem. after re pair the problem was away

  2. ok the problem is that i cant turn off the trv. it switch directly to automatic back. (in API from deconz it works) temperature control works. I will dicuss the stuff you need with the deconz guys.

Thank for your fast support!!

TheNON75 commented 3 years ago

Hi @ebaauw

According to my practice, TaergetHeatingCoolongState for Thermostat should be off (HK off as 0) or auto (HK heat as 1) and so the validValues. This way there will be a simple button instead the mode selection, to turn off or on the thermostat. For HeaterCooler the parental lock can be implemented too.

Ps.: alternatively HomeKit heat could be considered as boost and auto mode as auto, but this could break the logic in general, so I always go with the "my practice"

ebaauw commented 2 years ago

alternatively HomeKit heat could be considered as boost and auto mode as auto, but this could break the logic in general, so I always go with the "my practice"

Yes, I agree. As I indicated above, the use of AUTO vs HEAT for the Spirit is a hack.

So auto in the REST API plugin basically means automatically control the valve position, where in HomeKit it means: automatically choose between heating and cooling. Consequently, Boost mode should be exposed separately, both in the API as well as in HomeKit.

Above change supports setting Target Heating Cooling State, with values OFF (0) and HEAT (1), for any ZHAThermostat that supports config.mode. When setting the characteristic to OFF, mode is set to off; when setting it to HEAT, mode is set to auto. API value auto and any value other than off (e.g. heat) are mapped to HEAT.

This means that boost mode for the Eurotronic Spirit will no longer be recognised (as it's reported as HEAT) and can no longer be set from HomeKit. I could eventually expose this using a custom characteristics, but before doing that, I think it should be exposed better by the deCONZ REST API (probably when supporting setting the valve position directly).

ebaauw commented 2 years ago

In v0.13.27.