This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.
Closed Official Zigbee SDK2

[App] Xiaomi-mi ZigBee - Main discussion topic (v0.4.1)

2456721

Comments

  • captkiwi said:
    Sevift said:


    Great News !

    Apparently Xiaomi uses the standard NXP trusted  Center Link KEY: 5A: 69: 67: 42: 65: 65: 41: 6C: 6C: 69: 61: 6E: 63: 65: 30: 39 with that key you can decode the Zigbee ZHA protocol messages between all the Xiaomi Sensors and the Xiaomi gateway:

    He also published all attributes of different sensors in an excel sheet.

    https://github.com/fairecasoimeme/Xiaomi
     
    So it should be possible to connect all these great cheap sensors to the Homey Zigbee protocol when ready.

    Cant wait,  cause these sensors have a great range and are super efficient, haven't had to change the battery for more than 1 year

    It is great news! If I understood the artikel right that key is only used when you pair the devices. Once they are paired they use a different key. But this second key can be decoded from the pairing frames with the first key. I just received a temp/hum sensor. Cant wait for Athom to enable the Zigbee chip and start writing an app!
  • sebynosebyno Member
    edited August 2017
    Hi all,
    any chance to get this (http://www.gearbest.com/alarm-systems/pp_610095.html) working with the new 1.5 firmware?
  • Any updates? Just saw the Xiaomi Mi Smart Home 6 in 1 Kit on geekbuying for $59.99
  • I wouldn't say that I'd kill to have those xiaomi sensors finally working on homey, but it sure would be nice! Mine are collecting a load of dust atm. Would be nice to know if athom considers working on an app for these devices
  • https://apps.athom.com/app/com.xiaomi-miio
    these already work with Homey through the gateway. As for direct support, people from the community are working on that (@TedTolboom I think)
  • bvdbos said:
    https://apps.athom.com/app/com.xiaomi-miio
    these already work with Homey through the gateway. As for direct support, people from the community are working on that (@TedTolboom I think)
    The Smart home sensors, buttons and switches are not yet working with the above mentioned app.

    I tried to include the Xiaomi Smart Home devices directly through the Zigbee protocol to Homey, without the use of the Hub. With some effort (keeping the sensors awake), I'm able to get the paired and recognized based on my app.

    But I currently get stuck on the issue that Xiaomi changes the encryption key (again) after pairing; also known issue on other home automation platforms.
    This, resetting the key, is (currently) not supported by Homey and it is not sure if and when it will be.

    In parallel, @baskiers is working to get these devices working with Homey by using the hub.
    I will check on the status of his work.
  • @TedTolboom
    Thanks! keep us updated  :)
  • geirgeir Member
    edited August 2017
    I've been experimenting with xiaomi devices with same chip, firmware and library as i think homey use internally. I got all of them (pir, temp, door and switch) to work with slight modifications to the zigbee js library back then, and the switch I paired a month ago is still working. From my experience they send zigbee attribute reports without configuring them (just pairing). The switch/button wil send different events (values) for hold, release, single, double, triple, and quadruple+ clicks - because of this a single click has a slight lag. 

    The difference compared to some other zigbee devices seems to be:
    - Attribute-based, cant be bound 
    - Attributes are reported to controller without configuration (no configureReporting)
    - Querying clusters doesnt work (should be shortcuted in pairing based on manufactor-id or something?)

    As far as I know the TI chip and firmware (zigbee certified) communicates with xiaomi just fine, but the js-lib doesn't quite. 



  • @geir Do you have a link to a repo? After the modifications of the js library, do other devices still work and did you publish your improvements?
  • @geir Thanks for the feedback and information. Like @bvdbos also asked, can you share the modifications to the js-lib?

    the js-lib is outside the reach of us (developers), but based on this info (and shared modifications I could see if Athom is willing to make these modifications inside Homey's core..
  • geirgeir Member
    This is the library I guess they are using:
    https://github.com/athombv/zigbee-shepherd

    I´ve not published anything, just have a local version I´ve been testing with since about a year ago. My version was downloaded in sept/oct last year I think, and there has been a lot of commits since. By reading the commit messages on athoms fork, it seems most or all issues have been resolved already - so it might already be working in homey, so the issue might just as well be in the app, or other homey internals. But as I have it working with TI chip and firmware I´m confident it should work in homey eventually. Can´t see why it should affect other zigbee devices.

    If i remember correctly some of the devices paired without modifications to the library by clicking the pair button multiple times rapidly (pir, switch, and door - but not temp). I think the multiple click thing can be avoided by not querying these devices for in-out clusters etc and just set them to a predefined defaults. (The reason for this i think is that devices shut down soon after they consider pairing is done, and you need to wake it again repeatedly to receive the rest of the messages the js-lib is sending as part of its pairing process). The attribute reports should come automatically after pairing.

    For philips hue remote you bind the remote to one of the controller endpoints to receive commands.
    But for xiaomi switch (and other xiaomi devices) you just pair it, and the clicks are reported as attributes to the gateway/controller instead (much like the philips motion sensor, but you dont have to send anything to activate the reporting).

    Different firmware on the devices might affect things as well. Most of my devices has never been paired with the xiaomi hub and the firmware hasnt been updated ota)

    I´ll try writing a driver for homey this weekend and we´ll go from there. If it doesn´t work someone with both a xiaomi device and access to homey internals will probably be required. 


  • TedTolboomTedTolboom Member
    edited August 2017
    geir said:
    This is the library I guess they are using:
    https://github.com/athombv/zigbee-shepherd

    I´ve not published anything, just have a local version I´ve been testing with since about a year ago. My version was downloaded in sept/oct last year I think, and there has been a lot of commits since. By reading the commit messages on athoms fork, it seems most or all issues have been resolved already - so it might already be working in homey, so the issue might just as well be in the app, or other homey internals. But as I have it working with TI chip and firmware I´m confident it should work in homey eventually. Can´t see why it should affect other zigbee devices.

    If i remember correctly some of the devices paired without modifications to the library by clicking the pair button multiple times rapidly (pir, switch, and door - but not temp). I think the multiple click thing can be avoided by not querying these devices for in-out clusters etc and just set them to a predefined defaults. (The reason for this i think is that devices shut down soon after they consider pairing is done, and you need to wake it again repeatedly to receive the rest of the messages the js-lib is sending as part of its pairing process). The attribute reports should come automatically after pairing.

    For philips hue remote you bind the remote to one of the controller endpoints to receive commands.
    But for xiaomi switch (and other xiaomi devices) you just pair it, and the clicks are reported as attributes to the gateway/controller instead (much like the philips motion sensor, but you dont have to send anything to activate the reporting).

    Different firmware on the devices might affect things as well. Most of my devices has never been paired with the xiaomi hub and the firmware hasnt been updated ota)

    I´ll try writing a driver for homey this weekend and we´ll go from there. If it doesn´t work someone with both a xiaomi device and access to homey internals will probably be required. 


    @geir thanks for the feedback.
    Pairing the Xiaomi devices is indeed possible by clicking the zigbee button multiple times;

    I already setup an Zigbee based app and driver; see: https://github.com/TedTolboom/com.xiaomi-mi-zigbee
    See also my PM.
    Based on this driver it is possible to get the devices paired (with the rapid clicking technique)...
    but no reports were provided.

    I will update the app and driver this evening to SDK2 and new Zigbee meshdriver, post it as seperate branch and retry this evening.
  • @TedTolboom any updates? :)
  • @geir So you managed to include but also control your devices with shepherd? Would be helpfull to take a look at your code. @dENNtoet the changes where uploaded to TedTolboom 's repository under the SDK2 branch. @TedTolboom From the description in that repo it looks like those devices are working? Do you receive the reports now?
  • bvdbos said:
    @geir So you managed to include but also control your devices with shepherd? Would be helpfull to take a look at your code. @dENNtoet the changes where uploaded to TedTolboom 's repository under the SDK2 branch. @TedTolboom From the description in that repo it looks like those devices are working? Do you receive the reports now?
    @bvdbos SDK2 is indeed the leading branch.
    Status remains the same: able to include, but not able to get the reports. Will make that more clear in the readme
  • I managed to pair the new Xiaomi Aqara weather (temperature, pressure and humidity) sensor by adding an additional device driver to @TedTolboom his app...









  • I managed to pair the new Xiaomi Aqara weather (temperature, pressure and humidity) sensor by adding an additional device driver to @TedTolboom his app...









    Hi @Homey_Lampje interesting.... thanks for the feedback...

    The nice thing is that this version of the sensor it is possible to interview the endpoints, which shows the attributes (msTemperatureMeasurement)...

    Can you add your change (I assume based on the SDK2 branch) as a PR to the app?

    In particular I would like to check the driver you defined to understand the error shown above...

    what I've read about the Xiaomi's is that they don't support get commands but report by themselves...

    You don't happen to have a spare one; which I could check with the Zigbee sniffer....
  • TedTolboomTedTolboom Member
    edited September 2017
    Ordered a new set of Xiaomi Aqara sensors myself...
    was not aware that a new revision was available...
  • @Homey_Lampje can you contact me on Slack?
    To get it working, the Get trigger needs to be disabled and you'll need to add the msMeasureHumidity and msMeasurePressure report parsers manually (or add them to the library)...
  • I searched for these sensors; and found that indeed they are supported out of the box by SmartThings; I'll add the info found this weekend to the repo
  • @Homey_Lampje can you contact me on Slack?
    To get it working, the Get trigger needs to be disabled and you'll need to add the msMeasureHumidity and msMeasurePressure report parsers manually (or add them to the library)...

    @TedTolboom registered myself with Slack a few minutes ago...

    Yesterday I took a first look a the SDK2 branch, will give that another look today and see how far I can come. If I can help you with testing in anyway let me know.

    FYI I am not much of a programmer, stopped with professional programming many many years ago :-) 
  • There are also new versions of sensors

    Xiaomi Aqara Door Window Sensor
    Xiaomi Aqara Human Body Sensor
    Xiaomi Aqara Smart Wireless Switch Key
  • Sevift said:
    There are also new versions of sensors

    Xiaomi Aqara Door Window Sensor
    Xiaomi Aqara Human Body Sensor
    Xiaomi Aqara Smart Wireless Switch Key
    Have been ordered in the meantime; awaiting delivery  ;)
  • Hi,
    I bought the xiaomi mi magic controller, will arive soon. 
    https://m.gearbest.com/living-appliances/pp_364494.html
    Is it possible to intagrate this one too?
    I can help test it for you if you like. 
  • Hi all,

    I have the xiaomi Window & Door sensor as well as the body movement sensor.

    They work ok as long as you don't want to specify a time range in which they should trigger any action.

    First you can't specify a time range, only starting time till midnight, which I don't want (i.e. I may want to trigger an action overnight so I know if someone entered my home) but even worst, if I choose to set the 'Effective time period' this is using China time zone, so I can't not trigger anything when I want to.

    Even weirder is that log is 'mapped' to my mobile's time zone, but results notifications are using China TZ (as well as sensor behaviour).

    Do you know how to solve that?

    Other devices (like bulbs, plugs or vacuum cleaner) do actually use my mobile's time zone correctly.

    Thanks!
  • MecallieMecallie Member
    edited September 2017
    Hi folks,

    I just bought www.aliexpress.com/item/Xiaomi-Mijia-Honeywell-Fire-Alarm-Detector-Aqara-Zigbee-Remote-Control-Audible-And-Visual-Alarm-Notication-Work/32802657659.html this smoke detector with the hope it will eventually work with Homey. It is in corporation with Honeywell, which makes me think the quality must be good!

    I will keep following this thread to see how everything evolves. I am no programmer, but I am willing to help in any other way I can. Either by testing or sending in devices so they can be tested :)

    Thanks for all your effort so far!
  • Mecallie said:
    Hi folks,

    I just bought [url=www.aliexpress.com/item/Xiaomi-Mijia-Honeywell-Fire-Alarm-Detector-Aqara-Zigbee-Remote-Control-Audible-And-Visual-Alarm-Notication-Work/32802657659.html]this smoke detector[/url] with the hope it will eventually work with Homey. It is in corporation with Honeywell, which makes me think the quality must be good!

    I will keep following this thread to see how everything evolves. I am no programmer, but I am willing to help in any other way I can. Either by testing or sending in devices so they can be tested :)

    Thanks for all your effort so far!
    Did you already receive the smoke sensor, because i'm wondering if it is indeed from the Aqare range. If so, could you please pair it with Homey and share the device info from within the device settings in the gui?
  • Mecallie said:
    Hi folks,

    I just bought [url=www.aliexpress.com/item/Xiaomi-Mijia-Honeywell-Fire-Alarm-Detector-Aqara-Zigbee-Remote-Control-Audible-And-Visual-Alarm-Notication-Work/32802657659.html]this smoke detector[/url] with the hope it will eventually work with Homey. It is in corporation with Honeywell, which makes me think the quality must be good!

    I will keep following this thread to see how everything evolves. I am no programmer, but I am willing to help in any other way I can. Either by testing or sending in devices so they can be tested :)

    Thanks for all your effort so far!
    Did you already receive the smoke sensor, because i'm wondering if it is indeed from the Aqare range. If so, could you please pair it with Homey and share the device info from within the device settings in the gui?
    No, I have just ordered it. I will share the device info as soon as I receive the device!
  • Top, want to compare it with the one i received.
  • I have both versions of the Aqara 2-button Wall switches, (in combination with the xiaomi gateway, and other xiaomi sensors) if i can be of any assistance with information about these let me know.
This discussion has been closed.