Control the air conditioner

I use something similiar as @zoogara - Instead of purchasing a Broadlink I’m using a Nodemcu to send the IR codes. I’ve also attached a temperature/humidity sensor which sends data back to my HA. The Nodemcu is communicating via MQTT. Works great and the whole set up is no more that $4 per AC.
( I cannot figure out how to change the temperature to F, i have my units set to metric as i need it in celsius for my 3d printer cards.)

2 Likes

Nice. I use the Daikin component. In Lovelace, the card defaults to the standard thermostat card. Unfortunately, I can’t set things like fan speed via these. May need to come up with a custom card for it…

Hi, Can you show me how to put it to work ? Mine only turns off the AC. All the other buttons won’t work.
thanks a lot.

For starters, does your air conditioner appear in this list? https://github.com/smartHomeHub/SmartIR/blob/9691aaaf622de33eaaeab7b02c452ce054d8e395/docs/CLIMATE.md#available-codes-for-climate-devices

If it doesn’t then you have a long and arduous process ahead capturing codes, but no different than most other climate control solutions in HA.

Hello, thx for your reply,
And yes, my ac appears in this list, I have a gree ac.

I am also able to learn the remote codes.
What I can’t figure out os how to create the entities/service/devices ao I can create the ac card amd add the controls to it.

Ok - I am assuming you have installed the SmartIR custom component.

First thing is to enable SmartIR and define your Broadlink IR bridge, substituting your IP, MAC and type:

smartir:

switch:
  - platform: broadlink
    host: 192.168.0.136
    mac: '34:ea:34:e3:ad:52'
    type: rm_mini
    friendly_name: "Kitchen IR"

Then add SmartIR as a climate integration:

climate:
  - platform: smartir
    name: Kitchen AC
    device_code: 1282
    controller_data: 192.168.0.136
    temperature_sensor: sensor.kitchen_temperature
    humidity_sensor: sensor.kitchen_humidity

Your device code should match the one for your A/C, and ensure it exists in /config/custom_components/smartir/codes/climate. Choose a suitable sensor for temp and humidity, if you don’t have these I believe you can leave them out.

Lastly add a suitable card to Lovelace:

  - cards:
      - type: thermostat
        entity: climate.kitchen_ac
        name: Kitchen Air Conditioner
    icon: 'mdi:air-conditioner'
    state_color: true
    title: ac_view

The instructions for the SmartIR are actually on GitHub: https://github.com/smartHomeHub/SmartIR/blob/9691aaaf622de33eaaeab7b02c452ce054d8e395/docs/CLIMATE.md

Otherwise feel free to ask questions in the SmartIR thread: SmartIR - Control your Climate, TV and Fan devices via IR/RF controllers

And don’t forget to post your config if you have an issue.

If it still doesn’t work after this then maybe your a/c is a newer model and you will have to capture your own codes.

1 Like

I got all the, just the card I don’t have.
Still it doesn’t work like it should.

  • platform: broadlink
    host: 172.16.0.56
    mac: ‘24:df:a7:42:c6:8b’
    type: “rm_mini”
    friendly_name: “Mainroom IR”

climate:

  • platform: smartir
    name: Main AC
    unique_id: main_ac
    device_code: 1180
    controller_data: 172.16.0.56
    temperature_sensor: sensor.temperature
    humidity_sensor: sensor.humidity

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.