benct / lovelace-multiple-entity-row

Show multiple entity states and attributes on entity rows in Home Assistant's Lovelace UI
MIT License
807 stars 62 forks source link

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

Open larry-glz opened 1 year ago

larry-glz commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Replace the template by a value and see what happens.

it worked. thanks

ildar170975 commented 1 year ago

Close the issue then

larry-glz commented 1 year ago

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