I had it working with the normal rule with “getEvent” in 2.2 and after a restart it is not working anymore…
The error is:
18:50:28.716 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Office Andreas Button': 'getEvent' is not a member of 'org.eclipse.smarthome.core.thing.events.ChannelTriggeredEvent'; line 48, column 20, length 24
Is it possible to make “getEvent” a member of these events?..
I have the same problem. My setup is Raspberry 3, latest Openhabian, 2 gateways with latest firmware, 12 sensors.
I used hostapd to create a hotspot on the raspberry, and told my 2 gateways connect to it. The gateways and some sensors are found, but nothing works. Logfiles gave the same error as you have.
After activating debug logging for the binding it appears that no gateway heartbeats are coming in.
I changed my setup to use an old router instead, with the gateways connected via wifi and the raspberry connected via wired ethernet.
Now it works, somewhat. Hartbeats come in but commands seem not to be fully reliable.
I have code in a background timer thread that makes both gateway lights flash red (500ms on, 500ms off).
The gateways don’t flash in synch. Some on/off commands seem to be lost, so one of the gateways misses an on or off cycle.
Sometimes both are in synch for a few seconds, then one misses an on/off command, then maybe the other gateway. Unpredictable.
The same rules running on my windows PC work flawlessly.
603/5000
I do not know how to continue. I deleted the gateway and reconfigured. Now I see no more heartbeats in Wireshark There was a heartbeat when setting the new IP in the PaperUI.The token now seems to be set, but I get now another error message.The temperatures of my MiHome sensors are read out correctly.
If I restart the RPI, the Toekn will not be set either. The whole thing is very strange. Before I installed the latest Openhabian image, I could easily use the binding.
Does anyone have an idea or a tip for me?
EDIT: I have just noticed that the temperature values do not change anymore. They seem to be read out at initialization and then stay that way.
java.lang.NullPointerException: null
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.toJsonValue(XiaomiBridgeHandler.java:320) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.sendCommandToBridge(XiaomiBridgeHandler.java:258) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.sendCommandToBridge(XiaomiBridgeHandler.java:240) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.writeToBridge(XiaomiBridgeHandler.java:272) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.writeBridgeRingtone(XiaomiActorGatewayHandler.java:199) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.execute(XiaomiActorGatewayHandler.java:98) [207:org.openhab.binding.mihome:2.2.0]
at org.openhab.binding.mihome.handler.XiaomiDeviceBaseHandler.handleCommand(XiaomiDeviceBaseHandler.java:104) [207:org.openhab.binding.mihome:2.2.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
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.$Proxy146.handleCommand(Unknown Source) [207: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.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
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) [?:?]
Patrik,
Are you using the raspberry as the wifi hotspot for the gateway?
That’s where my problems came from. In my setup with raspberry hotspot one gateway would initialize ok, all sensor values refreshed once, then no more heartbeats and no refresh, also updates don’t work. My second gateway would not initialize at all.
Now with a separate router it works ok but not perfectly, rapid updates sometimes get lost.
.
I had some problems getting the binding to auto-discover the gateway (1.4.1_151.0143, btw) - turned out, the Wifi was in powersaving mode! after changing that to off, it works now. Perhaps, that was one part in your setup?
So, running the mihome binding on a wifi connected OH2, be sure, powersaving is off.
I’m still getting some delays between updates (temperature/pressure/humidity sensor), but I’m fine with it.
I have OpenHAB2 Snapshot release. Connect Mi Smoke Sensor (Xiaomi Mijia Honeywell Fire Alarm Detector) over Mi Home Gateway v3. Smoke Sensor have some properties - status and % of charge. Current status is unknow and % of charge is NaN. It’s normally?
i discovered, that the Smoke Detector is one of the trickier ones. Perhaps to save battery, its only sending updates to the Gateway in hour long intervals. You have to be lucky to get an answer just after reloading the items file. Just let OH2 run for a couple hours and then sometime there should be some info from the smoke sensor.
I don’t think, the Gateway persists Information, but only transports live data from the sensors. In the App you get persisted data from the cloud.
to be honest I have no idea what is supposed to work or not. I had the issue that my button stopped working after an update of OH and I found the new rules on the net and they worked for me. I am sorry I can’t help you out on this.
is your openHAB connected via Wifi or LAN? if it’s Wifi-connected, you must turn off power_save mode. otherwise, the OH2-socket won’t stay connected with the gateway.