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 …