tobbeb
(Tobbe)
August 17, 2024, 6:01pm
1
Hi
I’m having some trouble setting up a button to change the volume on my Onkyo receiver.
In the Developer tools Actions I’m able to change the volume with this yaml:
action: media_player.volume_down
target:
entity_id:
- media_player.receiver
data: {}
But if I copy this into a button card, it no longer works.
type: custom:button-card
icon: mdi:volume-minus
tap_action: media_player.volume_down
target:
entity_id:
- media_player.receiver
data: {}
I change action to tap_action to make it clickable.
I run Home assistant on bare metal (Dell Optiplex)
Core2024.8.2
Supervisor2024.08.0
Operating System13.0
Frontend20240809.0
Has anyone run into similar problems?
Tobbe
It (mostly) doesn’t go that way in button card… In this case your indentation (and some other things) is wrong.
Here’s my example:
type: custom:button-card
name: Volume DOWN
icon: mdi:volume-minus
tap_action:
action: call-service
service: media_player.volume_down
target:
entity_id: media_player.onkyo_receiver
tobbeb
(Tobbe)
August 18, 2024, 1:58pm
3
Thank you, you solved it for me!
It works just like it is supposed to.
For anyone else looking for a solution that can repeatedly press the button while holding it down, this is my solution:
type: custom:button-card
icon: mdi:volume-minus
tap_action:
action: call-service
service: media_player.volume_down
target:
entity_id: media_player.receiver
hold_action:
action: call-service
service: media_player.volume_down
target:
entity_id: media_player.receiver
repeat: 200
Tobbe
Yeah, i tried repeat action, but it’s hard to use on tablet or phone, since if you move finger a bit “hold” is immediately stopped, so you must really hold finger very still or it stops working quite quickly…