You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed this with a basic fan I have, but it seems like it could be more widespread as a similar code signature exists in window covering and possibly others. I can make the code change or leave it up to you, just let me know your thoughts (maybe there was a reason to do some of this and I dont have it set up to test my changes, so I can only make them blind).
Fan example to illustrate problem:
In FanControlServer the FeaturedBase defines all available options to start with
This leads to all of the features being included regardless of whether they are supported on HA. Possible fixes would be to not start with the default in FanControlServer, or alternatively to remove the ... from FanDevice.
Hello,
thank you for reaching out. I think you got something wrong.
The underlying matter.js library has implemented a specific pattern which I adopted to my needs:
FeaturedBase is just defining which features I want to support in general
FanControlServerBase is my specific implementation extending the FeaturedBase. I need to put all the code into it to handle all features. If not extending the fully featured base, i wouldn't be able to access all the state props or handle all commands.
At the bottom of this file, you'll find the actual FanControlServer which extends my fully featured FanControlServerBase. BUT by using .for(ClusterType(FanControl.Base)), all the features are removed from the class. The implementation stays, but the features are not activated anymore.
So maybe you could describe a bit more in detail, what is actually wrong / not working.
Ok, without being set up to test out code flows I must have missed how that is working. I can give it some more look, but you may be able to spot the issue more quickly.
The true issue you can see from the state and attribute logs above. This specific fan should only have the on and off attributes since the HA features is 48 (16 & 32), but what shows in the bridge and in Google home are the additional attributes that you can see in the bridge state log.
Functionally this means showing the fan speed slider even though it is not supported.
Version
3.0.0-63
Matter Controller
NA
Steps to reproduce
I noticed this with a basic fan I have, but it seems like it could be more widespread as a similar code signature exists in window covering and possibly others. I can make the code change or leave it up to you, just let me know your thoughts (maybe there was a reason to do some of this and I dont have it set up to test my changes, so I can only make them blind).
Fan example to illustrate problem:
In FanControlServer the FeaturedBase defines all available options to start with
https://github.com/t0bst4r/home-assistant-matter-hub/blob/v3.0.0-alpha.63/packages/backend/src/matter/behaviors/fan-control-server.ts#L13
but then within FanDevice it does FanControlServer.with(...FanControlFeatures(supportedFeatures)) to check home assistant for the supported features, but then only appends them on (i.e. the ...) rather than replacing everything that was defaulted in previously.
https://github.com/t0bst4r/home-assistant-matter-hub/blob/v3.0.0-alpha.63/packages/backend/src/matter/devices/fan-device.ts#L47
This leads to all of the features being included regardless of whether they are supported on HA. Possible fixes would be to not start with the default in FanControlServer, or alternatively to remove the ... from FanDevice.
State and attributes
HA fan:
supported_features: 48
Bridge state:
Relevant log output
Documentation & Issues
The text was updated successfully, but these errors were encountered: