Automation for better air conditioning. Any hint?

Hey Claudio, Are you using appdaemon for anything? It would be pretty simple there.

Tried to install it a couple of times, lots of errors and no one willing to help constructively (I.e walk-through).
I abandoned it

what environment are you running under

hassbian as per home assistant instructions, with letencrypt

Soon to hass.io, though not yet

Yea, considering the number of problem reports I’ve been seeing on hass.io, I’m not sure I want to go there yet either. Still to much of a “.0” product for me. I’ll wait for .2 or .3 :slight_smile:

If you ever want to try appdaemon again, let me know and I’ll try to help. It’s very easy to get setup, the biggest problem is dependencies…

I posted how I do it (with a heat pump rather than a pure airconditioner), but my automation is built on the premise that you have full control of the IR commands. Anyway, it might help you out?

I have brodalink rmpro and mini, with these I can use IR commands from HASS

Cool, then you should be able to just replace all the MQTT commands with RM Pro commands, and the the sensor readings with wherever you get your temperatures from :slight_smile:

Although thinking about it, you may need to do some wizardry (another automation or script perhaps) that picks the right code for a given temperature.

mmhh how to change this?

I have 3 IR commands powerful/quite/auto (I use auto because strangely is always in the middle) and I can use the switch command_on (or off) to trigger

- service: mqtt.publish
      data:
        topic: "/espeasy01/cmd"
        payload_template: "heatpumpir,panasonic_dke,{% if states.input_boolean.varmepumpe_onoff.state == 'on' %}1{% elif states.input_boolean.varmepumpe_onoff.state == 'off' %}0{% endif %},{% if states.input_select.varmepumpe_mode.state == 'Auto' %}1{% elif states.input_select.varmepumpe_mode.state == 'Varme' %}2{% elif states.input_select.varmepumpe_mode.state == 'Kjøling' %}3{% elif states.input_select.varmepumpe_mode.state == 'Avfukting' %}4{% elif states.input_select.varmepumpe_mode.state == 'Vifte' %}5{% endif %},{{states.input_slider.varmepumpe_vifte.state|int}},{{states.input_slider.varmepumpe_temp.state|int}},{{states.input_slider.varmepumpe_retning.state|int}},0"

You’d probably be best off using something like this:

input_slider:
  desired_temperature:
    name: Desired temperature
    initial: 26
    min: 16
    max: 30
    step: 1
    icon: mdi:thermometer

automation old temperature_high:
  alias: Full cooling
  trigger:
    platform: time
    minutes: '/10'
    seconds: 00
  condition:
    condition: template
    value_template: '{{ states.sensor.YOUR_TEMPERATURE_SENSOR.state | float - states.input_slider.desired_temperature.state | float > 1 }}'
  action:
    - service: switch.turn_on
      entity_id: switch.YOUR_POWERFUL_MODE_SWITCH

automation old temperature_normal:
  alias: Gentle cooling
  trigger:
    platform: time
    minutes: '/10'
    seconds: 00
  condition:
    condition: template
    value_template: '{{ states.sensor.temperature.state | float - states.input_slider.desired_temperature.state | float < 1 }}'
  condition:
    condition: template
    value_template: '{{ states.sensor.YOUR_TEMPERATURE_SENSOR.state | float - states.input_slider.desired_temperature.state | float > -1 }}'
  action:
    - service: switch.turn_on
      entity_id: switch.YOUR_QUIET_MODE_SWITCH

automation old temperature_cold:
  alias: Stop the cooling
  trigger:
    platform: time
    minutes: '/10'
    seconds: 00
  condition:
    condition: template
    value_template: '{{ states.sensor.YOUR_TEMPERATURE_SENSOR.state | float - states.input_slider.stue_temperatur.state | float < -1 }}'
  action:
    - service: switch.turn_on
      entity_id: switch.YOUR_AC_OFF_SWITCH

This should get you an input slider where you can set the desired temperature, and then it’ll pretty much behave as you wanted it to in the first post.

