i am using a shown script in lovelace and the issue with it is that there is no indication that it was really pressed - i wonder what are the options to show some indication that the script’s “execute” button was actually pressed - is it possible to show some dialog for 2 seconds or something similar?
I also have this question, is there any way to indicate that the script button was pressed?
I have a simple script with a delay:
radio:
sequence:
- service: media_player.media_pause
data:
entity_id: media_player.hifiberry
- delay:
seconds: 1
- service: shell_command.hifiberry_mpd
since there’s a delay in the script, if type: entities
is used in lovelace, it displays as a switch.
when pressed, switch indicates on state for 1 second and then goes back off.
type: entities
entities:
- script.radio
I have however a problem on IOS platform - there is no indication of press when type: button
is used in lovelace. when the button is clicked, the script is triggered but there is no visual feedback (no icon change, nothing).
type: button
entity: script.radio
tap_action:
action: toggle
hold_action:
action: more-info
show_icon: true
show_name: true
is there any solution to this?
if you switch to the custom button card you can get haptic feedback if you have a newer IOS. Otherwise you can make animations occur if you have an old iphone.
for now, I sorted it out using “automation helper”. that makes the icon change the color for 50 milliseconds indicating it was pressed.
configuration.yaml
input_boolean:
radio:
initial: off
automations.yaml
- alias: "AUT: radio toggle helper"
initial_state: 'on'
trigger:
- platform: state
entity_id: input_boolean.radio
to: 'on'
action:
- service: script.turn_on
entity_id: script.radio
- delay:
milliseconds: 50
- service: homeassistant.turn_off
entity_id: input_boolean.radio
How do you use this in some context?