I have some buttons that invoke a script:
type: button
tap_action:
action: toggle
entity: script.accendi_plasmatv
icon: mdi:remote-tv
script:
accendi_plasmatv:
alias: 'accendi plasma'
sequence:
- service: mqtt.publish
data:
topic: 'plasmatv/IrTX/IRSEND'
payload: 'plasmatv'
I can do this from the button itself
tap_action:
action: call-service
service: mqtt.publish
service_data:
topic: plasmatv/IrTX/IRSEND
payload: AumentaVol
But I really need a script Because it could be called eg. by alexa
my goal is pass a payload in text format from button to a script, each button has a different payload.
I suppose the script have something like:
payload: {{ button.value }}
{“value”:"{{payload}}"}