Custom:button-card to control blinds as toggle switch

I have two cards currently, one opens, the other closes my blinds. Makes sense to save on screen space and combine them into a toggle? But can this be done using the custom button card? Not sure where to even start…

type: custom:button-card
name: Open Blinds
icon: mdi:blinds-open
entity: scene.living_door_open
tap_action:
  action: call-service
  service: scene.turn_on
  service_data:
    entity_id: scene.living_door_open




type: custom:button-card
name: Close Blinds
icon: mdi:blinds-open
entity: scene.living_door_closed
tap_action:
  action: call-service
  service: scene.turn_on
  service_data:
    entity_id: scene.living_door_closed

Why are you using a scene? It’s probably easier to access the cover entity directly - then you can call toggle as the tap_action.

This is a bank of six blinds inn my dining room - they’re all a member of this cover group

show_name: true
show_icon: true
type: button
tap_action:
  action: toggle
entity: cover.dining_room_shades
1 Like

Thanks, I guess it was because what I’m trying to control is one window that is rather large and there are 3 individual blinds. So I was using a scene to control all 3. But I guess with HA now having groups I should use this? Or I some how write all 3 entity’s into the code? (Not sure how to list 3)

I use a cover group for this.

type: custom:button-card
color_type: card
entity: cover.blinds_curtain
show_icon: true
name: '[[[ return entity.state  ]]]'
tap_action:
  action: toggle
state:
  - value: open
    color: red
    icon: mdi:blinds-open
  - value: close
    color: black
    icon: mdi:blinds-horizontal
  - value: open
    icon: mdi:blinds-open
  - operator: default
    icon: mdi:blinds-horizontal

ScreenShot_20230212092605

ScreenShot_20230212092620

This is awesome, thanks. I tried under each value putting … name: Open or name: Closed so that they are capitalized like everything else but didn’t seem to take. do you know if that’s possible to put under the state values?

The UI often abstracts and/or translates this into your native language as set by the system.

The values you would use will be listed bay the entity under ‘state’ in developer tools. (theyre case sensitive as well. So capitalization matters) in this case it’s likely open/closed/unknown or on/off/unknown