Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.21k stars 1.68k forks source link

Unable to turn off thermostat from Home Assistant climate entity #21647

Open joaquinvacas opened 8 months ago

joaquinvacas commented 8 months ago

What happened?

Some Thermostats, like mines ( https://www.zigbee2mqtt.io/devices/TYBAC-006.html#tuya-tybac-006 ) report state as a separate entity.

While it may look like nothing, this is some of a dealbreaker for some cases like Areas treating them as normal switches while they are not, but this is not the biggest problem after all (although it reports as a separate switch for services and exports to assistants like Google Home, where you have two separate entities, one for climate and another one for turning on and off that climate entity).

They are being stuck in a "System mode" (heat/cool/fan) even if they are off, while other thermostats (the older Z-Wave ones I had) show off as another mode, which usually is the normal way of working.

Maybe some screenshots will help:

This is what's expected (check there's a "off" mode to set the thermostat):

image image

And this is what happens right now, there's no "off" mode:

image

While its state is "off" right now.

image

And while maybe in a fancoil thermostat doesn't seem like too much due to having 3 status (plus off), on a standard thermostat that does only heating, the standard status should be:

image

And now looks like this: image

Even if its state is set to off.

image

With no way of turning it off easily using the climate service, where it belongs.

What did you expect to happen?

State should be part of "System mode"

image

Instead of being a single entity

image

So it can be controlled as a whole climate entity and therefore, fixing the climate card's way of working (treating off as another mode, which is what the device does physically, you can't have heat and be turned off at the same time!)

image

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.36.0

Adapter firmware version

6.7.8.0 build 373

Adapter

LAN EZSP, but not adapter related

Setup

Add-on on Home Assistant

Debug log

No response

lumilooms commented 6 months ago

The BAC-006 WiFi version and Zigbee version of the climate thermostat screenshots in Home Assistant shown below.

WiFi - BAC-006 with OFF function in Mode

BAC-006 WiFI Mode with OFF

BAC-006 WiFI Mode with OFF controls

ISSUE: Zigbee - BAC-006 has no OFF function in Mode

Zigbee2MQTT

Zigbee BAC-006 with no OFF 1 Zigbee BAC-006 with no OFF

As per joaquinvacas request, State should be part of "system_mode" in the Zigbee version. This messes up the climate thermostat function as the BAC-006 is forever turned on in the climate card.

There is another Zigbee version from the same manufacturer, model BAC-003 that has system_mode OFF.

BAC-003: {"system_mode": VALUE} where VALUE is one of: off, cool, heat, fan_only.

BAC-006": {"system_mode": VALUE} where VALUE is one of: cool, heat, fan_only.

joaquinvacas commented 6 months ago

Reported this issue two months ago and it's still not fixed.

I'm not a developer (DevOps mainly, not into JS/TS) but I may have a look into the zigbee-herdsman-converters code and try to make a Pull Request for that :)

joaquinvacas commented 6 months ago

Okay @Koenkk I don't want to mess up with PR requests on herdsman-converters (and I just have my work machine right now with me so no GH login and blahblah, if I can try the damn converter I may do the pull request when I have my personal laptop) and you may know the best way of proceeding with this:

So there area a lot of already-working thermostats

image

The changes I made were those ones that I've took from BAC-003 which has the off mode and datapoints seems to be the same for TY-BAC006.

I've tried to create an external converter but I can't manage to get it working since tuya.ts is TypeScript and Z2M expects JS, which is out of scope for me :)

Also, I'm not sure about the differences between "BAC-003" and "TYBAC-006" so maybe is the same device in the end? I'm not sure if there any more devices that have the same issue.

Koenkk commented 6 months ago

@joaquinvacas what you can do to try other converters is to stop z2m, change the manufacturerName of your device to the one of the other definition and start z2m. (no external converters required 😄 )

joaquinvacas commented 6 months ago

@joaquinvacas what you can do to try other converters is to stop z2m, change the manufacturerName of your device to the one of the other definition and start z2m. (no external converters required 😄 )

Did it.

Now recognizes it as BAC-003: image

And as expected, it does report "off" as another system_mode: image

Therefore, it's possible to turn it off from the Home Assistant climate cards:

image image

And can confirm it's working fine :smile:

joaquinvacas commented 5 months ago

@joaquinvacas what you can do to try other converters is to stop z2m, change the manufacturerName of your device to the one of the other definition and start z2m. (no external converters required 😄 )

