Xiaomi smart home

not yet… i have grabbed @jon1012’s script, and have it running as a service on my linux box. It in turn publishes to MQTT, which i have a server running, then HA subscribes to those topics and reacts depending on what i expect it to do.

so at the moment - no it is not ‘easy’ not particularly hard if you are not a newbe… there is not a lot of information readily available on the net about the Xiaomi stuff. Shouldn’t be too long until it is all integrated i would think

Update
Component easier to use.
No need to enter:

  • the gateway’s IP and port,
  • SID for each sensor.

https://github.com/fooxy/homeassistant-aqara

3 Likes

cool - does it work with switches and motion sensors yet?

Another thing that i have come across. Every now and then i miss button presses, and i think that it is becuase the script (@jon1012’s) is connected over wifi, and since it is multicast trafffic, there are no ack’s or retries. So if there is a collision/lost packet, it will not work.

This thread excites me greatly!! I’ve been looking for cheap door sensors!

Let me know when they are confirmed working and I’ll buy a set :smile:

They have now very very low prices, like 60% off.

On one side I am tempted, on the other no, because:

  • when products are 60% off usually because a new series is coming
  • difficult integration, and another hub around …

where is this 60% off? any links?

check gearbest, banggood, and similar

ah, they are more or less the normal prices. once the hass component is finished, it’ll be easy to set up :slight_smile:

I’m testing something for magnet and proximity, the switch should be simple to implement.
To do this I changed the scan interval to 2 sec allowing HA to poll for data.
I think it should be possible to have a better way to do this if the gateway pushes data when the state changes.
I’ve to do some investigation and learn some basis about networking.
I will probably share the early code if some are interested.
It works even if sometimes it takes some second to respond.

@jon1012’s script seems to bind to a multicast address and converts everything that it recieves into MQTT. This will remove the requirement for polling, however, when over wifi there are chances to miss packets.

The MQTT posting is also very useful for debugging

(Note: i am yet to use your implementation, so i could be talking out of my ass…)

That’s right no need to do polling, the requests arrive as soon as the packet is sent from the Xiaomi HUB.
However, a big issue with the motion sensor is that it only seem to work once every minute. Once triggered, it will not work until the next minute. Anyone has experienced this 1 minute delay of motion or other kind of sensors?

proximity? How?

Here is a small sample of motion triggers from a motion sensor… i looked a bit funny pacing up and down…

/xiaomi/motion/158d0001292bd2/status motion
/xiaomi/motion/158d0001292bd2/time/ 2016-12-06 20:15:26.663724
/xiaomi/motion/158d0001292bd2/status motion
/xiaomi/motion/158d0001292bd2/time/ 2016-12-06 20:16:26.976874

yoou may be right :slight_smile:

That’s exactly what I was trying to explain! I also found that if you press the pair botton on the sensor quickly the sensor works again really fast but after some time it goes back to “1minute delay”

I would assume the c2032 coin battery doesn’t go far so it’s rate limited…

It does send out a cancellation “No Motion” Message when it hasnt had motion ofr a minute or two.

I dont think you will get really high resolution from a battery powered sensor, just too much power usage.

Sounds good and I was about to buy some, but the hub set/sensor suite is now out of stock on both Banggood and Gearbest so I suppose I should leave it for a month just in case there’s a new version coming out, rather than buying one from a random ebay/ali-express seller.

can you still buy them individually? I think it was more or less the same price. i bought individually anyway.

You can still buy the sensors individually (and I did), but unfortunately the hub seems to be only available in the non-stocked kit. [EDIT - just spotted an indiviual one, so will get that.]