Xiaomi smart home

Hello everybody,

I’m the “dev” under the “fooxy” name.
I update the code in github for the custom component:

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

Currently, it is not so easy-to-use, you need to have sensors ids (SID) but it is intended to include a function to get them automatically.

I’m not a developer but I’ve been interested in several languages (swift, javascript, etc) so thank you for being understanding about any errors.

Until now (5 days), everything works with vizualisation in Grafana via Influxdb :slight_smile:

3 Likes

Hello Fooxy.
Thank you for you efforts. Component work fine. I’ve already installed it. There is small issue with temp sensor naming. It appears as device name. I’ve changed code in same way as for humidity sensor. So it appears now as device_name_temperature.

Thanks Lapatoc,
It was temporarily for personal use because I wanted to keep the old recordings.
I merged the pull request in Github.

Fantastic work guys, just one thing I’ve run in to. A lot of wireless APs don’t forward multicast packets onto wifi clients. After enabling developer mode, it looked like the gateway wasn’t sending the UDP packets when I was using Wireshark on my laptop. When I connected the ethernet cable they appeared.

Hopefully this helps someone. Keep up the good work.

so are you saying that HASS needs to be on a hardwired network? can use port forwarding to ensure that the UDP packets are sent to the appropraite IP?

1 Like

It is possible to use the door/windows détecter alone?

No - you need the hub.

Ok so i Will order the hub and windows next time when it’s on promotion.

There was à promotion last week-end for black friday

i just bought from gearbest for $30 AUD. cheapest price i could find at the time.(just looked USD25)

If you can set your router to forward multicast packets to wifi clients then that would probably work but I couldn’t in mine (Netgear R7000) with stock firmware. I’m sure dd-wrt has something though.

Otherwise yes you’ll need to have HASS hard wired.

1 Like

bugger - it is all wireless at the moment. I should be getting a new one when i get fibre, hopefully soon…

Can anyone give me a quick description of how to utilize Jon’s code ? I have Fooxy’s plugin working, but can’t figure out how to use Jon’s. If i read correctly, it’s not a finished plugin yet, but keen just to see the output coming from the gateway.

2 Likes

Do the updates just appear? mine is currently on 1.2.xx and is taking a while to update. I assume i just have to keep checking for updates until i get to the right version?

I had issues updating too. I found that if i initiate the update, wait for the gateway to start flashing yellow, then press the home button on my phone, it would allow it to complete the update. just wait until the gateway stops flashing, and it should be updated.

Also - @jon1012 you are amazing!

I fired up your script first time, and it worked, across wireless too. I edited the MQTT server and changed the topic to start with a / (ie: /xiaomi/switch/158d0001256870/status click)

then used the following automations to toggle some lights:

- alias: "Dining Room light switch"
  trigger:
    platform: mqtt
    topic: /xiaomi/switch/158d00012568ae/status
    payload: "click"
  action:
     service: switch.toggle
     entity_id: switch.dining_room_light
- alias: "Eli's Room light switch"
  trigger:
    platform: mqtt
    topic: /xiaomi/switch/158d0001256870/status
    payload: "click"
  action:
     service: switch.toggle
     entity_id: switch.elis_room_light

can’t wait fro this to be implemented into a HASS componnet. I will just run it as a systmctl service until then :slight_smile:

1 Like

Can you explain what this is about?

Interested in this Xiaomi line.

Will the smart plug integrate well in HA? There are 2 versions anyone knows the difference?

Newb here, tell me that I understand well.

I can buy the Xiaomi hub and accessories and it integrates well with HA.
For example using the Xiaomi switch to trigger a Hue light. And is all relatively easy to program

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