@Koenkk Well, after some testing, I can say that _systemmode is the correct one being used on BAC-003 but the rest of the exposed entities need the BAC-006 ones, as BAC-003 is a more limited device, so a mix between BAC-003 system_mode and the rest of the already working BAC-006 features :)

Koenkk commented 5 months ago

Could you check if the issue is fixed with the following external converter:

lumilooms commented 5 months ago

Thanks for the file. I've tried it but it does not work for me :( Note: This is my first time using an external converter, so I'm not sure if I've done it correctly. I stopped and restarted z2mqtt and also rebooted home assistant.

image image

z2mqtt log: [2024-06-13 20:02:03] info: z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Zigbee BAC-006', payload '{"child_lock":"UNLOCK","current_heating_setpoint":15,"deadzone_temperature":1,"eco_mode":"OFF","fan_mode":"high","linkquality":54,"local_temperature":28,"local_temperature_calibration":0,"manual_mode":"ON","max_temperature":35,"max_temperature_limit":15,"min_temperature":15,"min_temperature_limit":24,"schedule_friday":"06:00/20.0 11:30/20.0 13:30/20.0 17:30/20.0","schedule_monday":"06:00/20.0 11:30/20.0 13:30/20.0 17:30/20.0","schedule_saturday":"06:00/20.0 11:30/20.0 13:30/20.0 17:30/20.0","schedule_sunday":"06:00/20.0 11:30/20.0 13:30/20.0 17:30/20.0","schedule_thursday":"06:00/20.0 11:30/20.0 13:30/20.0 17:30/20.0","schedule_tuesday":"06:00/20.0 11:30/20.0 13:30/20.0 17:30/20.0","schedule_wednesday":"06:00/20.0 11:30/20.0 13:30/20.0 17:30/20.0","state":"ON","system_mode":"cool","valve":"OPEN"}'

DBunevich commented 4 months ago

I was able to fix the issue by changing in the converter the following:

  1. Adjusted model names as per the model in Z2M:

1.1. Adjusted: image

1.2. Model information in Z2M: image

  1. Added "Off" and removed "Heat" (as it's not available for my system) states in line 28: image

Once done, reboot Z2M and all should be fine.

The only thing I don't know how to fix is the photo of the device which got lost after the converter is used:

image

pcrednet commented 2 months ago

Could you check if the issue is fixed with the following external converter:

  • save this as file next to configuration.yaml as ext_converter.js
  • add it to configuration.yaml:
external_converters:
  - ext_converter.js
  • start z2m, check if issue is fixed

Hello, good morning.

@Koenkk I confirm that your converter works with the bac-006.

the model I have is this one:, i only changed this value.

_TZE204_mpbki2zm

But only works from Z2m to device. When i switch off device, in z2m only change state to off, system mode don't change.

image

image

Thx

DBunevich commented 2 months ago

But only works from Z2m to device. When i switch off device, in z2m only change state to off, system mode don't change.

I have the same problem.

pcrednet commented 2 months ago

Another bug I see is that home assistant does not show when it is cooling or heating.

It only shows that the valve entity is open or close, but home assistant climate does not see that. image

Is there any way to indicate if it is heating or cooling from Z2M?

Thanks

robvanoostenrijk commented 3 days ago

Just came across this issue randomly, I noticed BAC-003 is referenced.

The reason why BAC-003 works in the climate card is because I encountered the same issue and implemented a virtual off system_mode, which is the behavior you are seeing.

You can find the pull request here: https://github.com/Koenkk/zigbee-herdsman-converters/pull/7257

Doing the same for the BAC-006 module should fulfill your requirements.

joaquinvacas commented 1 day ago

Just came across this issue randomly, I noticed BAC-003 is referenced.

The reason why BAC-003 works in the climate card is because I encountered the same issue and implemented a virtual off system_mode, which is the behavior you are seeing.

You can find the pull request here: Koenkk/zigbee-herdsman-converters#7257

Doing the same for the BAC-006 module should fulfill your requirements.

@Koenkk Replacing on the .db/config files my model with this allows me to turn it off using system_mode (but messes up with some other config available on BAC-006)

Your converter some comments up there seems to not be working for me :S

pcrednet commented 1 day ago

we have an installation with 30 bac-006 with @koenkk's converter. we have had to make several networks because the flow of messages is very high and putting more than 10 in one network makes it saturate and block the coordinator. we have tried with slzb-06, slzb-06P7, several channels, several locations... and it is random, there are devices that one day do not saturate and others if... I have not managed to see what makes that happen.

Is there any way to indicate that the thermostat does not send so much information?