Hi Nerwyn! Thank you for your amazing work on this awesome card. It brings everything together in such a cool, usable way. I’m super happy with what I have put together (pic below).
There are a few things with the slider I am still working on, and I would appreciate some guidance (code below).
-
When volume is dragged down to 0, I lose the icon (just see black slider bar), and I would like to have this trigger a mute state w/ corresponding mute icon.
-
Is there a way to sneak an icon under the slider (for night mode), on the same row?
-
I’ve noticed the slider tends to get taller than the associated circlepad & left sided buttons, depending on device (i.e. totally fills the row). Is there simple CSS I am missing for this?
Thanks again for everything!
type: custom:universal-remote-card
media_player_id: media_player.sonos
rows:
- - - appletv
- - bluray
- - PS5
- - shield
- - power
- |
{% if is_state('input_boolean.ha_scene_bluray','on') %}
- - - menu
- null
- home
- null
- back
- circlepad
- slider
- - chapter_back
- rewind
- play_pause
- fast_forward
- chapter_forward
{% elif is_state('input_boolean.ha_scene_atv','on') %}
- - - menu_atv
- null
- home_atv
- null
- back_atv
- touchpad
- slider
- - rewind_atv
- play_pause_atv
- fast_forward_atv
{% elif is_state('input_boolean.universal_remote_helper','on') %}
- - null
- - slider_horizontal
- - null
{% elif is_state('input_boolean.ha_scene_theater_off','on') %}
- - null
{% endif %}
- - null
- fan_down
- fan_on
- fan_up
- null
custom_actions:
- type: slider
name: slider
icon: |
{% if is_state_attr('media_player.sonos','is_volume_muted',false) %}
mdi:volume-high
{% elif is_state_attr('media_player.sonos','is_volume_muted',true) %}
mdi:volume-mute
{% endif %}
range:
- 0
- 1
step: 0.01
value_attribute: volume_level
tap_action:
action: perform-action
perform_action: media_player.volume_set
data:
volume_level: "{{ value | float }}"
vertical: true
styles: |-
{% if is_state_attr('media_player.sonos','is_volume_muted',false) %}
:host {
--color: white;}
{% elif is_state_attr('media_player.sonos','is_volume_muted',true) %}
:host {
--color: gray;}
.icon {
color: white;}
{% endif %}