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

Add support for other devices using the same protocol #17

Closed
alexdom opened this issue Jun 18, 2017 · 7 comments
Closed

Add support for other devices using the same protocol #17

alexdom opened this issue Jun 18, 2017 · 7 comments

Comments

@alexdom
Copy link

alexdom commented Jun 18, 2017

I have tree Xiaomi Air Purifier 2. Would like to control them from Raspberry Pi and iPad Mi app at the same time? Can I control Xiaomi Air Purifier 2 using mirobo ?

@rytilahti
Copy link
Owner

There is no support for air purifier at the moment, although I'm open for patches. I recently refactored the codebase a bit to allow easier support for other devices.

@alexdom
Copy link
Author

alexdom commented Jun 22, 2017

Tanks for update! Will be anxiously waiting for it..

@rytilahti rytilahti changed the title Can I use _mirobo_ with Xiaomi Air Purifier 2? Add support for other devices using the same protocol Jun 22, 2017
@cnberg
Copy link

cnberg commented Jun 28, 2017

Try python-miio. @alexdom

@marcelrv
Copy link

marcelrv commented Aug 1, 2017

I recently found a good way to identify what device type is applicable.
You can send a miIO.info command and it will return the device type. e.g. vacuum responds with "model":"rockrobo.vacuum.v1"
I think that is much better approach than using the current map of device ID's.

https://github.com/marcelrv/XiaomiRobotVacuumProtocol/blob/master/miIOinfo.md

@rytilahti
Copy link
Owner

rytilahti commented Aug 1, 2017

Thanks @marcelrv, I was aware of that command for some time (edit: looks like thanks to your repository actually! :-) but did not push it as it was returning empty bytes sometimes (maybe some error condition? it was odd though). Anyway, 5af95d1 introduces the 'info' command which displays some parts of that. The model information is not so useful for generic discovering of devices as it only works when the token is set, if I'm not mistaken?

@syssi
Copy link
Collaborator

syssi commented Aug 5, 2017

Another device with the same protocol called "Xiaomi philips LED ball" (9290012800, 450lm, 3000K-5700K, 6.5W, E27).

$ ./mirobo --ip 192.168.130.58 --token 6f3cxxxxxxxxxxxxxxxxxxxxxxxx3790 -d info 
INFO:mirobo.vacuum_cli:Debug mode active
DEBUG:mirobo.vacuum_cli:Read stored sequence ids: {'manual_seq': 0, 'seq': 1}
DEBUG:mirobo.vacuum_cli:Connecting to 192.168.130.58 with token 6f3xxxxxxxxxxxxxxxxxxxxxxxx13790
DEBUG:mirobo.protocol:Unable to decrypt, returning raw bytes.
DEBUG:mirobo.device:Discovered 926 2690 with ts: 1970-01-01 00:06:52
DEBUG:mirobo.device:192.168.130.58:54321 >>: {'id': 2, 'method': 'miIO.info', 'params': []}
DEBUG:mirobo.device:192.168.130.58:54321 (ts: 1970-01-01 00:06:52, id: 2) << {'id': 2, 'result': {'fw_ver': '1.3.0_0032', 'token': '6f3cxxxxxxxxxxxxxxxxxxxxxxxx3790', 'hw_ver': 'ESP8266', 'model': 'philips.light.bulb', 'life': 412, 'ap': {'rssi': -61, 'bssid': 'C0:25:06:A8:9A:5E', 'ssid': 'Greendale'}, 'mac': '34:CE:FF:FF:FF:FF', 'wifi_fw_ver': '1.5.0-dev(7f7a714)', 'mmfree': 5744, 'netif': {'gw': '192.168.130.1', 'mask': '255.255.255.0', 'localIp': '192.168.130.58'}}}
philips.light.bulb v1.3.0_0032 (34:CE:FF:FF:FF:FF) @ 192.168.130.58 - token: 6f3cxxxxxxxxxxxxxxxxxxxxxxxx3790
DEBUG:mirobo.vacuum_cli:Full response: {'ap': {'bssid': 'C0:25:06:A8:9A:5E', 'rssi': -61, 'ssid': 'Greendale'},
 'fw_ver': '1.3.0_0032',
 'hw_ver': 'ESP8266',
 'life': 412,
 'mac': '34:CE:FF:FF:FF:FF',
 'mmfree': 5744,
 'model': 'philips.light.bulb',
 'netif': {'gw': '192.168.130.1',
           'localIp': '192.168.130.58',
           'mask': '255.255.255.0'},
 'token': '6f3cxxxxxxxxxxxxxxxxxxxxxxxx3790',
 'wifi_fw_ver': '1.5.0-dev(7f7a714)'}

Turning it on and off works fine. I will try to control brightness and color temperature asap.

@rytilahti
Copy link
Owner

Support for purifier was added in #31, furthermore other devices have been added in their respective PRs. IMO this task can be closed, and more specific issues (or directly PRs with implementation) can be opened for unsupported devices.

Thanks everyone for your input :-)

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

5 participants