-
-
Notifications
You must be signed in to change notification settings - Fork 109
Open
Labels
Description
Describe the bug
Could you set the 'device_class' attribute both for AppleTV and HomePods (to 'receiver' and 'speaker' respectively) ?
Trying to have some custom made sensors to count how many devices (per class) are 'playing' or 'on' and currently only possible by listing them all individually, without a 'device_class' group ...
Ex.:
- name: "Set-top Boxes on"
unique_id: "settopboxes_on"
icon: 'mdi:set-top-box'
state: >
{{ states.media_player
| rejectattr('attributes.entity_id', 'defined')
**| selectattr('attributes.device_class', 'eq', 'receiver')**
| selectattr('state', 'search', '(playing|on)')
| list | count }}
- name: "Speakers on"
unique_id: "speakers_on"
icon: 'mdi:speaker'
state: >
{{ states.media_player
| rejectattr('attributes.entity_id', 'defined')
**| selectattr('attributes.device_class', 'eq', 'speaker')**
| selectattr('state', 'search', '(playing|on)')
| list | count }}
How to reproduce the bug?
Feature request
What is expected behavior?
Current attributes set on 'AppleTV':
- source_list
- media_position
- media_position_updated_at
- media_title
- app_id
- app_name
- icon
- friendly_name
- supported_features
Current attributes set on 'Homepod':
- volume_level
- icon
- friendly_name
- supported_features
Device
AppleTV and HomePod