[SOLVED]Help Request: button-card to control input_select

Hi,

first post, asking for help because i tried searching for several days now and I cannot make it work. Very well possible that it’s a trivial mistake because I’m still a noob at HA.

There are several examples on how you can simulate a tri-state switch with 3 button-cards and an input_select helper in the background.
Shoud be easy-peasy, but I cannot make it work.
This article is what I used as a base: https://homeassistant.jongriffith.com/2024/06/17/creating-toggle-buttons-in-the-home-assistant-ui/


I have the input_select season. If I use the 4 large buttons with icons, they work, they change the input_select.select_option.
But with the given example, with the button-card, the upper horizontal row with 4 smaller buttons, it doesn’t work. The state part works, they follow the select_option. But setting them, the tap_action isn’t working.
Tried with both data → option as service_data → option because I’ve found examples with both online.

type: horizontal-stack
cards:
  - type: custom:button-card
    entity: input_select.season
    name: Winter
    color_type: card
    tap_action:
      action: call—service
      service: input_select.select_option
      target:
        entity_id:
          - input_select.season
      data:
        option: Winter
    state:
      - value: Winter
        color: green
  - type: custom:button-card
    entity: input_select.season
    name: Spring
    color_type: card
    tap_action:
      action: call—service
      service: input_select.select_option
      target:
        entity_id:
          - input_select.season
      data:
        option: Spring
    state:
      - value: Spring
        color: green
  - type: custom:button-card
    entity: input_select.season
    name: Summer
    color_type: card
    tap_action:
      action: call—service
      service: input_select.select_option
      target:
        entity_id:
          - input_select.season
      data:
        option: Summer
    state:
      - value: Summer
        color: green
  - type: custom:button-card
    entity: input_select.season
    name: Fall
    color_type: card
    tap_action:
      action: call—service
      service: input_select.select_option
      target:
        entity_id:
          - input_select.season
      data:
        option: Fall
    state:
      - value: Fall
        color: green

Example of one of the working regular buttons:

show_name: true
show_icon: true
type: button
tap_action:
  action: call-service
  service: input_select.select_option
  target:
    entity_id:
      - input_select.season
  data:
    option: Winter
icon: mdi:snowflake
show_state: false

This is just an example. If I can get this to work, the intention is to make a tristate button for my pool-heater: Off-Clock-Boost, using rest-switches, but that part is working already …

Those examples require custom button card, do you have that installed?

You’re using a fancy dash, not a standard dash in all the action: call—service lines… they should be:

action: call-service

Notice that in the working example you have used a standard dash.

1 Like

yes, otherwise they wouldn’t be showing up on my dash i guess :grimacing:

sounds like @Didgeridrew has the right idea, I’d try what he’s suggesting.

THIS !!!
How did you see that ? How did they get there in the first place? First time in my 47-year old life that i heard of them. Didn 't even know there existed something like a ‘fancy dash’.
Didn’t get any complaint either. Changed those 4 :japanese_ogre: fancy dashes to regular ones and this thing works.
They cost me several hours of my life, but I am SO glad it works …
Thanks again :clap:

It’s almost always from a copy-paste action. That’s one of the reasons we are so insistent on people using the “Preformatted text” tool for code on these forums, if you copy something unformatted it always contains some “fancy” punctuation or quote marks that foul up your YAML or Jinja.

I too have had hours of my life wasted by “fancy” things, so it’s on the mental list of things I look for when people ask for help :smile:

1 Like

Great, sent you a coffee for your help.