Comments (4)
Thanks for your report! This is because the current version only uses a lookup of a hostname to determine the model of a device. When it actually connects to the device (as --discover does) it sees that is a gateway and that automatically discovers the subdevices.
I'm currently thinking about a new way to determine the model and tracking the progress in #27.
from miio.
Thanks for your reply. In order to help you figure out the best way to discover gateway, I'd like to share what I found:
https://github.com/louisZL/lumi-gateway-local-api
It is not a code repository but a document one. There are many .md files written in Chinese but I believe you can use google translation. The repository seems to have all of detail in regard to gateway and I wish it would help you.
In regard to gateway discovery, maybe you can use heartbeat message which is sent by gateway repeatedly(perhaps every 10 seconds) like the following:
{"cmd":"heartbeat","model":"gateway","sid":"286c078911ea","short_id":"0","token":"BaY3p3mZ90Jszl3O","data":"{"ip":"192.168.31.207"}"}
It does't say gateway 2 or 3 but at least it says "I'm gateway" and ip address too. The packet is sent from 4321 port of gateway to 9898 of 224.0.0.50 via udp multicast when local communication mode is on.
from miio.
Thanks, that's a good resource and is how support for the gateway is currently implemented.
The gateway version is determined by the model info, and based on the inspect you posted it looks like you have the 3rd version.
from miio.
Version 0.15.x has implemented better support for discovery the model of a device. Hopefully this will have resolved this issue.
from miio.
Related Issues (20)
- Not enough non-option arguments: got 0, need at least 1 error Command failed with exit code 1.
- Xiaomi Air Monitor cgllc.airm.cgdn1
- yeelight strip plus is supported?
- Canβt find Hub / Temperature-Sensors
- yeelink.light.color5 HOT 1
- Mi Smart LED Bulb (B22) - Support
- yeelink.light.mono6 HOT 1
- [add device request] yeelink.light.ceilb
- [add device request] yeelink.light.colorb
- -Bash: miio: command not found HOT 1
- doesn't work on Firmware version: 3.2.10
- Cannot connect to light after configuring wireless network HOT 1
- yeelink.light.bslamp2 HOT 2
- Create device with lib version >= 0.15.0
- Which devices can get tokens by "miio discover" or "mirobo discover --handshake 1"?
- Does this packge still getting maintained?
- Roborock S6 - 3.5.8._2902 - unsupported device
- colorTemperature2rgbUsingTH is not defined
- Device support [Vacum mop 2 ultra]
- Error connecting to device: Error: Call to device timed out
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miio.