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

Hi, I have an IR ceiling fan wired to a tasmota switch.
How do I change it binary sensor so I can use it as power sensor? Is there an example for this

Sharing this tool I built to help make the process of learning codes for NEW devices that are not part of the existing SmartIR library.

Hopefully this can help others out too!

1 Like

Hello everyone! Since the fork of LocalTuya by xZetsubou now integrates Tuya IR remotes with send/receive features very similar to Broadlink, I was wondering if it is possible to integrate with your wonderful tool. Any idea how to go about it? I have (or can build/extract) full codes for a few devices (Midea-like Climate, Samsung Q600 soundbar, Lights, Video Projectorā€¦) that are currently supported or not, and would love to help bridging the gap with Tuya for so many people, and make my dumb AC fully smart, locally with your tool!

Hereā€™s a few example of codes (havenā€™t integrated the AC yet):

{
  "version": 1,
  "minor_version": 1,
  "key": "localtuya_remotes_codes",
  "data": {
    "ebe62b4475ca2ba259qmcz": {
      "Projector": {
        "power": "KiOPETQCmAY0ApgGNAI0AjQCmAY0ApgGNAKYBjQCNAI0AjQCNAI0AjQCNAI0ApgGNAI0AjQCNAI0AjQCNAKYBjQCmAY0AjQCNAI0AjQCNAI0AjQCNAI0AjQCNAI0AjQCNAI0AjQCmAY0ApgGNAKYBjQCmAY0ApgGNAKYBjQCmAY0ApgGNAJtnCoj6Qg0AjB1",
        "left": "4CKxEfQB0Ab0AdAG9AFzAvQB0Ab0AdAG9AHQBvQBcwL0AXMC9AFzAvQBcwL0AdAG9AFzAvQBcwL0AXMC9AHQBvQB0Ab0AXMC9AFzAvQBcwL0AXMC9AHQBvQBcwL0AXMC9AFzAvQB0Ab0AdAG9AHQBvQB0Ab0AXMC9AHQBvQB0AZzAtAG9AHnnOAiBwn0Aej94CIHCfQBMHU=",
        "right": "yyKxEf4BzAb+AcwG/gFrAv4BzAb+AcwG/gHMBmsC/gH+AWsC/gFrAv4BawL+AcwG/gFrAv4BawL+AWsC/gHMBv4BzAb+AWsC/gHMBv4BawJrAv4B/gHMBv4BawL+AWsC/gFrAv4BzAb+AWsC/gHMBv4BzAb+AWsC/gH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rwEnBq8BJwavAScGrwEnBq8BQQKvAUECrwFBAq8BQQKvAacRrwFBAq8BQQKvAUECrwFBAq8BQQKvAUECrwFBAq8BJwavAScGrwEnBq8BJwavAUECrwEnBq8BJwavAScGrwFBAq8BQQKvAUECrwFBAq8BJwavAU3ZpxGnEa8BQQKvAUECrwFBAq8BQQKvAScGrwEnBq8BQQKvAUECrwEnBq8BJwavAScGrwEnBq8BQQKvAUECrwFBAq8BQQKvAacRrwFBAq8BQQKvAUECrwFBAq8BQQKvAUECrwFBAq8BJwavAScGrwEnBq8BJwavAUECrwEnBq8BJwavAScGrwFBAq8BQQKvAUECrwFBAq8BJwavATB1",
        "Mute": "mRGZEbIBPAKyATwCsgE8ArIBPAKyASUGsgElBrIBPAKyATwCsgElBrIBJQayASUGsgElBrIBPAKyATwCsgE8ArIBPAKyAZkRsgE8ArIBPAKyATwCsgE8ArIBJQayATwCsgE8ArIBPAKyASUGsgElBrIBJQayATwCsgE8ArIBJQayASUGsgElBrIBPAKyATwCsgE8ArIBJQayATB1",
        "Play": "nBGcEawBPgLeAd4BrAE+At4BPgLeASQG3gEkBqwBPgKsAT4CrAEkBqwBJAasASQGrAEkBqwBPgKsAT4CrAHeAawBPgKsAZwRrAE+At4BPgKsAT4CrAE+AqwBPgKsASQGrAE+AqwBJAasAT4CrAE+AqwBPgKsASQG3gEkBqwBPgKsASQGrAE+AqwBJAasASQG3gEkBqwBPgKsAU/ZnBGcEd4BPgKsAT4CrAE+AqwBPgKsASQGrAEkBqwBPgKsAT4C3gEkBqwBJAasASQG3gEkBqwBPgKsAT4CrAE+AqwB3gHeAZwR3gE+AqwBPgKsAT4C3gE+AqwBPgLeASQGrAE+AqwBJAasAT4CrAE+At4BPgKsASQGrAEkBqwBPgLeASQGrAE+AqwBJAasASQGrAEkBqwBPgKsATB1",
        "Pause": "qxGrEa0BPgKtAT4CrQE+Aq0BPgKtASsGrQErBq0BPgKtAT4CrQErBq0BKwatASsGrQErBq0BPgKtAT4CrQE+Aq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GDnUYjJwn7AVp7RiMnCfsBWntGIycJ+wHo/UYjJwn7AVp7RiMnCfsBWntGIycJ+wFaew==",
        "color_temp+": "FwWbAA8dXBDlAaUC5QGlAuUBpQLlAaUCmQEQB+UBpQLlARAH5QEQB5kBEAflARAH5QEQB5kBXBDlARAH5QGlAuUBpQKZARAH5QGlApkBpQKZAaUCmQGlAuUBpQKZAaUCOAEQB+UBpQLlARAH5QEQB+UBEAflARAH5QEQB5kBqKZcEJkBZgmbAKUCmwA4AZsALQNmCeUBMHU=",
        "color_temp-": "GyGbAEsBThLHAZkCBwKZAscBmQJLAUsDxwGZAscBmQLHAZkCBwIVB8cBFQcHAhUHxwEVB8cBFQfHARUHxwEVB8cBFQcHApkCBwIVB8cBFQdLAZkCBwKZAscBmQIHAgcCBwKZAscBmQLHAZkCBwIHAscBFQdLARUHSwEVBwcCFQcHAhUHxwEVB8cB451TDJsASgqbAEoKSgrHATB1",
        "set_cold": "PSMuEvABTQLwAZAC8AGQAvABTQJNAk0CTQKQAvABkALwAd4G8AHeBvAB3gbwAd4G8AHeBvAB3gbwAd4G8AHeBvABkALwAU0C8AHeBvAB3gZNAk0CTQJNAvABTQLwAZAC8AFNAvAB3gbwAU0CTQJNAvAB3gbwAd4G8AHeBvAB3gbwAd4G8AF9nT0jKAnwATB1",
        "set_colder": "PSMuEvABTQLwAZAC8AGQAvABTQJNAk0CTQKQAvABkALwAd4G8AHeBvAB3gbwAd4G8AHeBvAB3gbwAd4G8AHeBvABkALwAU0C8AHeBvAB3gZNAk0CTQJNAvABTQLwAZAC8AFNAvAB3gbwAU0CTQJNAvAB3gbwAd4G8AHeBvAB3gbwAd4G8AF9nT0jKAnwATB1",
        "set_warm": "GyMuEv4BdQL+AXUC/gF1Av4BdQL+AXUC/gF1Av4BdQL+AdgG/gHYBv4B2Ab+AdgG/gHYBv4B2Ab+AdgG/gHYBv4BdQL+AXUC/gHYBv4B2Ab+AXUC/gF1Av4BdQL+AXUC/gF1Av4B2Ab+AXUC/gF1Av4B2Ab+AdgG/gHYBv4B2Ab+AdgG/gFdnRsjKAn+ATB1"
      }
    }
  }
}

