Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Add ability to send variables when calling scripts thru tap-action #300

Open
larry-glz opened this issue May 23, 2023 · 4 comments
Open

Comments

@larry-glz
Copy link

I'm trying to run a script via a button on the entity row. However, it seems variables (fields) are not passed to script via "service-data". See below:

entity: switch.schedule_well_watering_corral
type: custom:multiple-entity-row
name: Corral
secondary_info:
  attribute: weekdays
toggle: true
state_color: true
entities:
  - entity: script.well_watering_program_test
    name: ' '
    icon: mdi:play
    state_color: true
    tap_action:
      action: call-service
      service: script.turn_on
      service_data:
        entity_id: script.well_watering_program_test
        variables:
          watering_runtime: '{{ states(''input_number.well_watering_runtime_corral'') }}'

thanks

@ildar170975
Copy link

ildar170975 commented Jul 11, 2023

However, it seems variables (fields) are not passed to script via "service-data"

Probably because m-e-r card does not support templates.
Replace the template by a value and see what happens.

@larry-glz
Copy link
Author

Replace the template by a value and see what happens.

it worked. thanks

@ildar170975
Copy link

Close the issue then

@larry-glz
Copy link
Author

"Add" in the title implied a feature request. I'll add FR and keep open

@larry-glz larry-glz changed the title Add ability to send variables when calling scripts thru tap-action [FR] Add ability to send variables when calling scripts thru tap-action Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants