Xiaomi Chuangmi_ir (Universal IR Remote Controller)


#61

@thundergreen I’m not stuck anywhere, but someone on that thread is :slight_smile:


#62

Hi is it possible that this component will make it into one of the future official releses of hass?


#63

The license of the original code is unknown and the code base isn’t really clean. It will need some time to get rid of the dust. :wink:


#64

Anyone else having trouble in 0.57? Ideas?

2017-11-04 13:33:50 ERROR (SyncWorker_6) [homeassistant.util.package] Unable to install package python-mirobo: Command “/usr/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-build-0js5vpqq/cryptography/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-x3ph26i2-record/install-record.txt --single-version-externally-managed --prefix --compile --user --prefix=” failed with error code 1 in /tmp/pip-build-0js5vpqq/cryptography/
2017-11-04 13:33:50 ERROR (MainThread) [homeassistant.setup] Not initializing switch.chuangmi_ir because could not install dependency python-mirobo
2017-11-04 13:33:50 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform switch.chuangmi_ir: Could not install all requirements.

Update: so I fixed the problem.
Updated plugin to version in post 54. But had to change from chuangmi.send_package to chuangmi.send_command in all scripts!


#65

Where did you download the custom component? The current version doesn’t use python-mirobo anymore. It’s called python-miio now: https://github.com/syssi/chuangmi_ir

Please install the following system requirements:

apt-get install libffi-dev libssl-dev

#66

Its possible install and activate this addon in resinOS https://home-assistant.io/hassio/installation/ ?


#67

this tool helps to decode Base64 string.


#68

Is it possible to make this a climate component? Would really appreciate


#69

i Get thos switches:

switch.chuang_mi_ir_switch off friendly_name: chuang_mi_ir_switch
assumed_state: false
model: chuangmi.ir.v2
switch.chuang_mi_ir_switch_2 off friendly_name: chuang_mi_ir_switch
assumed_state: false
model: chuangmi.ir.v2
switch.chuang_mi_ir_switch_3 off friendly_name: chuang_mi_ir_switch
assumed_state: false
model: chuangmi.ir.v2

