The docs make it look like I can have multiple buttons per card, but when I try and add them I get the following error:
YAML Error: YAMLException: duplicated mapping key at line 4, column 1: type: entity-button ^
Am I doing something wrong with my code?
type: entity-button
entity: script.teac_vol_up
icon: 'mdi:volume-plus'
type: entity-button
entity: script.teac_vol_down
icon: 'mdi:volume-plus'
VDRainer
(🍻)
2
Needs to be a list, i think.
- type: entity-button
entity: script.teac_vol_up
icon: 'mdi:volume-plus'
- type: entity-button
entity: script.teac_vol_down
icon: 'mdi:volume-plus'
Thanks for your reply. Unfortunately with that, I get the following error:
YAML Error: TypeError: type is undefined
VDRainer
(🍻)
4
Works for me, showing the buttons.
- title: Test
cards:
- type: entity-button
entity: script.cover_test1_open
icon: 'mdi:volume-plus'
- type: entity-button
entity: script.cover_test1_close
icon: 'mdi:volume-plus'
But you have to do more to call a script.
BTW: You’re using LL?
Sorry, I’m not entirely sure what that means. I’ve since modified the code to actually call the script with hold_action and touch_action.
Here is a screenshot of what I’m seeing:
![image](//community-assets.home-assistant.io/original/3X/9/1/9140c332e060e87bb598823513c3826b44bd05ff.png)
VDRainer
(🍻)
6
LL means Lovelace, and your screenshot shows me that you’re using it.
BUT, i’m not using this clicky… clicky… mode, i’m using my good old editor and edit the ui-lovelace.yaml.
Sorry, maybe someone can help?
Ah I see! My bad.
I’ll try adding it to the config file directly. Thanks again for your help.
Ok, so I’ve been into the config file, this is how it looks:
- type: entity-button
name: TV Volume Up
entity: script.teac_vol_up_5
icon: 'mdi:volume-plus'
tap_action:
action: call-service
service: script.teac_vol_up
hold_action:
action: call-service
service: script.teac_vol_up_5
- type: entity-button
name: TV Volume Down
entity: script.teac_vol_down_5
icon: 'mdi:volume-minus'
tap_action:
action: call-service
service: script.teac_vol_down
hold_action:
action: call-service
service: script.teac_vol_down_5
So it is a list… however they still show as two, huge volume buttons, instead of being on the same card:
![image](//community-assets.home-assistant.io/original/3X/f/a/faf2ef316cee371b0daf270241ab8cdd33c76484.png)
VDRainer
(🍻)
9
3 Likes
Solved - exactly what I was after. Thank you for your help!
![image](//community-assets.home-assistant.io/original/3X/6/c/6c6a16e9f40cedea9f1ab21c4eccb146f5060d94.png)