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

Thank you , I’ll give it a try

hi i am running 0.90, and i have this errors:

2019-03-22 16:40:03 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.smartir.climate. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/loader.py", line 166, in _load_file
    module = importlib.import_module(path)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/config/custom_components/smartir/climate.py", line 21, in <module>
    from .controller import Controller
ModuleNotFoundError: No module named 'custom_components.smartir.controller'
2019-03-22 16:40:03 ERROR (MainThread) [homeassistant.loader] Unable to find platform smartir. Search path was limited to path of component: custom_components
2019-03-22 16:40:03 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.smartir.climate. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/loader.py", line 166, in _load_file
    module = importlib.import_module(path)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/config/custom_components/smartir/climate.py", line 21, in <module>
    from .controller import Controller
ModuleNotFoundError: No module named 'custom_components.smartir.controller'
2019-03-22 16:40:03 ERROR (MainThread) [homeassistant.loader] Unable to find platform smartir. Search path was limited to path of component: custom_components

My last version was 0.88.1 and it worked fine.

Please make sure you have all files in the config/custom_components/smartir folder.

I only use climate,.so i have inside /custom_components/smartir
these files:

climate.py and init.py

controller.py is also required.

1 Like

ups, yes now its working. thanks

I have climate.yaml and media.yaml for my media and AC.
Example of my climate.yaml

  • platform: smartir
    name: oGen SmartIR Ground
    unique_id: ogen_smartir_ground
    device_code: 1280
    controller_send_service: switch.broadlink_send_packet_Xx_xx_xx_xx
    Where should I write smartir to check for updates?
    Writing it in configuration.yaml gives me following error
    CHECK CONFIG

Invalid config for [smartir]: [platform] is an invalid option for [smartir]. Check: smartir->smartir->platform. (See /config/configuration.yaml, line 262). Please check the docs at https://home-assistant.io/components/smartir/

Is there a way to update climate state without actually calling the climate component?
i’m using Xiaomi door sensor, in order to determine if the AC is on.
but i’m basically turn the ac on / off.
i want to achieve the same thing without actually calling the climate component just change is state without send IR.

this is my automation :

  • id: ‘1551476100197’
    alias: Set AC State off
    trigger:
    • entity_id: binary_sensor.door_window_sensor_158d00025ead67
      for:
      seconds: 30
      from: ‘on’
      platform: state
      to: ‘off’
      condition:
    • condition: state
      entity_id: climate.mzgn_khdr_shynh
      state: heat
      action:
    • data:
      entity_id: climate.mzgn_khdr_shynh
      service: climate.turn_off
  • id: ‘1551476271352’
    alias: Set AC State on
    trigger:
    • entity_id: binary_sensor.door_window_sensor_158d00025ead67
      for: 0:00:1
      from: ‘off’
      platform: state
      to: ‘on’
      condition:
    • condition: state
      entity_id: climate.mzgn_khdr_shynh
      state: ‘off’
      action:
    • data:
      entity_id: climate.mzgn_khdr_shynh
      service: climate.turn_on

I installed smartir for controlling a Samsung TV, without hassle as long as I send the commands
listed in the 1060.json file (i.e. power on/off, channels 0-9, vol +/- etc. ).
I run into problems when trying to define “combined” commands, i.e. “channel 501” (chaining
the corresponding buttons). Often (not always) the individual button presses “get lost” like
if there is a sort of overrun (I get 50, 01, 51 etc.). I tried to define such commands in the json
file by chaining them, I also tried to send the commands one by one through Node Red, inserting a delay between them,
but without success. My goal is to end up having Alexa recognize a small set of commands for the preferred
channels, not having a complete remote implemented in HA. Any hint?

Thank you for the automation approach. But since I have a few units at home, all with the same annoying behavior, I decided to go for the coding approach. Here is my fork changes:

I Have a few INFO logs and am now testing the code in practice. I’ll most likely need a few improvements. Feedback are welcome.

The smartir works great thanks. But, when I use Homekit to start the fan, it defaults to 100%. When using HA, it uses the last speed value. Not sure if this is an issue with the smartir or with HA?

Quick question about the power sensor. I mounted Xiaomi door/window magnetic sensors on both of my units. I was wandering if they actually do something else except showing on/off status in the front end (thermostat card)?

I assumed these were in place for scenarios like: when someone uses remote to turn off, Hass updates the status correctly (sets climate to off)?

What exactly do you do differently in your fork? Readme seems copy/paste-ed from the original source :slight_smile:

Technically you can see the difference here:

I am still on testing phase so I did not document it. The main difference that you would have in the .yaml is having the parameters min_cycle_duration, hot_tolerance and cold_tolerance. you can see the detailed description here:

Pre-requisite is to have a sensor configured in the temperature_sensor

The behavior is the following, every min_cycle_duration it will check the target vs current temperature for hot_tolerance and cold_tolerance. I have added some features that I am testing, such as putting the device on idle and lowering the fan speed to maintain the target temperature. I’ll run some tests on this weekend and update you.

1 Like

Dear,
Can you please provide us swing mode too,

3 Likes

Hi, i’m getting mad on having this working…
Can’t see the entity at all, i have this on my configuration.yaml:

switch:

  • platform: broadlink
    host: 192.168.1.99
    mac: ‘c8:f7:42:17:1e:c8’
    smartir:

climate:

  • platform: smartir
    name: Daikin
    device_code: 1101
    controller_send_service: switch.broadlink_send_packet_192_168_1_99

RMMIni with static ip, switch.broadlink_send_packet_192_168_1_11 showing up in services “menu”.
What’s wrong ? It worked once and then entity disappeared and can’t get it up again…
thanks in advance :slight_smile:

P.S: no switch showing up also

Please send your config code formatted

Would someone be kind enough to convert my INI files? (Not a windows user.)

MHI 2.5
https://privatebin.net/?ca08b3b5a90e35a5#nwCiJiYbHEt1a4c5hBaFh9Pc2YwmyktCbvwvzh4CFYo=

MHI 7.1
https://privatebin.net/?3ef39fe7978daf77#PVdcd5jcrlCIn8t/8DOzB7yr7j9suQImve0Oy39ePsc=

I will do it. Who is the manufacturer of your unit?