Giter Club home page Giter Club logo

Comments (4)

aholstenson avatar aholstenson commented on August 14, 2024

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.

pointbre avatar pointbre commented on August 14, 2024

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.

aholstenson avatar aholstenson commented on August 14, 2024

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.

aholstenson avatar aholstenson commented on August 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.