Has anyone ever thought of allowing IR Receiver mode while not transmitting a code in order to ā€œlistenā€ to the original physical remotes and update the status at HA?

My wife prefers to use the AC control at our bedroom, but this means the status of the AC is always out of sync. Hiding the controller is not an option :slight_smile:

This could be a huge improvment for SmartIR, not sure how complex it would be.

Apparently the Aqara M3 hub has this functionality and works with HA. Thats without SmartIR, so it would come down to the SmartIR devs implementing a link / functionality I guessā€¦ if they wanted to work on it.

Yeah, I saw that, but is totally overkill if someone already has a Zigbee2Mqtt hub at HA and wants just the IR functionality.

I was thinking the devs could replicate this idea by having the IR blaster at receive mode while not triggering any commands at SmartIR.

Looking at the code, they would need to see if Broadlink, Xiomi, Mqtt, lookin and EspHome integrations actually would allow for that. I know ESPHome already has support for smth similar.

I have a feeling this is a hardware limitation of the Broadlink (and many others) which is why itā€™s so ā€˜groundbreakingā€™ that the Aqara hub can do it, including sending the data to HA. I could be wrong but I seem to remember this conversation years ago.

1 Like

Hello there.

I have managed to install SmartIR though I havenā€™t configured anything yet. I have a RM4 Pro that is set up in Home Assistant and using the Broadlink App, I have gotten it to learn an RF remote that controls my gate.

I would love to know how I can control the gate in Home Assistant so what would be the process of getting this into HA first and then once that is done, Iā€™d like to be able to tell Alexa to open the gate and also open the gate automatically when I arrive home (by detecting my phone?)

