mihome
mihome copied to clipboard
Install process
Hello,
First of all: The project looks very nice and I would be glad to help on that! :)
Could you give us more info about how to install it ? What is the multicast IP address ? how is it related to the xiaomi hub? Is your project abble to detect push (like on a motion detection) or is it a polling process (like every minute) ? Does it need acces to internet (in order to contact xiaomi server) or does it contact directly the hub?
Thanks!
Hi Antoine,
Sorry for the lacking details. I will make a better documentation when I get time :) (you are of course welcome to help on that ! push requests are more than welcome)
You can find my notes here : https://notes.jmsinfor.com/blog/post/admin/Xiaomi-Hub
You have to activate the developer mode (there is a link to the exact page in chinese on how to do it, it's an "easter egg" in the app). You have to use a recent firmware on your xiaomi hub to have this option. Then, the hub broadcasts on the local lan the incoming packets (push) as well as its own ip once in a while on a fixed broadcast multicast IP (included in the source, hardcoded).
So no need for internet, only local.
On the code available on this github the client does discovery once it gets the heartbeat of a new gateway, and reads from the sensor. You can also request a manual read more often to get the current status of a sensor (useful for temp&humi sensors that are a bit too far away from the gateway, as they push less than the others, don't ask me why).
Basically, you just give a callback function (used to broadcast mqtt messages in my examples), and call the read function often.
Future plans (if you want to help on this) :
- Use asyncio async/await
- Make some clients :
- mqtt broadcaster (properly packaged, why set too for aqara switches for example, I will receive some soon I hope)
- home assistant module
- etc.
- Documentation
- Unit tests
Jonathan
On Mon, Nov 21, 2016 at 2:40 PM, WEBER Antoine [email protected] wrote:
Hello,
First of all: The project looks very nice and I would be glad to help on that! :)
Could you give us more info about how to install it ? What is the multicast IP address ? how is it related to the xiaomi hub? Is your project abble to detect push (like on a motion detection) or is it a polling process (like every minute) ? Does it need acces to internet (in order to contact xiaomi server) or does it contact directly the hub?
Thanks!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jon1012/mihome/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AABe-pK7VeQ3BWM9HPn4CKDGwVh-az5qks5rAZ8zgaJpZM4K4Nho .
So cool! I wasn't aware of the new broadcasting thing!
I will try that on my installation and most certainly will PR my work on it asap :)
And do we have access to something to "command" the devices? lets says I want to turn ON a light or smething like that?
Right now there is the request_current_status to get the current status of a device, but no way to control it in my current api. Control can be done using the developer mode, but I haven't implemented it yet.
You can have a look at this repo for a js implementation for homebridge : https://github.com/snOOrz/homebridge-aqara
On Mon, Nov 21, 2016 at 2:56 PM, WEBER Antoine [email protected] wrote:
So cool! I wasn't aware of the new broadcasting thing!
I will try that on my installation and most certainly will PR my work on it asap :)
And do we have access to something to "command" the devices? lets says I want to turn ON a light or smething like that?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jon1012/mihome/issues/1#issuecomment-261944556, or mute the thread https://github.com/notifications/unsubscribe-auth/AABe-kQEGzy8WDoZ3Aw_NWMcUTdnifM7ks5rAaL3gaJpZM4K4Nho .
[delete]It will be great if you will implement device-control (write) in future =)[/delete] I have implemented it, https://github.com/monster1025/aqara-mqtt