Two actions for button

Hi friends.

This code turns on the air conditioner.

cards:
  - entity: switch.aire
    icon: 'mdi:air-conditioner'
    name: Aire
    show_icon: true
    show_name: true
    tap_action:
      action: toggle
    theme: default
    type: entity-button

But I also need to change the mode of the climate card.
My problem is that the climate card turns on the air at 27 degrees and turns it off at 26 (temperature of an aquarium).
The problem is that if someone in the house turns on the air with the button of another card, when the aquarium reaches 26 the air is turned off.
For this reason, I need that when I press the button on the card to turn on the air manually, the climate card will turn off and when I turn off the button the climate card will turn on.
Thank you very much

You’ll need several automations to control it this way.

I’d make an input_boolean called “Aquarium Manual”. Then write an automation that turns off the climate entity and turns ON the switch when this is “on”. And then another automation that puts the climate entity in “cool” mode when the input boolean is “off”. Then, expose the input_boolean in the interface instead of the switch directly.

- alias: input_aire_off
  trigger:
    platform: state
    entity_id: input_boolean.clima_manual
    to: 'off'
  action:
    - service: climate.set_hvac_mode
      data:
        entity_id: climate.aire_acondicionado
        hvac_mode: 'off'
- alias: input_aire_on
  trigger:
    platform: state
    entity_id: input_boolean.clima_manual
    to: 'on'
  action:
    - service: climate.set_hvac_mode
      data:
        entity_id: climate.aire_acondicionado
        hvac_mode: 'cool'

This is the second automation. It’s okay?
The bool variable changes the state of the climate.

The first one because I don’t understand English, I don’t quite understand what you are saying.

Thanks for help me

Now it works. But on the lovelace card I put the input_boolean as a button but it doesn’t change the visual state. It does not change the color when it is on or off.

- alias: input_aire_off
  trigger:
    platform: state
    entity_id: input_boolean.clima_manual
    to: 'on'
  action:
    - service: climate.set_hvac_mode
      data:
        entity_id: climate.aire_acondicionado
        hvac_mode: 'off'
    - service: switch.turn_on
      entity_id: 
       - switch.aire
- alias: input_aire_on
  trigger:
    platform: state
    entity_id: input_boolean.clima_manual
    to: 'off'
  action:
    - service: climate.set_hvac_mode
      data:
        entity_id: climate.aire_acondicionado
        hvac_mode: 'cool'
    - service: switch.turn_off
      entity_id: 
       - switch.aire

Integrate a button-card that allows you to change the color and it looks great. Thank you very much for the help

Hi. How are you? I need you to help me.
Some time ago I had achieved it with your help but I lost all the automation that I had programmed.
What I need is to turn on the air when sensor.temperature exceeds 27 degrees and turn off the air when it is below 26. But you helped me that if someone turned on the air with a button when it reaches 26 it should not turn off. I don’t remember how to do this last automation. If you or someone else can help me, I would really appreciate it.