Play Sound on Xiaomi Gateway 2

Hello

I have set up a test rule firing when CO2 concentration reaches a certain limit. My Tradfri changes to red for a while. I wanted to underline this event through playing a sound on my Xiaomi Gateway 2. Therefore I added the following statements to my TestRule

	sendCommand(Xi_Gateway_SoundVolume, 6)
    	sendCommand(Xi_Gateway_SoundSelector, 11)
    	Thread::sleep(2000) /* wait for 2 seconds */
    	sendCommand(Xi_Gateway_SoundSelector, 10000)
    	sendCommand(Xi_Gateway_SoundVolume, 0)

as it is described in the Xiaomi Openhab 2 binding documentation

Unfortunately no sound is playing at all but a Warn message is indicated in the log file as follows:
2018-01-22 20:49:46.491 [WARN ] [g.mihome.handler.XiaomiBridgeHandler] - No key set in the gateway settings. Edit it in the configuration.

Anyone an idea where the problem comes from?

Thanks for any ideas.

Jan

Did you entered the developer key? See https://docs.openhab.org/addons/bindings/mihome/readme.html#setup

I see that you use ‘10000’ as sound, but this is to STOP the gateway from playing sound.

I use this part of a rule for my doorbel:

sendCommand(Xiaomi_Gateway_SoundVolume, 13)
sendCommand(Xiaomi_Gateway_Sound, 10011)
Thread::sleep(5000) /* wait for 5 seconds */
sendCommand(Xiaomi_Gateway_Sound, 10000)
sendCommand(Xiaomi_Gateway_SoundVolume, 0)

Hi Ward

I did, but it has disappeared somehow… Thank you a lot, that helped. I reentered the key and it works fine now.

Jan

Hello, since a few days ago the personalized sounds stopped working. Has someone happened to you?

Hi,
I just set up the Gateway with openhab, but unfortunately the sound module doesn’t work…
It just throws the following error:

2018-03-11 02:49:24.829 [vent.ItemStateChangedEvent] - Gateway_Sound changed from 11 to 10011

2018-03-11 02:49:24.832 [vent.ItemStateChangedEvent] - Gateway_SoundVolume changed from 0 to 13

2018-03-11 02:49:29.808 [ome.event.ItemCommandEvent] - Item 'Gateway_Sound' received command 10000

2018-03-11 02:49:29.826 [ome.event.ItemCommandEvent] - Item 'Gateway_SoundVolume' received command 0

==> /var/log/openhab2/openhab.log <==

2018-03-11 02:49:29.810 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler@13c30ec': null

java.lang.NullPointerException: null

	at org.openhab.binding.mihome.internal.EncryptionHelper.encrypt(EncryptionHelper.java:69) [231:org.openhab.binding.mihome:2.2.0]

	at org.openhab.binding.mihome.internal.EncryptionHelper.encrypt(EncryptionHelper.java:42) [231:org.openhab.binding.mihome:2.2.0]

	at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.getEncryptedKey(XiaomiBridgeHandler.java:291) [231:org.openhab.binding.mihome:2.2.0]

	at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.createDataJsonString(XiaomiBridgeHandler.java:277) [231:org.openhab.binding.mihome:2.2.0]

	at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.writeToBridge(XiaomiBridgeHandler.java:273) [231:org.openhab.binding.mihome:2.2.0]

	at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.writeBridgeRingtone(XiaomiActorGatewayHandler.java:199) [231:org.openhab.binding.mihome:2.2.0]

	at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.execute(XiaomiActorGatewayHandler.java:98) [231:org.openhab.binding.mihome:2.2.0]

	at org.openhab.binding.mihome.handler.XiaomiDeviceBaseHandler.handleCommand(XiaomiDeviceBaseHandler.java:104) [231:org.openhab.binding.mihome:2.2.0]

	at sun.reflect.GeneratedMethodAccessor65.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.$Proxy155.handleCommand(Unknown Source) [231:org.openhab.binding.mihome:2.2.0]

	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.GeneratedMethodAccessor64.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) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

	at java.lang.Thread.run(Thread.java:748) [?:?]

Still not working even if I followed specs listed [here](https://www.openhab.org/addons/bindings/mihome/).

Do you know how to fix it?

@Adrian_BZT adrian did you ever manage to get it working again ?

1 Like