Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge πŸŒ‰, get rid of your proprietary Zigbee bridges πŸ”¨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.64k stars 1.64k forks source link

Bosch BMCT-SLZ Light/shutter control unit II: Failed to read state after reconnect genOnOff UNSUPPORTED_ATTRIBUTE #20730

Closed L3nny5 closed 6 months ago

L3nny5 commented 7 months ago

What happened?

I had some issues with my BMCT-SLZ shutter control. So I updated from version 1.35.0 to 1.35.1 (non dev). After the update I removed the BMCT-SLZ, rebooted Z2M and added the BMCT-SLZ via Tools -> Add Install Code. The device immediately connected to Z2M and is working. However, I always get this error message in the front end, which you can also see in the logs. Sometimes mutliple times in a few seconds, sometimes no message in 10-15 min at all.

Failed to read state of '0xf4b3b1fffe403772' after reconnect (Read 0xf4b3b1fffe403772/1 genOnOff(["onOff"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE'))

So I tried changing over to Z2M Dev to see if the bug fixes maybe fixed it. It seems better (less messages). But I also received these messages a lot during OTA updates, which took ages (IKEA RCs). Guess during that time Z2M is polling a lot of devices at once ?!?

The BMCT-SLZ is fully controllable via Z2M, so there is not really an issue. It is just annoying and is spamming the logs. However there is one thing which I think is not the way it is supposed to (reason why I initially upgraded to 1.35.1):

You have to configure/calibrate the BMCT-SLZ in order to use the physical Buttons for the shutter, otherwise they're inactive. There are two tabs to configure the device: Exposes and Settings(specific). If I just use Exposes the device works just fine. However it is showing a lot of information which is only relevant if you use the BMCT-SLZ as a light control. If you set the device to shutter in Settings(specific) a lot of unused settings disappears from Exposes (I guess intended). However it also removes settings which you still need in order to configure the device, that you can use the physical buttons: Device mode and Switch type. Also, once you set Device mode in Settings(specific) you cannot switch it back to nothing. You can only switch between light and shutter, which does not help configure the device to the correct settings in order to use the physical buttons.

A workaround for the configuration was for me to configure Exposes first and then Settings(specific). Then everything worked with the BMCT-SLZ, but the error message is appearing... Also I just noticed that the State changes after some time from STOP to nothing, which wasn't the case with 1.35.0.

Settings(specific) not configured

settings-specific-not_configured

Exposes, if Settings(specific) is not configured

Exposes-not_configured

Settings(specific) configured

settings-specific-configured

Exposes, if Settings(specific) is configured

Exposes-configured

What did you expect to happen?

Device is configured correctly: I can configure Switch type (and Device mode(no idea if it is needed)) also when Device mode in Settings(specific) is configured to shutter.

Also I think configuration for the Switch Type should be in Settings(specific). You don't change it very often.

How to reproduce it (minimal and precise)

  1. Add BMCT-SLZ via Install code - you already get the state read error message at the end of the config
  2. Change configuration in Settings(specific)
  3. You cannot set Switch Type in Exposes anymore

Zigbee2MQTT version

1.35.1-dev

Adapter firmware version

20230507

Adapter

SONOFF Zigbee 3.0 USB Dongle Plus

Setup

Docker: koenkk/zigbee2mqtt:latest-dev

Debug log

log.txt

slugzero commented 6 months ago

Thanks for raising this, @L3nny5. You are right, the switch type should also be exposed in "roller shutter" mode. Should be fixed with PR 7087 Note that as an intermediate solution, you can set/reset the device_mode and switch_type by manually sending an MQTT message to zigbee2mqtt/FRIENDLY_NAME/set with payload {"device_mode": NEW_VALUE} where NEW_VALUE is one of light, shutter, or disabled for device mode, and payload {"switch_type": NEW_VALUE} where NEW_VALUE is one of button, button_key_change, rocker_switch or rocker_switch_key_change for the switch type.

I could also reproduce the UNSUPPORTED_ATTRIBUTE error, however it only appears once at startup or on reconnect, e.g. when I power cycle the device. If this error appears every few minutes or even seconds for you, this would mean that your device reconnects very often. The error messages should also be gone with the PR, but you might still want to verify your connection quality.

L3nny5 commented 6 months ago

Thank you! I haven't tested it yet as I'm back on stable. I will test it as soon as this will be released to stable. However after multiple reinstallations of Z2M at some point the UNSUPPORTED_ATTRIBUTE error only appeared once. I also updated the FW of the Bosch BMCT-SLZ with the Bosch hub. Could be related to it as well. For the configuration, if you set everything before you switch the device mode, it was also usable. But once you changed the mode of the actor you had to remove the device to reconfigure.

ring0r commented 5 months ago

Hi everyone,

I'm also experiencing the same issues with my BMCT-SLZ. I'm currently stuck in shutter mode and can't change anything. Is there any way to manually apply the changes from the PR (#7087) [Note that as an intermediate solution, you can set/reset the device_mode and switch_type by manually sending an MQTT message to zigbee2mqtt/FRIENDLY_NAME/set with payload {"device_mode": NEW_VALUE} where NEW_VALUE is one of light, shutter, or disabled for device mode, and payload {"switch_type": NEW_VALUE} where NEW_VALUE is one of button, button_key_change, rocker_switch or rocker_switch_key_change for the switch type.] like here ... while we wait for an official update? I'm relatively new to Home Assistant (only 10 days) and could use some guidance to apply these steps ...

Also, is it possible to control the slats of the external blinds like with the Bosch Smart Home Controller, i.e. the tilt angle?

Thanks in advance!

L3nny5 commented 5 months ago

Hey ring0r,

this fix is for Zigbee2Mqtt (Z2M) not for Home Assistant. I guess you are using the plugin zigbee2mqtt? Or are you using ZHA?

If you are using the plugin Z2M then have a look here: https://www.zigbee2mqtt.io/guide/usage/mqtt_topics_and_messages.html#zigbee2mqtt-friendly-name-set

To send the message you can use a MQTT client like MQTT Explorer Check out this tutorial

Lenny