Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Passing variable from entity-button > script > shell_command

$
0
0

@boppen wrote:

Hi,

I’m trying to clean up my config and would like to be able to pass arguments from an entity-button to a shell command. Is that even possible?

This is my current config

ui-lovelace.yaml

          - type: entity-button
            icon: mdi:numeric-4-circle-outline
            tap_action:
              action: call-service
              service: script.music_inp
              service_data:
                entity_id: script.music_inp
                zone: "02"
            entity: script.music_inp

scripts.yaml

  music_inp:
    sequence:
    - service: shell_command.music_on
      data_template:
#        zon: "02" <- this works with the shell command
        zon: "{{ zone }}"

configuration.yaml:

shell_command:
  music_on: /srv/breathe/breathe_on.php {{ zon }}

And it don’t work, I’ve tried other configs from other threads - but none of them I regarding exactly this issue.
The problem seems to be to pick up the variable from the entity-button and pass it on to the shell-command.

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>