How have you set this up in HA? If you want to use SmartIR then you donā€™t need it setup in HA any other way, SmartIR does it for you.

Once the Broadlink is setup with your wifi details you no longer need this at all.

This is all possible once you finish setting up SmartIR.

You need to create the device in SmartIR and get the JSON file(s) created for your remote(s).

How have you set this up in HA? If you want to use SmartIR then you donā€™t need it setup in HA any other way, SmartIR does it for you.

I used the Broadlink App to connect RM4 to my Network and setup. Once that was done, HA automatically picked up the RM4 and created the Broadlink Integration with 1 device.

yeah ok, but you can either use that core Integration OR SmartIR.

Ahh- so itā€™s one or the other?

I managed to follow a YT video (https://www.youtube.com/watch?v=lWCHZm9xWno) to learn the RF remote and create a script to execute it using the core integration. So step 1 is complete!

Now, if I want to add a second AC remote to the same RM4 device, Iā€™m guessing smartIR might not work with this? SmartIR makes it easy with the codes to program an entire remote but with native integration, Iā€™ll have to learn it one by one.

Sorry, I made a mistake earlier. You still integrate the Broadlinks via the core Integration, but thatā€™s just to create the ā€˜remoteā€™ entities.

Then you create media_player, fan and/or climate entities in SmartIR

Actually SmartIR will let you control lots of devices from the same Broadlink. You just create a separate SmartIR device for each physical device you want to control.

(the needs attention one is simply unplugged at the moment)

eg:

media_player:
  - platform: smartir
    name: Onkyo Amp
    unique_id: onkyo_amp
    device_code: 7010
    controller_data: remote.lounge_ir_remote # 192.168.0.71 
    power_sensor: binary_sensor.onyko_amp_power
media_player:
  - platform: smartir
    name: Alfresco Sony
    unique_id: alfresco_sony
    device_code: 7020
    controller_data: remote.alfresco_ir_remote #192.168.0.73
    power_sensor: binary_sensor.alfresco_sony_power
climate:
  - platform: smartir
    name: Lounge Gas Heater
    unique_id: lounge_gas
    device_code: 99999
    controller_data: remote.lounge_ir_remote   #192.168.0.71
    temperature_sensor: sensor.lounge_multisensor_temperature
    humidity_sensor: sensor.lounge_multisensor_relative_humidity
    power_sensor: binary_sensor.lounge_gas_heater_power
1 Like

Really appreciate you taking the time to help me learn Dave. Iā€™ll try this out.

No problem at all. Sorry about the incorrect info earlier, I set all this up years ago so it was a of guess work remembering the full procedure.

The device codes (in my example) are simply the names of the JSON files that contain your IR / RF codes.

Hi!
My portable AC has a preset called ā€œSleepā€, Iā€™ve read that home assistant supports presets, but how would I go about adding that to my .json file?
Iā€™ve created a fully functional .json tonight, but I would love to add the ā€œsleepā€ preset!
It also has a ā€œtimerā€ function, where it turns off after a set amount of time or turns on after a set amount of time, but that can be handled by automations so Iā€™m not to worried about that.
But I use the ā€œSleepā€ preset alot, it changes the profile of how the ac behaves, doesnā€™t just go to the set temp and then turn off the compressor, it tries to maximize the ā€œoffā€ time as much as possible, as well as when the compressor is running, it tries to maximize that as well.
Iā€™m rambling at this point, anyway. Home assistant supports ā€œSLEEPā€ as a preset, how would i go about adding this to my custom .json file?

Hi, as original SmartIR repo maintainer is not merging my PR, I decided to not continue such futile work. Instead I am focusing on active maintenance my fork. I did already included several PR from other authors which were also not merged into original SmartIR repo.

So anyone interested in manitained version of SmartIR, you can start using it via HACS: GitHub - litinoveweedle/SmartIR: Integration for Home Assistant to control climate, TV and fan devices via IR/RF controllers (Broadlink, Xiaomi, MQTT, LOOKin, ESPHome)

Note: Please backup you custom code files and place them into custom_codes directory after installation.

5 Likes

I have a TCL TV Iā€™m trying to control via broadlink with a ping binary sensor setup.

I canā€™t turn on the TV yet, but with the old version it showed the TV did not actually turn on because of ping sensor disconnected. Now with you version it show the TV like it came on even though ping still says disconnected.

Any Ideas what to try other than the two code 1180 and 1181?

I assume, that that ā€˜pingā€™ you reffer to, is used as a feedback i.e. ā€˜power swtichā€™ to report back what is the state of your device?

Yes it is.