but myconfig looks like:

 - platform: chuangmi_ir
   name: "livingroomirremote"
   host: 192.168.1.141
   token: 570a6f6e854a18ae4a20f742ed7a5bea
   switches:
     tv:
       command_on: 'Z6VLAAkCAABpAgAAYgYAAKYIAACJEQAAoSMAAKScAABYeQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFAQEBAQEBAQEhISEhISEhIQEBISEBAQEBISEBASEhISFhNXE1AQ=='
       command_off: 'Z6VLAAkCAABpAgAAYgYAAKYIAACJEQAAoSMAAKScAABYeQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFAQEBAQEBAQEhISEhISEhIQEBISEBAQEBISEBASEhISFhNXE1AQ=='
     ac_on_off:
       command_on: 'Z6VTAoEBAADqAQAA4wQAAJEGAADlDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0IBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQIBAgICAgICAQICAgICAgICAgEBAQEBAQEBAQECAgEBAgICAgEBAgIBAQECAQECAQECAgECAgECAgECAgEBAgEBAQEBAgIBAgICAQEBAQECAgECAgICAgEBAgEBAQEBAQEBAgICAgICAgIBAQEBAQEBAQICAgICAgICAQEBAQEBAQECAgICAgICAgEBAQEBAQEBAgICAgICAgIBAQEBAQEBAQICAgICAgICAQICAQIBAgECAQECAQIBAgIBAQEBAgICAQICAgIBAQEBAQEBAQEBAQICAgICAgICAQEBAQEBAQECAgICAgICAgEBAQEBAQEBAgICAgICAgICAgEBAQEBAQEBAgICAgICAA=='
       command_off: 'Z6VTAoEBAADsAQAA4QQAAJAGAADnDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0IBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQIBAgICAgICAQICAgICAgICAgEBAQEBAQEBAQECAgEBAgICAgEBAgIBAQECAQECAQECAgECAgECAgECAgEBAgEBAQEBAgIBAgICAQEBAQECAgECAgICAgEBAgEBAQEBAQEBAgICAgICAgIBAQEBAQEBAQICAgICAgICAQEBAQEBAQECAgICAgICAgEBAQEBAQEBAgICAgICAgIBAQEBAQEBAQICAgICAgICAQICAQIBAgECAQECAQIBAgIBAQECAgICAQICAgEBAQEBAQEBAQEBAQICAgICAgICAQEBAQEBAQECAgICAgICAgEBAQEBAQEBAgICAgICAgICAgEBAQEBAQEBAgICAgICAA=='
     ac_swing:
       command_on: 'Z6VTAoEBAADqAQAA4QQAAJAGAADnDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0IBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQIBAgICAgICAQICAgICAgICAgEBAQEBAQEBAQECAgEBAgICAgEBAgIBAQECAQECAQECAgECAgECAgECAQEBAQEBAgECAgICAgIBAQEBAQECAgECAgICAgEBAgEBAQEBAQEBAgICAgICAgIBAQEBAQEBAQICAgICAgICAQEBAQEBAQECAgICAgICAgEBAQEBAQEBAgICAgICAgIBAQEBAQEBAQICAgICAgICAQICAQIBAgECAQECAQIBAgIBAQECAgICAQICAgEBAQEBAQEBAQEBAQICAgICAgICAQEBAQEBAQECAgICAgICAgEBAQEBAQEBAgICAgICAgICAgEBAQEBAQEBAgICAgICAA=='
       command_off: 'Z6VTAoEBAADqAQAA4QQAAJAGAADnDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0IBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQIBAgICAgICAQICAgICAgICAgEBAQEBAQEBAQECAgEBAgICAgEBAgIBAQECAQECAQECAgECAgECAgECAQEBAQEBAgECAgICAgIBAQEBAQECAgECAgICAgEBAgEBAQEBAQEBAgICAgICAgIBAQEBAQEBAQICAgICAgICAQEBAQEBAQECAgICAgICAgEBAQEBAQEBAgICAgICAgIBAQEBAQEBAQICAgICAgICAQICAQIBAgECAQECAQIBAgIBAQECAgICAQICAgEBAQEBAQEBAQEBAQICAgICAgICAQEBAQEBAQECAgICAgICAgEBAQEBAQEBAgICAgICAgICAgEBAQEBAQEBAgICAgICAA=='
       ```

#70

hey what do i do if i get this error:

> 2017-12-25 17:29:47 ERROR (SyncWorker_18) [homeassistant.util.package] Unable to install package python-miio==0.3.0: Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-lq0e3ug3/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-6q5th2gc-record/install-record.txt --single-version-externally-managed --prefix  --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-lq0e3ug3/cryptography/
> 2017-12-25 17:29:47 ERROR (MainThread) [homeassistant.setup] Not initializing switch.chuangmi_ir because could not install dependency python-miio==0.3.0
> 2017-12-25 17:29:47 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform switch.chuangmi_ir: Could not install all requirements.

#71

There are some system dependencies missing. Please install libffi-dev and libssl-dev:

sudo apt-get install libffi-dev libssl-dev

#72

Did u think about making a ac component with it? Also I bought for 240€ zwave climate components …still interested


#73

i got these error when trying to send packet, any idea?

2018-01-12 22:24:54 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/miio/device.py", line 236, in send
    self.__id += 1
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/miio/device.py", line 236, in send
    self.__id += 1
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/miio/device.py", line 236, in send
    self.__id += 1
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/miio/device.py", line 236, in send
    self.__id += 1
socket.timeout: timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/custom_components/switch/chuangmi_ir.py", line 98, in _send_packet
    ir_remote.send("miIO.ir_play", {'freq':38400, 'code': str(packet)})
  File "/srv/homeassistant/lib/python3.5/site-packages/miio/device.py", line 258, in send
  File "/srv/homeassistant/lib/python3.5/site-packages/miio/device.py", line 258, in send
  File "/srv/homeassistant/lib/python3.5/site-packages/miio/device.py", line 258, in send
  File "/srv/homeassistant/lib/python3.5/site-packages/miio/device.py", line 259, in send
miio.device.DeviceException

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 1031, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/usr/lib/python3.5/asyncio/coroutines.py", line 210, in coro
    res = func(*args, **kw)
  File "/home/homeassistant/.homeassistant/custom_components/switch/chuangmi_ir.py", line 100, in _send_packet
    except (socket.timeout, ValueError):
NameError: name 'socket' is not defined

#74

I get the same error, The LED on the device rapidly flashes for a good 20 seconds or so. Occasionally it causes the device to go offline entirely (The LED is off and the Mi Home app says it is offline)

Something is causing the command to be spammed rapidly.


#75

Please update home assistant to version 0.61 in a few days. It should fix the issue.


#76

I have 2 units of the Chuangmi IR. I’ve managed to setup the first Chuangmi IR unit in the living room properly, and can send IR signals to my LG TV, but I can’t seem to figure out how to add a second Chuangmi IR unit in my bedroom to the configuration file. Can anyone advise how to add a second Chuangmi IR unit?

Also, there is no way to learn any air conditioner IR codes at all. Has anyone figured out how to add/send air conditioner IR codes (mine is a Daikin)?

Thanks!


#77

Managed to figure it out. So in case anyone else needs to do this, here’s how to specify a second IR unit (see below). The most important thing that I found out was not have any extra blank lines that would cause errors. Basically repeat everything from platform onwards, with the new details

  • platform: chuangmi_ir
    name: BedroomRemote
    host: your.ip.add.ress
    token: yourtoken
    timeout: 20
    switches:
    aircon_on:
    name: 'Bedroom Daikin On/Off, 23 Degrees, Full Speed, No Swing’
    command_on: 'Z6W3Aa8BAAAUBQAAwAYAAH8NAAD2cwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjEAAAABAAAAAAEAAQEAAQEBAQEAAAEAAAAAAAABAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAEAjEAAAABAAAAAAEAAQEAAQEBAQEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQEAAAABAQEAAQAAAAAAAAAAAAAAAAAAAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAAAAAAAAAAAAAAAAAAAAAEAAAAAAQABAA’
    command_off: ‘Z6W3Aa8BAAAUBQAAwAYAAH4NAAD1cwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjEAAAABAAAAAAEAAQEAAQEBAQEAAAEAAAAAAAABAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAEAjEAAAABAAAAAAEAAQEAAQEBAQEAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAABAQEAAQAAAAAAAAAAAAAAAAAAAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAA’

#78

Found out from a Chinese site on how to use HASS to learn new codes including aircon codes, which are much longer than the usual codes. The Mijia app will not allow learning of aircon codes so this would help other people looking to learn long codes. The chuangmi_ir site isn’t very good at describing how this is done:

Under Developer Tools, click on Services
Look for the service, chuangmi.learn_command_[your.ip.add.ress]
Click on "Call Service"
This will cause your chuangmi_ir to enter into learning mode. The blue light will begin to flash. Point your aircon remote (or whatever remote you want to learn the code from) at the chuangmi_ir unit, and press the button. The blue light will stop flashing.

The learned code will appear in the Overview Menu, as well as States menu. However, you will need to full code from the States menu as that will be easier to see.

Under Developer Tools, click on States
Look for a persistent_notification which will list the learned IR code.

Hope that helps people like me who had these problems.


#79

Hi Syssi,

I’ve got HASS.IO 0.61.1 installed but I still get dependency errors.

Unable to prepare setup for platform switch.chuangmi_ir: Could not install all requirements.
Not initializing switch.chuangmi_ir because could not install dependency python-miio==0.3.0

What should I do?


#80

I get
[homeassistant.loader] Unable to find component chuangmi

And

[homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.6/asyncio/tasks.py”, line 180, in _step
result = coro.send(None)
File “/usr/lib/python3.6/site-packages/homeassistant/components/websocket_api.py”, line 473, in get_services_helper
descriptions = yield from async_get_all_descriptions(self.hass)
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/service.py”, line 153, in async_get_all_descriptions
yaml_file = domain_yaml_file(domain)
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/service.py”, line 137, in domain_yaml_file
component_path = path.dirname(get_component(domain).file)
AttributeError: ‘NoneType’ object has no attribute ‘file

When the chuangmi switch is enabled. 0.61.1
Ideas?