Xiaomi IR Remote
Moderator: leecollings
-
- Posts: 234
- Joined: Sunday 27 August 2017 18:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Spain
- Contact:
Xiaomi IR Remote
Hello,
I have domoticz configure and working fine with miio library (with air purifier configured OK)
I have a XIAOMI IR REMOTE, and i want to integrate it in domoticz. Anyone have idea???
thanks
I have domoticz configure and working fine with miio library (with air purifier configured OK)
I have a XIAOMI IR REMOTE, and i want to integrate it in domoticz. Anyone have idea???
thanks
-
- Posts: 234
- Joined: Sunday 27 August 2017 18:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Spain
- Contact:
Re: Xiaomi IR Remote
nobody have the xiaomi IR remote??
-
- Posts: 234
- Joined: Sunday 27 August 2017 18:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Spain
- Contact:
Re: Xiaomi IR Remote
Hello again,
I still investigating and fin some info:
python library that suuports Xiaomi IR Remote:
https://github.com/rytilahti/python-miio#id27
I install the library in my raspberry, but im a noob with python and i dont know how to progress
I still investigating and fin some info:
python library that suuports Xiaomi IR Remote:
https://github.com/rytilahti/python-miio#id27
I install the library in my raspberry, but im a noob with python and i dont know how to progress

-
- Posts: 22
- Joined: Monday 31 July 2017 14:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi IR Remote
Have this working allready?
-
- Posts: 234
- Joined: Sunday 27 August 2017 18:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Spain
- Contact:
Re: Xiaomi IR Remote
Yes, it works fine:
you must use this library:
https://github.com/rytilahti/python-miio
and the create scripts:
IR.PY for learn the comand and save it to a codes.txt file
and this other script to irsend.py to send the comand (irsend.py 15), this send the comand in line 15 of your codes.txt
then integrate with virtual switches in domoticz and ready.
Sorry for the poor explanation but i dont have much time
you must use this library:
https://github.com/rytilahti/python-miio
and the create scripts:
IR.PY for learn the comand and save it to a codes.txt file
Code: Select all
#!/usr/bin/python3
import sys
import ipaddress
from typing import Any
from miio import ChuangmiIr,DeviceException
import time
import json
num_lines = sum(1 for line in open('codes.txt'))
print ('Stored Ir Keys ->'+ str(num_lines) )
id = num_lines + 1
ir = ChuangmiIr('your.IP','your token')
ir.learn(key=1)
time.sleep(10)
print (ir.read(key=1).get("code"))
with open('codes.txt', 'a') as file:
file.write(ir.read(key=1).get("code")+ '\n')
#
Code: Select all
#!/usr/bin/python3
import sys
import ipaddress
from typing import Any
from miio import ChuangmiIr,DeviceException
import time
f=open('/home/pi/Xiaomi/IR/SALON/codes.txt')
codeline=f.readlines()
#id = codeline[int(sys.argv[1])-1]
id_aux = codeline[int(sys.argv[1])-1].split(" ")
id=id_aux[0]
ir = ChuangmiIr('YOUR.IP','YOUR.TOKEN')
ir.play(id,frequency='')
then integrate with virtual switches in domoticz and ready.
Sorry for the poor explanation but i dont have much time

-
- Posts: 2
- Joined: Friday 16 March 2018 10:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi IR Remote
I will correct not much
In the script irsend.py the last line should look like this
only so I sent the code
You can also send commands with the following code
which is much easier to install into other scripts
Sorry for my bad english
In the script irsend.py the last line should look like this
Code: Select all
ir.play_raw (id,frequency='')
You can also send commands with the following code
Code: Select all
mirobo --ip 192.168.0.25 --token 689c4056fe28ebb3a2e8c2fe350e51ba raw_command miIO.ir_play '{"freq": 38400, "code": "base64..."}'
Sorry for my bad english

-
- Posts: 8
- Joined: Friday 21 December 2018 11:09
- Target OS: Windows
- Domoticz version:
- Contact:
Re: Xiaomi IR Remote
Please advice, where can I get the token of Xiaomi IR controller?nickmorgan wrote: ↑Friday 16 March 2018 10:50 I will correct not much
In the script irsend.py the last line should look like thisonly so I sent the codeCode: Select all
ir.play_raw (id,frequency='')
You can also send commands with the following codewhich is much easier to install into other scriptsCode: Select all
mirobo --ip 192.168.0.25 --token 689c4056fe28ebb3a2e8c2fe350e51ba raw_command miIO.ir_play '{"freq": 38400, "code": "base64..."}'
Sorry for my bad english![]()
-
- Posts: 112
- Joined: Monday 26 June 2017 21:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Spain
- Contact:
Re: Xiaomi IR Remote
Do you know how to comand the Xiaomi Mi Home Air Conditioner Companion? It is supported by miio
I only need to turn on and off, but I didn't find the way
Thanks
I only need to turn on and off, but I didn't find the way
Thanks
-
- Posts: 1
- Joined: Wednesday 20 February 2019 11:10
- Target OS: Windows
- Domoticz version:
- Contact:
Re: Xiaomi IR Remote
Faced with a similar problem
-
- Posts: 3
- Joined: Thursday 11 April 2019 7:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi IR Remote
The above version works with the previous version of XIAOMI remote control (with MI letters on the body). Does not work with the 2019 remote control (with MI logo) with air conditioning. It works with TV and audio systems but doesn't work with air conditioners (York, Mitsibishi, Tadirian.) It looks like the company XIAOMI is specifically forbidden to run air conditioners. Maybe somebody has a solution to run air conditioners with IR from DomoticZ?
Who is online
Users browsing this forum: No registered users and 1 guest