Control the air conditioner

The only thing I can suggest is that the IR codes don’t match, i.e. that your aircon is a slighly different model.

When you move the slider to a new temperature, your aircon will only get one code when you stop moving it, that code comprises the temperature, fan speed and mode. The air con should normally acknoweledge receipt of a valid sequence, mine beeps.

If you don’t have a card defined I am not sure how you are controlling the component? Through service calls?

Yes, through service calls

I suggest you create a suitable thermostat card, turn on the a/c using one of the mode buttons below the temperature display and then see if you can set the temperature using the circular slider.

If that doesn’t work then it’s probably time to ask some questions on the other thread.

Hi there, my AC model is not on the supported list is there an easier way to add support, or I have to manually learn all the codes?

Hi Tom

Are you able to share the automation configuration you are using?

Thanks

There’s nearly 400 lines of code to my lounge heating and cooling automations so I pastebinned it: https://paste.ubuntu.com/p/WH7wGB7ppN/

These take care of:

  • manually selecting a heating or cooling mode
  • scheduled heating and cooling on/off
  • switching off the heating/cooling if an external door or window is opened
  • manual temperature set point adjustment
  • automatically boosting/retarding the heat or cooling power as required to quickly get to the set point
  • automatic temperature set point adjustment based on season and morning weather forecast

There are also a bunch of binary sensors associated with these automations: https://paste.ubuntu.com/p/BxWXpSw3Vj/

1 Like

Thanks Tom… need to block out some ‘thinking’ time :slight_smile:

Hi, team. I was starting from this topic, so sharing my end configuration with you.
Thanks all for the ideas and inspiration.
Please take a look if it will help someone

hi everyone… I’m using SmartIR at its mention on monitoring the AC whether the status is ON/OFF. Anyone have idea how to do that?

Hello there. Can I view the shell_command codes? I am trying to study how you are controlling the aircon.

- id: lounge_aircon_manual
  alias: 'Lounge Room Aircon'
  initial_state: true
  trigger:
    platform: state
    entity_id: input_select.lounge_ac_mode
  action:
  - service_template: >
      {% if is_state('input_select.lounge_ac_mode', 'Powerful Heat') %} shell_command.lounge_ac_powerful_heat
      {% elif is_state('input_select.lounge_ac_mode', 'Normal Heat') %} shell_command.lounge_ac_normal_heat
      {% elif is_state('input_select.lounge_ac_mode', 'Silent Heat') %} shell_command.lounge_ac_silent_heat
      {% elif is_state('input_select.lounge_ac_mode', 'Powerful Cool') %} shell_command.lounge_ac_powerful_cool
      {% elif is_state('input_select.lounge_ac_mode', 'Normal Cool') %} shell_command.lounge_ac_normal_cool
      {% elif is_state('input_select.lounge_ac_mode', 'Silent Cool') %} shell_command.lounge_ac_silent_cool
      {% elif is_state('input_select.lounge_ac_mode', 'Dry') %} shell_command.lounge_ac_dry
      {% elif is_state('input_select.lounge_ac_mode', 'Off') %} shell_command.lounge_ac_off
      {% endif %}
  - service_template: >
      {% if is_state('input_select.lounge_ac_mode', 'Silent Heat') %} script.fireplace_25
      {% elif is_state('input_select.lounge_ac_mode', 'Normal Heat') %} script.fireplace_75
      {% elif is_state('input_select.lounge_ac_mode', 'Powerful Heat') %} script.fireplace_100
      {% else %} script.fireplace_0
      {% endif %}
lounge_ac_dry: 'curl -k "http://10.1.1.9/r?d=2&t={{states.input_number.lounge_ac_temp_set_cool.state | int}}&f=176&a=16&s=1"'
lounge_ac_off: 'curl -k "http://10.1.1.9/r?d=4&t={{states.input_number.lounge_ac_temp_set_heat.state | int}}&f=160&a=0&s=0"'
lounge_ac_normal_cool: 'curl -k "http://10.1.1.9/r?d=3&t={{states.input_number.lounge_ac_temp_set_cool.state | int}}&f=160&a=0&s=1"'
lounge_ac_normal_heat: 'curl -k "http://10.1.1.9/r?d=4&t={{states.input_number.lounge_ac_temp_set_heat.state | int}}&f=160&a=0&s=1"'
lounge_ac_powerful_cool: 'curl -k "http://10.1.1.9/r?d=3&t={{states.input_number.lounge_ac_temp_set_cool.state | int}}&f=160&a=1&s=1"'
lounge_ac_powerful_heat: 'curl -k "http://10.1.1.9/r?d=4&t={{states.input_number.lounge_ac_temp_set_heat.state | int}}&f=160&a=1&s=1"'
lounge_ac_silent_cool: 'curl -k "http://10.1.1.9/r?d=3&t={{states.input_number.lounge_ac_temp_set_cool.state | int}}&f=176&a=16&s=1"'
lounge_ac_silent_heat: 'curl -k "http://10.1.1.9/r?d=4&t={{states.input_number.lounge_ac_temp_set_heat.state | int}}&f=176&a=16&s=1"'

@tom_l
Thank you. also, how did you create the binary_sensor.lounge_room_dht_status. This is a good check. I notice one of my dht22 sensors at times, lose connections after restarting HA.

Thank you! One last question. I have added the automation to HA. The am/pm automation triggers when it falls below the target temperature. Does the automation stops the Aircon if temperature goes above the target temperature? I think not due to this line.

  condition:
  - condition: state # Only if AC is off (prevents oscillation between heat and cool mode if temperature over/undershoots set point)
    entity_id: input_select.lounge_ac_mode
    state: 'Off'

No the AC only turns off at the time in the off input datetime. The thermostat in the AC puts itself in a low power mode once the target temp is met.

Hello Tom,
I have implemented your codes to my aircon and got it working. Is it safe to delete all the entity_id in the sensors templates to keep inline with the updates?

Yes except for the templates that use now() you should add this line to those templates:

        {% set update = states('sensor.time') %}

After you update to v0.117 you can delete these added lines. See Heads up! Upcoming breaking change in the Template integration

1 Like

@tom_l
Hello
I was looking at the am/pm turn off automations and I notice it is trigger ever day when it is not suppose to. The aircon isn’t on at the set am/pm times.

This line is what triggering it. With the aircon in the off state, it should say false, but it is true.
automation:

  - condition: template # And only if AC is on
    value_template: "{{ not is_state('input_select.lr_ac_mode.state', 'Off') }}"

This is what I have in the input select. I double check the O in Off. It is capital ‘O’
input select:

  lr_ac_mode:
    name: LR AC Mode
    icon: mdi:air-conditioner
    options:
      - 'Off'
      - Fan
      - Ai Auto
      - Powerful Cool
      - Normal Cool
      - Silent Cool
      - Powerful Heat
      - Normal Heat
      - Silent Heat
      - Normal Humidifier

What does this return in the developer tools template editor:

{{ states('input_select.lr_ac_mode.state') }}
{{ is_state('input_select.lr_ac_mode.state', 'Off') }}
{{ not is_state('input_select.lr_ac_mode.state', 'Off') }}

Also:

:one::six: Should I tag people?

Generally, no.

It comes across as bad manners, you’re demanding somebody answers you. It’s different if you’re thanking somebody, obviously.
How to help us help you - or How to ask a good question

{{ states('input_select.lr_ac_mode.state') }} <- unknown
{{ is_state('input_select.lr_ac_mode.state', 'Off') }} <-- False
{{ not is_state('input_select.lr_ac_mode.state', 'Off') }} <-- True