Xiaomi Items not getting values

As far as I know sensors are linked to a particular gateway, that again can be linked to the main gateway (but I’m not sure as I do not use this config, I just read about it in the Xiaomi artices)
But when facing problems that are not understood, going back to the most basic situation is always best. So use one gateway, link your sensors to that gateway. Then setup openhab to communicate with it.

Thats what I have done, as above, doesnt work either

Literally the only other thing I can possibly this of is, when it says port 9898 must not be used by anything else on the system, does that mean the whole network?

So my Openhabian is on 192.168.69.3, and port 9898 is used and open by Monkeycom (which I think is correct). I then have another few pies which all have 9898 used by Monkeycom but all closed.
Then is I look at port 9898 on the gateways they are all open and pinging them works.
However on 192.168.69.2 I am running a Windows Server, which on port 9898 has Monkecom and again is open… should that be closed?

So to double check (not that I want to express any doubts regarding your setup, but I understand the PI setup is fresh and all should really work out-of-the-box)

All other gateways are off (unpowered)
There is one gateway where the sensors are linked to (the should (for now) not be linked to other gateways).
You use the developer key of the single gateway that is on…

I dont remember what port 9898 is used for in the Xiaomi gateway. But in general, it´s a very bad idea having several devices operate on the same port.
Could you try disconnect the other devices (just for testing) and then restart the Xiaomi gateway?

Yes port 9898 should not be used on the openhab system, that should be changed.

Well it is open “out of the box” on openhabian. All I have literally just done is turn off all gateways, fresh install of Habian, install Xiaomi binding, plug in brand new gateway, add one child device (motion), add both to openhab and add developer key.

So the port open 9898 on Openhab has been done BY openhab

Nmap scan report for openHABianPi.localdomain (192.168.69.3)
Host is up (0.0050s latency).

PORT STATE SERVICE
9898/udp open|filtered monkeycom
MAC Address: B8:27:EB:83:B6:6C (Raspberry Pi Foundation)

Nmap done: 1 IP address (1 host up) scanned in 4.08 seconds

Surely I need this open so it is listening out for the gateway which also uses 9898:

Nmap scan report for lumi-gateway-v3_miio80948140.localdomain (192.168.69.85)
Host is up (0.014s latency).

PORT STATE SERVICE
9898/udp open monkeycom
MAC Address: 78:11:DC:E1:7E:2B (Xiaomi Electronics,co.)

Nmap done: 1 IP address (1 host up) scanned in 3.85 seconds

No idea if this is useful… when I tried to delete and readd the device…

the Bridge is autodiscovered, once added the motion sensor and Gateway is also autodiscovered. If I don’t add the developer key then nothing appear in Control for the devices, if however I then add the developer key, the battery level shows as 100%, and the lumination of the gateway goes to 1292. Again, it doesnt update any values to show when motion is detected (as it does on the App) but adding the developer key does make this difference.

PLEASE HELP

I honestly have no idea whats going on. I had no problems with my gateway at all.
Is it firmware updated to latest version? (this is done via the app).

Is it possible to remove the motion sensor from the App, so its not connected to anything, then reset everything. I may be way off, but maybe it will connect and update to OH if that’s it’s only option.

Ummm… ok, little wierd!

I’ve just installed UFW on my Openhabian as a last ditch attempt incase it was firewall or port related…
So, I opened port 9898, 80 and 8080 on UFW, left it for 2 hours. When I came back the Lumination value had been updated, and the logs show some sign of things being updated, and also say about commands being sent!

Unfortunately, by installing UFW I have stopped myself being able to putty in! But, does it seem this may be to do with something being blocked??

What is UFW?

Firewall :slight_smile:

Problem is its now given a different issue possibly…

If I try to update the colour or turn the light on/off on the gateway I now get this:

[g.mihome.handler.XiaomiBridgeHandler] - No token received from the gateway yet. Unable to encrypt the access key.

I have done a search for reasons for it but no idea what it actually is… If people are using Ubuquitti and Unifi with Openhab then it isnt because of that, although my Pi is connected via Ethernet and obviously the Gateway is Wifi so I dont know if thats technically on a different network which can apparently cause the issue.

I’m going to start a new topic as irritatingly I know the issue, just not how to solve!!

Any Updates on this one?
I`m having exactly the same Problems.

Try using the Wifi on your Pi. It’s ridiculous, but thats what solved mine!

What do you mean by that? My OH Raspi runs over wifi anyway lol, no RJ45