JeffSteinbok / hass-dreo

Dreo Smart Device Integration for Home Assistant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fan speed in numerical

drashish87 opened this issue · comments

Hi Jeff.
Thanks for setting up Dreo Fans with HA.

I was wondering would it possible to speed in numbers rather than a slider of 0 to 100% as these fans have speed in numbers
Something like this, if possible.
Saw this on minimalist UI

button_card_templates:
  card_line_4_actions:
    variables:
      item1_icon: mdi:numeric-1-circle
      item2_icon: mdi:numeric-2-circle
      item3_icon: mdi:numeric-3-circle
      item4_icon: mdi:numeric-4-circle
      name: Default name
    styles:
      card:
        - border-radius: 20px
        - box-shadow: none
        - padding: 12px
        - background: transparent
      grid:
        - grid-template-areas: '"item2"'
        - grid-template-columns: 1fr
        - grid-template-rows: min-content  min-content
        - row-gap: 12px
    custom_fields:
      item2:
        card:
          template: list_items_line_4_actions
          type: custom:button-card
          custom_fields:
            item1:
              card:
                icon: '[[[ return variables.item1_icon ]]]'
                styles:
                  card:
                    - background-color: |
                        [[[
                          //Remplacer_ici l'entité à observer pour l'affichage de l'item mis en avant
                          if (states["sensor.aspiro_fan"].state.toUpperCase() == "GENTLE"){
                              return 'white';
                          }else{
                              return 'transparent';
                          }
                        ]]]
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    entity_id: input_select.vacuum_aspiro_speed_set
                    option: Gentle
                type: custom:button-card
                template:
                  - widget_icon_line_4_actions
            item2:
              card:
                icon: '[[[ return variables.item2_icon ]]]'
                styles:
                  card:
                    - background-color: |
                        [[[
                          //Remplacer_ici l'entité à observer pour l'affichage de l'item mis en avant
                          if (states["sensor.aspiro_fan"].state.toUpperCase() == "SILENT"){
                              return 'white';
                          }else{
                              return 'transparent';
                          }
                        ]]]
                  icon:
                    - transform: scale(0.75)
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    entity_id: input_select.vacuum_aspiro_speed_set
                    option: Silent
                type: custom:button-card
                template:
                  - widget_icon_line_4_actions
            item3:
              card:
                icon: '[[[ return variables.item3_icon ]]]'
                styles:
                  card:
                    - background-color: |
                        [[[
                          //Remplacer_ici l'entité à observer pour l'affichage de l'item mis en avant
                          if (states["sensor.aspiro_fan"].state.toUpperCase() == "STANDARD"){
                              return 'white';
                          }else{
                              return 'transparent';
                          }
                        ]]]
                  icon:
                    - transform: scale(1)
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    entity_id: input_select.vacuum_aspiro_speed_set
                    option: Standard
                type: custom:button-card
                template:
                  - widget_icon_line_4_actions
            item4:
              card:
                icon: '[[[ return variables.item4_icon ]]]'
                styles:
                  card:
                    - background-color: |
                        [[[
                          //Remplacer_ici l'entité à observer pour l'affichage de l'item mis en avant
                          if (states["sensor.aspiro_fan"].state.toUpperCase() == "TURBO"){
                              return 'white';
                          }else{
                              return 'transparent';
                          }
                        ]]]
                  icon:
                    - transform: scale(1.4)
                tap_action:
                  action: call-service
                  service: input_select.select_option
                  service_data:
                    entity_id: input_select.vacuum_aspiro_speed_set
                    option: Turbo
                type: custom:button-card
                template:
                  - widget_icon_line_4_actions
  list_items_line_4_actions:
    styles:
      card:
        - box-shadow: none
        - padding: 0px
        - border-radius: 21px
        - pointer-events: none
        - background-color: rgba(var(--couleur-gris),0.2
        - justify-items: center
      grid:
        - grid-template-areas: '"item1 item2 item3 item4"'
        - grid-template-columns: 1fr 1fr 1fr 1fr
        - grid-template-rows: min-content
        - column-gap: 7px
        - justify-items: center
      img_cell:
        - justify-items: center
  widget_icon_line_4_actions:
    show_icon: true
    show_name: false
    size: 20px
    styles:
      card:
        - box-shadow: none
        - padding: 0px
        - border-radius: 50%
        - place-self: center
        - height: 42px
        - width: 42px
        - pointer-events: auto
      grid:
        - grid-template-areas: '"i"'
      icon:
        - color: rgba(var(--couleur-theme),0.9)

I'm not going to do this. The fan works the way that HomeAssistant's Fan Entity works. If you want to write custom UX to do numbers, you can do so as you have. You could also publish a custom LoveLace card to share your work.