lovelace-multiple-entity-row icon indicating copy to clipboard operation
lovelace-multiple-entity-row copied to clipboard

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

Open larry-glz opened this issue 2 years ago • 4 comments

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

larry-glz avatar May 23 '23 13:05 larry-glz

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.

ildar170975 avatar Jul 11 '23 02:07 ildar170975

Replace the template by a value and see what happens.

it worked. thanks

larry-glz avatar Jul 19 '23 18:07 larry-glz

Close the issue then

ildar170975 avatar Jul 19 '23 18:07 ildar170975

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

larry-glz avatar Jul 19 '23 22:07 larry-glz