Fonio
December 30, 2019, 11:48pm
1
Hi Guys
I’m New in HA, so please forgive me for my stupidity.
I try to made a Horizontal Stack with many Entity Buttons, so i have created first scripts for every Button and if i add the Entity Button on the Dashboard it works with action: toggle.
If i create the Horizontal Stack and add the Buttons i can change anything but it remains on the default action : info.
So here is my config on the Horizontal Stack
type: horizontal-stack
title: Media Control
cards:
- type: entity-button
icon: 'mdi:television'
entity: script.1577740137742
action: toggle
- type: entity-button
icon: 'mdi:apple'
entity: script.1577745278123
tap_action: null
action: toggle
- type: entity-button
tap_action: null
action: toggle
entity: script.1577745397782
icon: 'mdi:power'
I have made the changes on the Editor of Lovelance UI and if i save and edit again it writes me on tap_action: null ( but i have write before tap_action: )(only, without none)
If i set tape_action: toggle, it works the toggle but the script was not executed.
Hope you can help me to understand what i made wrong:
i’m on the last release : 0.103.5
Thanks Fonio
Harry13
(George Georgas)
December 31, 2019, 12:12am
2
Hi Fonio
you can’t toggle a script
if you look at the doc’s
you will see you need to use the call-service to run the script
example: in doc’s
type: entity-button
name: Turn Off Lights
tap_action:
action: call-service
service: script.turn_on
service_data:
entity_id: script.turn_off_lights
entity: script.turn_off_lights
tom_l
December 31, 2019, 12:37am
3
As scripts are services you can simplify this to:
type: entity-button
name: Turn Off Lights
tap_action:
action: call-service
service: script.turn_off_lights
Harry13
(George Georgas)
December 31, 2019, 12:43am
4
you still need the entity for that entity button
type: entity-button
name: Turn Off Lights
tap_action:
action: call-service
service: script.turn_on
entity: script.turn_off_lights
1 Like
Fonio
December 31, 2019, 8:58am
6
Oh my godness…thanks a lot a try it today later.
Thank you very much for your quick responses and
i wish you all a happy new year!
Fonio
December 31, 2019, 9:44am
7
I have changed to call-service but same thing i receive the information window before i can execute the command, my code looks now:
type: horizontal-stack
title: Media Control
cards:
- type: entity-button
icon: 'mdi:television'
tap_action: null
action: call-service
service: script.turn_on
service_data: null
entity_id: remote.harmonyhub
entity: script.1577740137742
- type: entity-button
icon: 'mdi:apple'
tap_action: null
action: call-service
service: script.turn_on
service_data: null
entity_id: remote.harmonyhub
entity: script.1577745278123
- type: entity-button
tap_action: null
action: call-service
service: script.turn_on
service_data: null
entity_id: remote.harmonyhub
entity: script.1577745397782
icon: 'mdi:power'
tom_l
December 31, 2019, 11:37am
8
Your indentation is not correct. Look at all the examples we gave you.
type: horizontal-stack
title: Media Control
cards:
- type: entity-button
icon: 'mdi:television'
entity: script.1577740137742
tap_action:
action: call-service
service: script.1577740137742
- type: entity-button
icon: 'mdi:apple'
entity: script.1577745278123
tap_action:
action: call-service
service: script.1577745278123
- type: entity-button
icon: 'mdi:power'
entity: script.1577745397782
tap_action:
action: call-service
service: script.1577745397782
Fonio
December 31, 2019, 2:06pm
9
Thank You! tom_I now it works