I just bought the Mi Infrared Remote control pictured above. It can be setup via the MI Home app (Same as Yeelights and Xiaomi Camera). Does anyone know if there is a binding available for it. The app is only in Chinese for this section of the setup but using Google Translate I could easily setup my media player, TV and blue-ray. It works well and is very cheap. I only paid $20 on gearbest for it.
This looks to be a cheap alternative to the Harmony remote.
Is this the Xiaomi Chuangmi IR Remote control?
If yes, I believe it uses the same communication protocol.
Phython-miio had some basic support for it I believe.
Anyway, if it is controlled by wifi through the mihome app and it does not need the gateway there is a high chance that it can be controlled with the miio binding.
You can extract the token from the mi home app and let the binding discover.
DO I need to turn developer mode on. Any idea how to do it on the MI Home app? Any idea how to get the token and how to get it discoverable for Openhab?
You can obtain the binding through the buildin store, select the “Openhab Xiaomi Mi IO Binding”
With the binding installed, if you are lucky it will discover your device.
Once discovered, you may need to enter the token, or the token is provided during discovery (I can’t tell… depending per device if it is provided automatically)
Please look for how to obtain the token in this topic
Also google may be of assistance here…
Once installed, and if compatible, I expect it to be identified as 'miio:unsupported" as no build in support is available.
Than enable the (advanced) cmd channel
You can than use the cmd channel to execute commands. From what I saw there are 2 commands: miIO.ir_learn["key" : 1] → to learn codes. replace the number with the id you want to learn miIO.ir_read["key" : 1 ] → to read the key. dunno what that actually means miIO.ir_play["freq": 38400, "code": command ] → I guess the commands can be obtained with the read cmd. the frequency is the default one… you probably can have different ones as well.
Anyway… once you have the communication working fine, set the log level to debug and share the output of the binding (see also the vacuum topic). I may be able to add support for it in due time.
Sorry for the very basic question, but I’m not able to find the Xiaomi Mi IO binding in https://docs.openhab.org/addons/bindings.html. Do I need to install it from somewhere else?
I really want to start working with the IR emitter!
I’m trying the miIO.ir_read[“key” : 1 ] command and I get the following error.
09:39:32.085 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'ChuangmiIrV2_miio66047370_Actions_ExecuteCommand' received command miIO.ir_read["key" : 1 ]
09:39:32.088 [WARN ] [rnal.transport.MiIoAsyncCommunication] - Send command 'miIO.ir_read' with parameters ["key" : 1 ] -> 192.168.1.119 (Device: 03EFCD8A) gave error com.google.gson.stream.MalformedJsonException: Unterminated array at line 1 column 9 path $[1]
09:39:32.090 [INFO ] [smarthome.event.ItemStateChangedEvent] - ChuangmiIrV2_miio66047370_Actions_ExecuteCommand changed from miIO.ir_read[1] to miIO.ir_read["key" : 1 ]
09:39:32.090 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.miio.handler.MiIoUnsupportedHandler@300f062e': com.google.gson.stream.MalformedJsonException: Unterminated array at line 1 column 9 path $[1]
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated array at line 1 column 9 path $[1]
at com.google.gson.internal.Streams.parse(Streams.java:60) [22:com.google.gson:2.7.0]
at com.google.gson.JsonParser.parse(JsonParser.java:84) [22:com.google.gson:2.7.0]
at com.google.gson.JsonParser.parse(JsonParser.java:59) [22:com.google.gson:2.7.0]
at com.google.gson.JsonParser.parse(JsonParser.java:45) [22:com.google.gson:2.7.0]
at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication.queueCommand(MiIoAsyncCommunication.java:133) [237:org.openhab.binding.miio:2.3.0.201803092003]
at org.openhab.binding.miio.handler.MiIoAbstractHandler.sendCommand(MiIoAbstractHandler.java:190) [237:org.openhab.binding.miio:2.3.0.201803092003]
at org.openhab.binding.miio.handler.MiIoUnsupportedHandler.handleCommand(MiIoUnsupportedHandler.java:51) [237:org.openhab.binding.miio:2.3.0.201803092003]
at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [109:org.eclipse.smarthome.core:0.10.0.b1]
at com.sun.proxy.$Proxy189.handleCommand(Unknown Source) [237:org.openhab.binding.miio:2.3.0.201803092003]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:72) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [109:org.eclipse.smarthome.core:0.10.0.b1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
I tried a few different json command but no sucess… Is there souce code for this somewhere?
these channels are marked as advanced, hence you need to do one more click in the paperUI to make them visible (the “SHOW MORE” button next to the channels definition in the thing edit,)
I just realized, that this is part of the control-tab in PaperUI … I tried to find it in the config-tab
thanks for your help. So finally i got it working. I can trigger the IR-Remote from rules. Thanks for the help!
it works flawless with the signals for my Sony-TV but the learned signals for the Yamaha AVR don’t work. could it be necesarry to change the “freq” in the miIO.ir_play command?
Edit/Solution:
i tried the app"anymote" for android to control the AVR via my mobile … these signals can be leared by the xiaomi ir whereas the signals from the original yamaha remote did not work