-
-
Notifications
You must be signed in to change notification settings - Fork 34.6k
Matter Speaker volume LevelControl #149490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Hey there @home-assistant/matter, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
}), | ||
'original_device_class': None, | ||
'original_icon': None, | ||
'original_name': 'On level', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "On level" represent on the speaker?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It represents the default volume level when the speaker is unmuted.
I agree that the implementation of the speaker type with the Levelcontrol cluster is not the most intuitive.
The cluster is primarily used for dimmable lamps, but it is included in the Matter specifications for other devices such as pumps, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between this volume level and the other volume level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works the same way as a light:
Level Attribute
: The current volume you can choose when the speaker is on.OnLevel Attribute
: The volume when the speaker is turned unmuted.
Specs
OnLevel Attribute
This attribute SHALL indicate the value that the CurrentLevel attribute is set to when the OnOff
attribute of an On/Off cluster on the same endpoint is set to TRUE, as a result of processing an
On/Off cluster command. If the OnLevel attribute is not implemented, or is set to the null value, it
has no effect. For more details see Effect of On/Off Commands on the CurrentLevel attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Do we explain this somewhere? I would not have understood what it does from the current name only.
This is a side note, that we don't need to address here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good point as I've been struggling with finding a good translation for "On level" before, because in German that does differ depending on what device type we're talking about.
So currently "On level" can show up under Configuration for lights, speakers and others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value of the OnLevel
attribute is null, which I don't think should be displayed, but there is a strange implementation that replaces the value with 255.
core/homeassistant/components/matter/number.py
Lines 173 to 175 in da7fc88
# use 255 to indicate that the value should revert to the default | |
device_to_ha=lambda x: 255 if x is None else x, | |
ha_to_device=lambda x: None if x == 255 else int(x), |
Yes, in principle, this can appear for all types that use the
LevelControl
cluster. Perhaps this implementation should be restricted to light types only, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The zha
integration also implements on_level
as a number entity. Here the German translation was changed to "Einschalthelligkeit" ("brightness level when turned on") by a user in 2024.
It always makes me nervous when I see such a differing wording because while adding clarity in the correct context it could be complete nonsense if it also shows up in other areas.
So if you could set different translations depending on the device type having this as "Default brightness" (if restricted to lights) or "Default volume" here would be really helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if you could set different translations depending on the device type having this as "Default brightness" (if restricted to lights) or "Default volume" here would be really helpful.
I removed it as the specs ares not very clear about this for speakers and it not really usefull.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good, then we can revisit the "On level" setting for lights at some later date!
Shouldn't we just implement the media player platform for Matter speakers first? |
Hello Marcel, Could it work if we only add there features for MediaPlayerEntity?
Do you know of any brands that have implemented this Matter speakers device type? I couldn't find anything on the CSA website https://csa-iot.org/csa-iot_products/. |
Proposed change
Matter Speaker for discussion #348.
It exposes a volume slider using the LevelControl cluster CurrentLevel attribute.
I removed the
OnLevel
selector as the specs ares not very clear about this for speakers and it not really usefull.Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: