I’m trying to understand what the “supported_features” attribute in my media players mean, but i have not been able to find any documentation to help me.
My Spotify media player has the attribute “supported_features: 51765”. How/where do I find information to help me understand what that number means?
Thanks @nickrout. I have to admit that seemed counter-intuitive, as it seemed like a lot of work to find the combination of features whose constants would add up to the supported_features total for my media player. But I made a spreadsheet that added up all the constants from the page you gave, then started removing features I didn’t think my player had, and sure enough, it added up to the supported_features total.
Just out of curiosity: does anyone know why it’s done that way?
It makes more sense in binary and is faster to interpret for humans as well,
from the linked file we can learn there’s 17 features represented so far i.e. 17 bits. (irc pythons bit size is unbounded meaning it is actually a 17 bit value so far)
so let’s look at it as binary instead:
00000000000000000 = 0 This indicates it supports nothing
00000000010000000 = 128 Supports Turn_on but nothing else
00000000100000000 = 256 Supports Turn_off but nothing else
00000000110000000 = 384 Supports Turn_on and Turn_off but nothing else
1111111110011111111 = 523519 Support everything but Turn_on and Turn_off
you could represent this as a bunch of booleans as well but this solution is a bit more elegant when you want to pass the value around since you only have to pass and process one variable.
So sorry, I thought the thread was referring to the piece of quoted code.
I am trying to figure out what features are in included in supported_features of other entities than only ‘media_player’. Right now I want to know more about a ‘cover’ entity.
Taking a look at the code of ‘cover’ I don’t see a list of features with their corresponding meaning and binary value.
My cover entity is specified with supported_features: 3
I guess that means only two features actually?
10000000000000000
01000000000000000
So basically it means my cover probably supports open en close?
So, now you know that your Samsung Player has SUPPORT_SELECT_SOURCE
Great, but how can you actually use this knowledge to create an automation?
What YAML syntax is need to get things moving?
For the convenience of anyone stumbling on this conversation, here’s some quick Python3 code to print a list of which features are supported or unsupported for a given value of supported_features:
In the case of this television you can see the sound but I have no way to turn it on or change the origin for example.
I have another philips that I have to control with a broadlink because it has no possibility of doing anything. Maybe it is not understood why I use a translator. Excuse me and thank you very much for answering
Tv philips (fewer options despite being newer)
device_class: tv
friendly_name: 43PFG5813/77
supported_features: 155453
The audio equipment despite having a smaller number in supported_features: 66060 shows much more information