You will need to replace the switch entity_id’s and the temperature sensor ID in the value templates.

One point to make though is that I’m presuming you’re using an IR command to turn the A/C unit off, rather than turning it off with a remote socket. If you are, in fact, cutting power to it, you will need to add switch.turn_on actions to the quiet and powerful mode automations.

Second point is that I haven’t actually tried this config, so there may be some fiddling involved… :wink:

1 Like

Hi I just wanted to make a simple automation for another room. Its an A/C which does have a IR remote with different On and OFF button codes. I put a Broadlink mini IR blaster.

The A/C is a cheap model (no inverter) and is never cutting the temperature right. I do have an external temperature sensor.

Basically what I would do is to turn OFF if temperature is below 23 degress. And tuern it on when temperature rises above (?) 25.

No need for input slider, just the automation

this is checking the temperature every 10 minutes??? You think this is a good time to avoid excessive on and off, or is better to put more minutes?

ALso the condition I would put for night use only

Is this ok?

  - alias: Air Gilma ON
    trigger:
      platform: time
      minutes: '/10'
      seconds: 00
    condition:
      condition: and
      conditions: 
        - condition: time
          after: '23:00:00'
          before: '07:00:00'
        - condition: template
          value_template: '{{ states.sensor.netatmo_gilma_bedroom_temperature.state > 26 }}'
    action:
      - service: switch.turn_on
        entity_id: switch.air_gilma
  - alias: Air Gilma OFF
    trigger:
      platform: time
      minutes: '/10'
      seconds: 00
    condition:
      condition: and
      conditions: 
        - condition: time
          after: '23:00:00'
          before: '07:00:00'
        - condition: template
          value_template: '{{ states.sensor.netatmo_gilma_bedroom_temperature.state < 24 }}'
    action:
      - service: switch.turn_off
        entity_id: switch.air_gilma

It looks good to me, although I can’t tell if all the indents and everything is OK, as long as it runs it should be. :slight_smile:

I would think 10 minutes would be OK, as you have a fairly large hysteresis between the on and off temperatures, depends on how quickly the AC unit cools down the room - you may have to experiment a bit to find the ideal temperature settings.

If it does turn out that it turns on and off every 10 minutes that might not be ideal as that will put extra strain on your compressor, in that case you should ideally set the A/C unit to a less powerful cooling mode so that it will run for a while before hitting < 24.

this condition I think is not corre3ct

I changed it slightly but is not working (not firing)

  - alias: Air Gilma ON
    trigger:
      platform: time
      minutes: '/10'
      seconds: 00
    condition:
      condition: and
      conditions: 
        - condition: state
          entity_id: sun.sun
          state: 'below_horizon'
        - condition: numeric_state
          entity_id: 'sensor.netatmo_gilma_bedroom_temperature'
          above: '25'
    action:
      - service: switch.turn_on
        entity_id: switch.air_gilma
      - service: mqtt.publish
        data:
          topic: air/gilma
          payload: "on"
          retain: "true"
  - alias: Air Gilma OFF
    trigger:
      platform: time
      minutes: '/10'
      seconds: 00
    condition:
      condition: and
      conditions: 
        - condition: state
          entity_id: sun.sun
          state: 'below_horizon'
        - condition: numeric_state
          entity_id: 'sensor.netatmo_gilma_bedroom_temperature'
          below: '24'
    action:
      - service: switch.turn_off
        entity_id: switch.air_gilma
      - service: mqtt.publish
        data:
          topic: air/gilma
          payload: "off"
          retain: "true"

Does it change your switch state, just not send?
Or does it not do either?

Do I need the quotes, or has to be without?

No quotes I believe, according to https://home-assistant.io/docs/automation/trigger/

Hmm, this might be what I’m looking for. I’ve got an A/C setup with a RM Mini 3, and so far i have it just turn on and off. All settings are sent via IR code, so it’s making it tricky to work with, but going over this solution has given me some ideas.

Then I have to try and get that to work with Siri and Homekit as a single device. Hmm…