Giter VIP home page Giter VIP logo

Comments (6)

marvinroger avatar marvinroger commented on May 24, 2024

Finally there is no need to: the device already advertise itself through the MQTT. So this would be a complete waste of resources.

from homie-esp8266.

rigorm avatar rigorm commented on May 24, 2024

Actually, I would put this one on hold.. devices are advertised on the MQTT but i'm not sure that they will be discovered as such. finding this via wifi would make it more effective.. MQTT is more of a transport method.. understand what i mean ? ;)

from homie-esp8266.

marvinroger avatar marvinroger commented on May 24, 2024

Memory is precious, this is a waste of resources. Let me explain: if we make devices discoverable via mDNS, you can detect there is a device connected to the network and it's IP. Great. Then what? If you want to get other information about the device, or interact with it, you need to do it via MQTT anyway.

So simply, just subscribe to devices/+/$online, check if it equals to true and if yes, apply the regex ^devices\/([a-z0-9-]+)\/\$online$ to the topic, so you have the device ID in $1 and you've just discovered all Homie devices. 😄

from homie-esp8266.

rigorm avatar rigorm commented on May 24, 2024

I agree on that point.. (did not know about the + un a MQTT subscribe string).
I was looking into binding making on openhab2 and looks like you need predefined "things" switch, sensors, relay etc.. So i'm so sure this would be a good thing for your framework as you "thing" can virtually be anything a use defines.

Bottom line, this stays closed :)

from homie-esp8266.

qtronik avatar qtronik commented on May 24, 2024

Wow! Should put this trick in the readme file!

from homie-esp8266.

marvinroger avatar marvinroger commented on May 24, 2024

Good point! But where? In the Homie convention, or in the docs of this repo?

from homie-esp8266.

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.