SmartIR - Control your Climate, TV and Fan devices via IR/RF controllers

Hi everyone.
I have a little problem setting up smartir with ESPHome.I followed the example and I’m only able to switch my ac off.Im sure the problem lies in the ESPHome.yaml file.Can anyone share a more detailed example.
Thank you

Hi, I try to install via Hacs but i don’t find it i only can install in manual mode

Hello, How can I add the oscillation function of the air conditioning?

I have hass.io on a synology nas via docker.

Trying to get smart IR working and i think i have followed everything correctly.
In my config i can add in smartir: no error, add in “switch:broadlink …” no error, but when i go to add in the “climate: …” i get the following error.

Platform error climate.smartir - cannot import name ‘ClimateEntity’ from ‘homeassistant.components.climate’ (/usr/src/homeassistant/homeassistant/components/climate/ init .py)

My Smart IR files are in a directory as follows.
SYNOLOGYNAS\hassio[hass.io](http://hass.io/)\config\custom_components\smartir

What am i doing wrong?

HA version?

Hey Vassilis,

Home Assistant 0.109.6

Path to configuration.yaml: /config

Wow, that was legit staring me in the face, i had installed HA ages ago but left it as i was working mainly with the vera … thanks very much.

For anyone playing at home the answer was my home assistant was out of date so i had to update.

Still finding solution to make Home Assistant work with Xiaomi IR, chuangmi.remote.h102c01 and Mitshubishi Electric Model No MSXYFN10VER2

Hey Guys, using my phone’s built in IR remote app, i could “learn” the codes of my Mitsubishi Electric Aircon Model : MSXYFN10VER2, remote model KH18A. From the app it works flawlessly, but when i point it to my Xiaomi IR chuangmi.remote.h102c01 and learn it from HA and send it again from HA it doesn’t work.

I have no idea where the app I used stores the “learned” IR codes… App name is Smart Remote

I have a ceiling fan that is controlled via IR through my broadlink devices. Any idea how to create a power sensor for this ceiling fan? Could a motion sensor work?

@dominicknoetze I have SmartIR working with ESPHome, and I finally have a solution that works with Ethernet rather than Wifi.

In case it’s of any help, below is my HA config:

climate:
  - platform: smartir
    name: Salon Air Conditioner
    unique_id: salon_air_conditioner
    device_code: 7777
    controller_data: esp32_poe_1_send_raw_command
    temperature_sensor: sensor.salon_temperature
    humidity_sensor: sensor.salon_humidity
    power_sensor: binary_sensor.salon_air_conditioner

And the YAML file in ESPHome:

esphome:
  name: esp32_poe_1
  platform: ESP32
  board: esp32-poe

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0
  power_pin: GPIO12

logger:

api:
  services:
    - service: send_raw_command
      variables:
        command: int[]
      then:
        - remote_transmitter.transmit_raw:
            carrier_frequency: 38kHz
            code: !lambda 'return command;'
            repeat:
              times: 2
              wait_time: 0ms

ota:

remote_transmitter:
  pin: 
    number: GPIO14
  carrier_duty_percent: 50%

Below is a snippet of the SmartIR codes file (7777.json, which is a file I created for the Toshiba split system). As you can see, it contains raw codes.

{
    "manufacturer": "Toshiba",
    "supportedModels": [
      "RAS-13NKV-E / RAS-13NAV-E",
      "RAS-13NKV-A / RAS-13NAV-A",
      "RAS-16NKV-E / RAS-16NAV-E",
      "RAS-16NKV-A / RAS-16NAV-A"
    ],
    "supportedController": "ESPHome",
    "commandsEncoding": "Raw",
    "minTemperature": 17,
    "maxTemperature": 30,
    "precision": 1,
    "operationModes": [
      "heat_cool",
      "cool",
      "dry",
      "heat",
      "fan_only"
    ],
    "fanModes": [
      "auto",
      "silent",
      "low",
      "mid",
      "high"
    ],
    "commands": {
      "off": "[4320, -4320, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -540, 540, -540, 540, -1620, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -1620, 540, -1620, 540, -540, 540, -1620, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -1620, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -1620, 540, -1620, 540, -1620, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -1620, 540, -1620, 540, -540, 540, -7020]",
      "heat_cool": {
        "auto": {
          "17": "[4320, -4320, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -540, 540, -540, 540, -1620, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -1620, 540, -1620, 540, -540, 540, -1620, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -1620, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -1620, 540, -7020]",
          "18": "[4320, -4320, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -540, 540, -540, 540, -1620, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -1620, 540, -1620, 540, -540, 540, -1620, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -1620, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -1620, 540, -540, 540, -540, 540, -540, 540, -1620, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -540, 540, -1620, 540, -540, 540, -540, 540, -540, 540, -1620, 540, -7020]",

I’m using a Broadlink RM Mini 3, which I modified in order to make it work with the ESP32-POE (over Ethernet). More details here:

3 Likes

Hi pkozul
Thank you for your response,i appreciate that you took the time to help me.A couple days later it just started working without making any changes.I don’t know what the problem was,I’m just glad it’s working as intended.

Hi! Amazing work. Is there a way to add more options? Example, my ac have modes (cool and humidity), fan speed(auto, 1, 2 and 3) and vane control (auto, swing, 1, 2, 3, 4, 5). This is a lot of codes to learn, but could be interesting to have my ac fully running!

Hi,
very nice project, can you tell me if and where are instructions to capture and add new IR codes ? Does exist an utility?
Thank you
Michele

Go to developer tools > services> broadlink.learn (if using a broadlink IR device). Enter the IP address of the device and run the service. From there you just press the required button on your remote control while aiming it at the IR transceiver. HA will give you a Persistent Notification with the IR code in it.

Hello,

i use this sensor for the power_sensor: config,

sensor:
  - platform: template
    sensors:
        lracstate:
            friendly_name: "Living Room AC State"
            icon_template: mdi:air-conditioner
            value_template: "{% if states('sensor.switch_livingroom_ac_energy_power') | float > 1 %}{{ state_attr('climate.living_room_ac', 'last_on_operation') }}{%- else -%}off{% endif %}"

unfortunately its not work correct.

the state of sensor look ok when the AC on i see its state right ( cold , heat )

when i turn off the AC with the physical remote control, the state of the climate go from cold to off,
when i turn on the AC with the physical remote control, the state of the climate stay off.

i also try use a binary sensor with states ON and OFF.
when i turn on the AC with the physical remote control, the state of the climate change to ON, ( not cold or heat )


Edit:
i fix it by use binary sensor, and changing the state definition on climate.py file.

binary_sensor:
  - platform: template
    sensors:
        lracstate:
            friendly_name: "Living Room AC State"
            icon_template: mdi:air-conditioner
            value_template: "{{ states('sensor.switch_livingroom_ac_energy_power') | float > 1 }}"

climate.py:

    @property
    def state(self):
        """Return the current state."""
        if self._on_by_remote:
#            return STATE_ON  - remove this line and add the "return self._last_on_operation" instead
            return self._last_on_operation
        if self.hvac_mode != HVAC_MODE_OFF:
            return self.hvac_mode
        return HVAC_MODE_OFF
2 Likes

Hi
I got an Inventor Chilly CLC0290-09BS AC, but haven’t been able to find a suitable set of controls
I have a broadlink mini 4 and managed to learn a number of the codes, but unfortunately , its behavior is very odd: for example, I cannot turn on the AC with the “on/off” code, I can however with the “mode” or “fan” codes, and I CAN turn off with the “on/off” code
I wouldn’t mind trying another manufacturer codes and adapt it, but so far is proving very difficult, I think is because not every code can be send in the right sequence
Any help will be appreciated

Damm it turns out almost all the codes are for broadlink, I guess I didn’t do enough research before buying the Xiaomi IR :confused:

I can see the controller I need YAN1F1 for the broadlink, I guess not but… by any chance…is there any way to convert it to Xiaomi??

Thanks!

Hi all, I wonder if it would be possible to add an option where you can update the ‘Operation’ without turning the device on?
Maybe a ‘Desired Operation’?

My old setup auto toggled a boolean to determine if the device would Heat or Cool.
Upon the device turning on via any means, it would then heat or cool respectively.

I notice currently using this project if I were to Heat a room in the morning when its cold and then ask Google to turn on the heatpump later in the day when its hot, the device would remember the last setting and continue in Heat mode.

Hope this makes sense.
The only way I could think of doing it right now, is I could still have that boolean, but whenever I get the climate device turned on to have another automation turn it on again but running through conditions to if it should be heating or not.