Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could you pls add support to gateway's functions of security and light? #340

Closed
xcray opened this issue Jun 17, 2018 · 4 comments
Closed

Comments

@xcray
Copy link

xcray commented Jun 17, 2018

As we know that the LAN API doesn't support controlling of the gw's security function (arming on/off, arming_wait_time) while miio interface does, so I think it's proper to use HA to control the security function, we need your help on python-miio codes.
There is a plugin of homebridge, homebridge-mi-gateway-security for same function, maybe could been taken as reference.
About the gateway's light, although HA can control it via the LAN API (xiaomi_aqara), but there is a problem that the official Mijia App will lost control of the light (the issue). Since miio interface can also interact with the light function of gw, I guess it could be a better choice.

Anyway, thanks very much for your cool repository!

@syssi
Copy link
Collaborator

syssi commented Jun 17, 2018

You are very fast and clever. :-) I'm aware of the miIO arming methods (cp. #295) of the gateway and it will be part of python-miio some day. I don't want to integrate this feature into the xiaomi_aqara component of HA because of the mix of two libraries (protocols/APIs). Furthermore it would be hard to explain why two security tokens (the LAN protocol key and the miIO token) are required. I recommend to build an alarm automation at HA and try to avoid MiHome / Xiaomi Cloud automations.

@rytilahti
Copy link
Owner

rytilahti commented Jun 17, 2018

I have a list of potential commands and a barebone support for the gatway, but the effort to add a proper support would be quite large (currently counting 73 available commands, no idea if and h ow all of them work..). If someone wants to work on it I may find some time to put it all into a somewhat readable state, however, as @syssi said, I would not be expecting this to get used by the HA at any point due to duplication of functionality and therefore it is not really a priority.

@syssi
Copy link
Collaborator

syssi commented Jun 17, 2018

@xcray Take a look at my custom_component: https://github.com/syssi/xiaomi_raw/

It provides a switch platform (switch.xiaomi_raw_miio) which can be used to switch/toggle individual methods of the MiIO API. It should be possible to control the alarm and the light.

@xcray
Copy link
Author

xcray commented Jun 17, 2018

@syssi @rytilahti Thanks for your comments. Anyhow, it's my honor to having received your replies!
Just for now, I don't think it's a good idea to completely get rid of official app and cloud.
In my opinion, HA's capability to control the arming mode of xiaomi gateway is necessary, especially for the scene all of my family are out of home.
I'll try your custom component on my host, so this issue could be closed.
Thanks again for your cool codes!

@xcray xcray closed this as completed Jun 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants