AC fan speed control - up & down glance buttons

Hi, I would like to have up & down icons to put my AC fan speed up & down. Each as it’s own glance icon in the front end.

The speeds that the AC (Mitsubishi) are; minimum, low, medium-low, medium-high, high, auto. I am using @scotty’s Echonet component to integrate with climate; climate.mitsubishi_lounge

Originally I was thinking of having the up arrow have lots of conditional entries and pending what speed it is currently then it goes to the next speed. Likewise the down arrow to do the same but opposite. However, I am not sure if this is the best way and if I am complicating it too much?

@123 do you think it would be an idea to set each speed as per your example in this.

Ie. Minimum = 1, low = 2, medium-low = 3, medium-high = 4, high = 5

The linked post shows how to use a dictionary to simplify an existing template. I don’t know how you intend to apply that to your application. Post some code and we’ll see what can be done.

@123 This is what I have so far… It is currently all being controlled in lovelace

          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state_not: 'off'
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                state: 'Minimum'
            card:
              type: glance
              entities: 
              - entity: sensor.mitsubishi_lounge_ac
                name: Aircon
                tap_action:
                  action: call-service
                  service: browser_mod.more_info
                  service_data:
                    title: Mitsubishi Airconditioner
                    entity_id: climate.mitsubishi_lounge
                    deviceID: this
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Min to Low"
                show_name: false
                show_state: false
                icon: mdi:fan
                tap_action:
                  action: none
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Min to Low"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-up
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: low
          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state_not: 'off'
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                state: 'Low'
            card:
              type: glance
              entities: 
              - entity: sensor.mitsubishi_lounge_ac
                name: Aircon
                tap_action:
                  action: call-service
                  service: browser_mod.more_info
                  service_data:
                    title: Mitsubishi Airconditioner
                    entity_id: climate.mitsubishi_lounge
                    deviceID: this
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Low to Min"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-down
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: minimum
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Low to Med"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-up
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: medium-low
          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state_not: 'off'
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                state: 'Medium'
            card:
              type: glance
              entities: 
              - entity: sensor.mitsubishi_lounge_ac
                name: Aircon
                tap_action:
                  action: call-service
                  service: browser_mod.more_info
                  service_data:
                    title: Mitsubishi Airconditioner
                    entity_id: climate.mitsubishi_lounge
                    deviceID: this
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Med to Low"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-down
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: low
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Med to High"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-up
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: medium-high
          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state_not: 'off'
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                state: 'High'
            card:
              type: glance
              entities: 
              - entity: sensor.mitsubishi_lounge_ac
                name: Aircon
                tap_action:
                  action: call-service
                  service: browser_mod.more_info
                  service_data:
                    title: Mitsubishi Airconditioner
                    entity_id: climate.mitsubishi_lounge
                    deviceID: this
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "High to Medium"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-down
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: medium-low
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "High to Turbo"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-up
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: high
          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state_not: 'off'
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                state: 'Turbo'
            card:
              type: glance
              entities: 
              - entity: sensor.mitsubishi_lounge_ac
                name: Aircon
                tap_action:
                  action: call-service
                  service: browser_mod.more_info
                  service_data:
                    title: Mitsubishi Airconditioner
                    entity_id: climate.mitsubishi_lounge
                    deviceID: this
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Turbo to High"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-down
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: medium-high
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Turbo"
                show_name: false
                show_state: false
                icon: mdi:fan-plus
                tap_action:
                  action: none
          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state: 'off'
            card:
              type: glance
              entities: 
              - entity: sensor.mitsubishi_lounge_ac
                name: Aircon
                tap_action:
                  action: call-service
                  service: browser_mod.more_info
                  service_data:
                    title: Mitsubishi Airconditioner
                    entity_id: climate.mitsubishi_lounge
                    deviceID: this
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                title: "Off"
                show_name: false
                show_state: false
                name: " "
                icon: mdi:fan-off
                tap_action:
                  action: none
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Off to Min"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-up
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: minimum

It feels very convoluted though, I am sure there must be a better way

For those that may stumble upon this, I am trying to achieve an up & down glance style button to make my AC go lower/higher. My method was using conditional cards to do this and I couldn’t work out how to have glance buttons next to them without making the entire row for every circumstance. So, it has ended up being quite a lot of yaml code in lovelace. There is essentially two lots of conditional rows for every speed situation. Here is my current code so you can get an idea.

        - type: custom:stack-in-card
          cards:
          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state_not: 'off'
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                state: 'Minimum'
            card:
              type: glance
              entities: 
              - entity: switch.fanpower
                name: Dyson Fan
                tap_action:
                  action: call-service
                  service: browser_mod.popup
                  service_data:
                    title: Dyson Fan Controls
                    deviceID: this
                    card: 
                      type: glance
                      entities:
                      - entity: switch.fanpower
                        tap_action:
                          action: toggle
                      - entity: switch.fan_auto
                        tap_action:
                          action: toggle
                      - entity: switch.fan_night
                        tap_action:
                          action: toggle
                      - entity: switch.oscillation
                        tap_action:
                          action: toggle
              - entity: script.bed_time
                name: Bed Time
                show_state: false
                icon: mdi:bed
                tap_action:
                  action: toggle
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Min to Low"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-up
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: low
          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state_not: 'off'
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                state: 'Low'
            card:
              type: glance
              entities: 
              - entity: switch.fanpower
                name: Dyson Fan
                tap_action:
                  action: call-service
                  service: browser_mod.popup
                  service_data:
                    title: Dyson Fan Controls
                    deviceID: this
                    card: 
                      type: glance
                      entities:
                      - entity: switch.fanpower
                        tap_action:
                          action: toggle
                      - entity: switch.fan_auto
                        tap_action:
                          action: toggle
                      - entity: switch.fan_night
                        tap_action:
                          action: toggle
                      - entity: switch.oscillation
                        tap_action:
                          action: toggle
              - entity: script.bed_time
                name: Bed Time
                show_state: false
                icon: mdi:bed
                tap_action:
                  action: toggle
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Low to Med"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-up
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: medium-low
          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state_not: 'off'
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                state: 'Medium'
            card:
              type: glance
              entities: 
              - entity: switch.fanpower
                name: Dyson Fan
                tap_action:
                  action: call-service
                  service: browser_mod.popup
                  service_data:
                    title: Dyson Fan Controls
                    deviceID: this
                    card: 
                      type: glance
                      entities:
                      - entity: switch.fanpower
                        tap_action:
                          action: toggle
                      - entity: switch.fan_auto
                        tap_action:
                          action: toggle
                      - entity: switch.fan_night
                        tap_action:
                          action: toggle
                      - entity: switch.oscillation
                        tap_action:
                          action: toggle
              - entity: script.bed_time
                name: Bed Time
                show_state: false
                icon: mdi:bed
                tap_action:
                  action: toggle
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Med to High"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-up
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: medium-high
          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state_not: 'off'
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                state: 'High'
            card:
              type: glance
              entities: 
              - entity: switch.fanpower
                name: Dyson Fan
                tap_action:
                  action: call-service
                  service: browser_mod.popup
                  service_data:
                    title: Dyson Fan Controls
                    deviceID: this
                    card: 
                      type: glance
                      entities:
                      - entity: switch.fanpower
                        tap_action:
                          action: toggle
                      - entity: switch.fan_auto
                        tap_action:
                          action: toggle
                      - entity: switch.fan_night
                        tap_action:
                          action: toggle
                      - entity: switch.oscillation
                        tap_action:
                          action: toggle
              - entity: script.bed_time
                name: Bed Time
                show_state: false
                icon: mdi:bed
                tap_action:
                  action: toggle
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "High to Turbo"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-up
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: high
          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state_not: 'off'
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                state: 'Turbo'
            card:
              type: glance
              entities: 
              - entity: switch.fanpower
                name: Dyson Fan
                tap_action:
                  action: call-service
                  service: browser_mod.popup
                  service_data:
                    title: Dyson Fan Controls
                    deviceID: this
                    card: 
                      type: glance
                      entities:
                      - entity: switch.fanpower
                        tap_action:
                          action: toggle
                      - entity: switch.fan_auto
                        tap_action:
                          action: toggle
                      - entity: switch.fan_night
                        tap_action:
                          action: toggle
                      - entity: switch.oscillation
                        tap_action:
                          action: toggle
              - entity: script.bed_time
                name: Bed Time
                show_state: false
                icon: mdi:bed
                tap_action:
                  action: toggle
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Turbo"
                show_name: false
                show_state: false
                icon: mdi:fan-plus
                tap_action:
                  action: none
          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state: 'off'
            card:
              type: glance
              entities: 
              - entity: switch.fanpower
                name: Dyson Fan
                tap_action:
                  action: call-service
                  service: browser_mod.popup
                  service_data:
                    title: Dyson Fan Controls
                    deviceID: this
                    card: 
                      type: glance
                      entities:
                      - entity: switch.fanpower
                        tap_action:
                          action: toggle
                      - entity: switch.fan_auto
                        tap_action:
                          action: toggle
                      - entity: switch.fan_night
                        tap_action:
                          action: toggle
                      - entity: switch.oscillation
                        tap_action:
                          action: toggle
              - entity: script.bed_time
                name: Bed Time
                show_state: false
                icon: mdi:bed
                tap_action:
                  action: toggle
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Off to Min"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-up
                tap_action:
                  action: call-service
                  service: climate.set_hvac_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    hvac_mode: cool

          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state_not: 'off'
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                state: 'Minimum'
            card:
              type: glance
              entities: 
              - entity: sensor.mitsubishi_lounge_ac
                name: Aircon
                tap_action:
                  action: call-service
                  service: browser_mod.more_info
                  service_data:
                    title: Mitsubishi Airconditioner
                    entity_id: climate.mitsubishi_lounge
                    deviceID: this
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Min to Low"
                show_name: false
                show_state: false
                icon: mdi:fan
                tap_action:
                  action: call-service
                  service: climate.set_hvac_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    hvac_mode: off
          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state_not: 'off'
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                state: 'Low'
            card:
              type: glance
              entities: 
              - entity: sensor.mitsubishi_lounge_ac
                name: Aircon
                tap_action:
                  action: call-service
                  service: browser_mod.more_info
                  service_data:
                    title: Mitsubishi Airconditioner
                    entity_id: climate.mitsubishi_lounge
                    deviceID: this
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Low to Min"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-down
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: minimum
          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state_not: 'off'
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                state: 'Medium'
            card:
              type: glance
              entities: 
              - entity: sensor.mitsubishi_lounge_ac
                name: Aircon
                tap_action:
                  action: call-service
                  service: browser_mod.more_info
                  service_data:
                    title: Mitsubishi Airconditioner
                    entity_id: climate.mitsubishi_lounge
                    deviceID: this
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Med to Low"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-down
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: low
          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state_not: 'off'
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                state: 'High'
            card:
              type: glance
              entities: 
              - entity: sensor.mitsubishi_lounge_ac
                name: Aircon
                tap_action:
                  action: call-service
                  service: browser_mod.more_info
                  service_data:
                    title: Mitsubishi Airconditioner
                    entity_id: climate.mitsubishi_lounge
                    deviceID: this
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "High to Medium"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-down
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: medium-low

          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state_not: 'off'
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                state: 'Turbo'
            card:
              type: glance
              entities: 
              - entity: sensor.mitsubishi_lounge_ac
                name: Aircon
                tap_action:
                  action: call-service
                  service: browser_mod.more_info
                  service_data:
                    title: Mitsubishi Airconditioner
                    entity_id: climate.mitsubishi_lounge
                    deviceID: this
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                title: "Turbo to High"
                show_name: false
                show_state: false
                icon: mdi:fan-chevron-down
                tap_action:
                  action: call-service
                  service: climate.set_fan_mode
                  service_data:
                    entity_id: climate.mitsubishi_lounge
                    fan_mode: medium-high
          - type: conditional
            conditions:
              - entity: climate.mitsubishi_lounge
                state: 'off'
            card:
              type: glance
              entities: 
              - entity: sensor.mitsubishi_lounge_ac
                name: Aircon
                tap_action:
                  action: call-service
                  service: browser_mod.more_info
                  service_data:
                    title: Mitsubishi Airconditioner
                    entity_id: climate.mitsubishi_lounge
                    deviceID: this
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                name: " "
                show_state: false
                show_icon: false
              - entity: sensor.mitsubishi_lounge_ac_fan_speed
                title: "Off"
                show_name: false
                show_state: false
                name: " "
                icon: mdi:fan-off
                tap_action:
                  action: none

Below is shots of what it looks like in action:

Lowest
screenshot.2021-02-11
Low
screenshot.2021-02-11 (1)
Medium
screenshot.2021-02-11 (2)

Of course I am sure there must be an easier/cleaner way of doing this, but, this is what I have for the time being…