How to change the state of a button based on another

I have 3 buttons that control my roller blackouts in the office room.

Button ‘Big’: control the big blackout
Button ‘Small’: control the small blackout
Button ‘All’: control both blackouts

I want the state of the buttons ‘big’ and ‘small’ to change accordingly when I change the state of the button ‘all’
E.g. if I close all blackouts, other two buttons status should change to close

If I close both small and big blackouts, status of the all button should change.

Any idea how to do this?

type: horizontal-stack
title: Office Room
cards:
  - type: custom:button-card
    color_type: card
    icon: mdi:roller-shade
    entity: input_boolean.office_all_blackouts
    name: All
    tap_action:
      action: toggle
    state:
      - icon: mdi:roller-shade-closed
        value: 'on'
        color: grey
      - icon: mdi:roller-shade
        value: 'off'
        color: yellow
  - type: custom:button-card
    color_type: card
    icon: mdi:roller-shade
    entity: input_boolean.office_big_blackout
    name: Big
    tap_action:
      action: toggle
    state:
      - icon: mdi:roller-shade-closed
        value: 'on'
        color: grey
      - icon: mdi:roller-shade
        value: 'off'
        color: yellow
  - type: custom:button-card
    color_type: card
    icon: mdi:roller-shade
    entity: input_boolean.office_small_blackout
    name: Small
    tap_action:
      action: toggle
    state:
      - icon: mdi:roller-shade-closed
        value: 'on'
        color: grey
      - icon: mdi:roller-shade
        value: 'off'
        color: yellow

Have another go at posting that code please — lose all the HTML escapes. %20 is a space, for example.

Looks like these are three input_boolean Helpers. The easiest way would be to create three (or perhaps six) automations via the UI that trigger on the state change of each of these, and adjusts the others in line.

Could be condensed to one automation with some clever coding, but I’m on a phone and not going to try to write that now.

As a related example, here my automation that maintains a set of three input booleans for my climate modes: only one should be on at any time:

  trigger:
    - platform: state
      entity_id: climate.central_heating
      attribute: preset_mode
      to:
        - 'away'
        - 'comfort'
        - 'sleep'

    - platform: template
      value_template: >-
        {{ (bool(states('input_boolean.ch_away')) or
            bool(states('input_boolean.ch_comfort')) or
            bool(states('input_boolean.ch_sleep'))) == false }}
      for:
        seconds: 5

  action:
    - service: input_boolean.turn_{{ 'on' if state_attr('climate.central_heating','preset_mode') == 'away' else 'off' }}
      target:
        entity_id: input_boolean.ch_away

    - service: input_boolean.turn_{{ 'on' if state_attr('climate.central_heating','preset_mode') == 'comfort' else 'off' }}
      target:
        entity_id: input_boolean.ch_comfort

    - service: input_boolean.turn_{{ 'on' if state_attr('climate.central_heating','preset_mode') == 'sleep' else 'off' }}
      target:
        entity_id: input_boolean.ch_sleep

That’s used to allow me to read and set climate mode via the Android Auto interface.