How to set tap action on picture elements card?

Hello good people!

I’m struggling with setting up a tap action on picture elements card. I have added an icon on the card and would like to call service input_select.select_option which would pick specific option from the list. Below you can see the code I’m using - it doesn’t work. Can anyone take a look and give me some hint?



- type: icon
    icon: mdi:information-variant
    tap_action:
      action: call-service
      service: input_select.select_option
      sevice_data:
        entity_id: input_select.kwiatki 
        option: Aloes drzewiasty

Did you verify this service call works in the Developer Tools >> Service in HA?

There you can fill in service call, test it, then cut/paste the yaml

Also, you selecting input but not specify device you selecting input on. I think this is what you missing. You can verify this in Service tab

The service which works in the Developer Tools is:

service: input_select.select_option
data:
  option: Grubosz owalny
target:
  entity_id: input_select.kwiatki

but it doesn’t work in my configuration of Picture Elements Card. What is working on Card is:

- type: icon
        icon: mdi:watering-can
        tap_action:
          action: call-service
          confirmation:
            text: Fikus podlany?
          service: counter.reset
          service_data:
            entity_id: counter.fikus_benjamin

but it doesn’t work for services that requires additional data to be provided. The above code works only if called service works like ‘on/off’ switch. That is how I see it. I need to call service by pressing an icon on Picture Elements Card and serice which I’m calling requires specific data to be provided. Is it a missing functionality of this card or there is a way to wright proper code which will make it possible?

Maybe submit issue to home assistant project in GitHub and ask about this.

EDIT

This should work. Maybe you need modify slightly


service: input_select.select_option
service_data:
  data:
    option: Grubosz owalny
  target:
  entity_id: input_select.kwiatki

Or other minor change