home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.72k stars 30.45k forks source link

Fibaro Roller Shutter 3 recognized as Window #53230

Closed sefki21 closed 3 years ago

sefki21 commented 3 years ago

The problem

My Fibaro Roller Shutter 3 gets recognized as device_class window via z-wave js integration. That's not the case with the Roller Shutter 2. Further I can customize it to device_class shutter, to be reflected correctly - which does work for the front ent of HA, but it still gets exposed to HomeKit as window which causes some issues.

Regarding exposure to HomeKit: I already tried to remove and add accessory again after customize the device_class manually and also reset it through the reset accessory service but it remains to be exposed as window, why it seems that this needs to be corrected at the root of the issue.

Bildschirmfoto 2021-07-20 um 16 21 03

What is version of Home Assistant Core has the issue?

core-2021.7.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Z-Wave JS

Link to integration documentation on our website

https://www.home-assistant.io/integrations/zwave_js

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-home-assistant[bot] commented 3 years ago

Hey there @home-assistant/z-wave, mind taking a look at this issue as its been labeled with an integration (zwave_js) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

kpine commented 3 years ago

@sefki21 Let's ignore the Shutter 2 and zwave_js part of this for a minute. Would you say these statements are an accurate description of your problem?

  1. The Fibaro Roller Shutter 3 is recognized as a Window accessory type in the Homekit integration. Instead, you expect it to be recognized as a WindowCovering accessory type.
  2. Using the entity customization functionality to override the device class to shutter for this device had no effect on the Homekit integration and it was still recognized as a Window accessory type.
sefki21 commented 3 years ago

Hi kpine

  1. Yes, thats accurate.
  2. Thats accurate as well.

Regarding the HA UI, applying the entity customization did change the device_class to shutter successfully but still exposed to HomeKit as window.

kpine commented 3 years ago

Thanks for confirming.

The zwave_js integration defaults all window cover devices to window device class. The Shutter 2 is a shutter because it was configured manually that way in a previous change, along with some other devices. The easy fix would be to do the same thing for the Shutter 3, using the product ID to recognize the model as Shutter 3 and set it to shutter. However, the Fibaro and other shutter devices can be used in a number of applications, so the device type depends on how you personally installed it. window or garage might be the right choice for someone else.

I'm not sure this is a problem zwave_js should be solving. Is the root cause that the Homekit integration (and maybe Alexa and Google Assistant?) integration does not recognize device class customization? As I mentioned, the Shutter 3 and other devices support a variety of applications, ranging from windows to shutters to garage doors. Changing the default device class from window to shutter fixes it for some but not others.

image

Furthermore, Google Assistant will not recognize many of the cover device classes, and Alexa can distinguish between interior and exterior cover types based on the device type. The PR I linked above seems to have changed the device types for some devices to support Google Assistant based on the author's use case.

As an aside, the homekit integration docs are missing documentation for the Window type name. Apparently a device class of window specifically causes the device to be classified as the Window accessory type. Any other device type except garage or gate would detected as Window Covering accessory instead.

sefki21 commented 3 years ago

Ok. Just gave it a try and at customize I did set device_class to garage instead of shutter and indeed HomeKit successfully adapted it and exposed it as garage.

But checking the code at the device classification of homekit, my Roller Shutter 3 should be exposed as WindowCovering anyway, as I set the device_class to shutter. Seems as the HomeKit integration would only expose as window, if the device_class is set to window too, which isn't the case as I previously set it to shutter. Or am I mistaken?

kpine commented 3 years ago

Ok. Just gave it a try and at customize I did set device_class to garage instead of shutter and indeed HomeKit successfully adapted it and exposed it as garage.

Ok, then that means Homekit does recognize the customized device class, and that answers one of my questions. In theory the customization with shutter should just work then.

But checking the code at the device classification of homekit, my Roller Shutter 3 should be exposed as WindowCovering anyway, as I set the device_class to shutter. Seems as the HomeKit integration would only expose as window, if the device_class is set to window too, which isn't the case as I previously set it to shutter. Or am I mistaken?

No, that's how it looks to me. I would expect the default behavior to use Window since zwave_js sets the device_class to window and the supported features attribute includes SUPPORT_SET_POSITION. Since you've demonstrated that changing the type to garage is recognized by Homekit, I would also expect the change to shutter the same, causing the Window classification to be skipped and WindowCovering selected instead.

sefki21 commented 3 years ago

hmm seems as it was cached somewhere - did remove every bit related to the shutter, the whole z-wave config (reseted the controller). Added the nodes to z-wave controller again - set them through customize to shutter - and voila, they are now exposed to HomeKit as shutter.

Strange behavior, but at least its now solved for me.