Need some juju on dashboard controls for a Sleep Number bed

Greetings,

So I have a dashboard, which I patterned after this one for my Sleep Number bed.

It looks like this:

image

Everything works great, with one caveat. The bed takes some time in conducting changes, and if another button is pressed while a change is ongoing, the change immediately stops and then switches to the new command.

Is there a way to “disable” the other commands whilst the bed is doing it’s thing?

Here is the YAML:

views:
  - title: Sleep Number
    path: sleep-number
    icon: ''
    type: sections
    max_columns: 1
    sections:
      - type: grid
        cards:
          - type: tile
            grid_options:
              columns: 6
              rows: auto
            entity: >-
              number.sleepnumber_master_bedroom_sleep_number_bed_left_head_position
            name: Melanie Head
            icon: mdi:face-woman
            color: primary
            show_entity_picture: false
            hide_state: false
            vertical: false
            features:
              - style: slider
                type: numeric-input
            features_position: bottom
          - type: tile
            grid_options:
              columns: 6
              rows: auto
            entity: number.sleepnumber_right_head_position
            name: Chris Head
            icon: mdi:face-man
            color: primary
            hide_state: false
            vertical: false
            features:
              - style: slider
                type: numeric-input
            features_position: bottom
          - type: tile
            grid_options:
              columns: 6
              rows: 2
            entity: >-
              number.sleepnumber_master_bedroom_sleep_number_bed_left_foot_position
            name: Melanie Foot
            icon: mdi:face-woman
            color: purple
            hide_state: false
            vertical: false
            features:
              - style: slider
                type: numeric-input
            features_position: bottom
          - type: tile
            grid_options:
              columns: 6
              rows: 2
            entity: number.sleepnumber_right_foot_position
            name: Chris Foot
            icon: mdi:face-man
            color: purple
            hide_state: false
            vertical: false
            features:
              - style: slider
                type: numeric-input
            features_position: bottom
          - type: tile
            grid_options:
              columns: 6
              rows: 2
            entity: >-
              number.sleepnumber_master_bedroom_sleep_number_bed_melanie_firmness
            name: Melanie Bed Hardness
            icon: mdi:face-woman
            color: green
            hide_state: false
            vertical: false
            features:
              - style: slider
                type: numeric-input
            features_position: bottom
          - type: tile
            grid_options:
              columns: 6
              rows: 2
            entity: number.sleepnumber_master_bedroom_sleep_number_bed_chris_firmness
            name: Chris Bed Hardness
            icon: mdi:face-man
            color: green
            hide_state: false
            vertical: false
            features:
              - style: slider
                type: numeric-input
            features_position: bottom
          - type: custom:mushroom-select-card
            entity: >-
              select.sleepnumber_master_bedroom_sleep_number_bed_foundation_preset_left
            name: Melanie Bed Position
            icon_type: none
            fill_container: true
            secondary_info: none
            icon_color: light-blue
            icon: mdi:face-woman
            primary_info: name
            layout: vertical
            layout_options:
              grid_columns: 2
              grid_rows: 2
            card_mod:
              style:
                mushroom-shape-icon$: |
                  .shape {
                    box-shadow: 0px 0px 4px 3px rgba(39,148,212,.7) !important;
                  }
                .: |
                  ha-card {
                    border: solid 1px rgba(39,148,212,.3);
                    border-radius: 12px

                  } 
                  :host {
                    --mush-icon-symbol-size: 35px;
                    --mush-icon-size: 45px;
                  }
          - type: custom:mushroom-select-card
            entity: select.sleepnumber_foundation_preset_right
            name: Chris Bed Position
            icon_type: none
            fill_container: true
            secondary_info: none
            icon_color: light-blue
            icon: mdi:face-man
            primary_info: name
            layout: vertical
            layout_options:
              grid_columns: 2
              grid_rows: 2
            card_mod:
              style:
                mushroom-shape-icon$: |
                  .shape {
                    box-shadow: 0px 0px 4px 3px rgba(39,148,212,.7) !important;
                  }
                .: |
                  ha-card {
                    border: solid 1px rgba(39,148,212,.3);
                    border-radius: 12px

                  } 
                  :host {
                    --mush-icon-symbol-size: 35px;
                    --mush-icon-size: 45px;
                  }
        column_span: 1
    badges:
      - type: entity
        show_name: false
        show_state: true
        show_icon: true
        color: deep-purple
        entity: >-
          binary_sensor.sleepnumber_master_bedroom_sleep_number_bed_melanie_is_in_bed
        name: Melanie In Bed
        show_entity_picture: false
        state_content: name
        icon: mdi:face-woman-outline
      - type: entity
        show_name: false
        show_state: true
        show_icon: true
        color: blue
        entity: >-
          binary_sensor.sleepnumber_master_bedroom_sleep_number_bed_chris_is_in_bed
        name: Chris In Bed
        show_entity_picture: false
        state_content: name
        icon: mdi:face-man
    cards: []
    header:
      layout: center
      badges_position: bottom
  - subview: true
    path: Chris-head
    type: sections
    max_columns: 1
    icon: mdi:face-man
    sections:
      - type: grid
        cards:
          - type: custom:mushroom-number-card
            entity: >-
              number.sleepnumber_master_bedroom_sleep_number_bed_left_head_position
            layout: vertical
            name: Chris HEAD POSITION
            icon_color: light-blue
            icon: mdi:face-man-outline
            primary_info: name
            secondary_info: state
            layout_options:
              grid_columns: 4
              grid_rows: 3
            card_mod:
              style: |
                ha-card {
                background: transparent;
                border: transparent
                }
          - type: custom:mushroom-number-card
            entity: >-
              number.sleepnumber_master_bedroom_sleep_number_bed_left_head_position
            layout: vertical
            name: Chris HEAD POSITION
            icon_color: light-blue
            display_mode: buttons
            primary_info: none
            secondary_info: none
            icon_type: none
            layout_options:
              grid_columns: 4
              grid_rows: 1
            card_mod:
              style: |
                ha-card {
                background: transparent;
                border: transparent
                }
    cards: []
  - icon: mdi:face-woman
    path: Melanie-head
    title: Melanie Head
    subview: true
    type: sections
    max_columns: 1
    sections:
      - type: grid
        cards:
          - type: custom:mushroom-number-card
            entity: number.sleepnumber_right_head_position
            layout: vertical
            name: Melanie HEAD POSITION
            icon_color: deep-purple
            icon: mdi:face-man-outline
            primary_info: name
            secondary_info: state
            layout_options:
              grid_columns: 4
              grid_rows: 3
            card_mod:
              style: |
                ha-card {
                background: transparent;
                border: transparent
                }
          - type: custom:mushroom-number-card
            entity: number.sleepnumber_right_head_position
            layout: vertical
            name: Melanie HEAD POSITION
            icon_color: deep-purple
            display_mode: buttons
            primary_info: none
            secondary_info: none
            icon_type: none
            layout_options:
              grid_columns: 4
              grid_rows: 1
            card_mod:
              style: |
                ha-card {
                background: transparent;
                border: transparent
                }

Thank you

Instead of changing the entities directly you could have the button execute a script passing the entity, then set the script to queued mode. This would ensure the first operation completes before the second executes. If that doesn’t work natively, you could add a delay to the end of script to ensure there is a time delay between executions.

Ok.

This is definitely new territory for me. I’ll have to look into it.

A delay is not the ideal way of doing this, as some processes take an indeterminant amount of time.

Thanks