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

Advertise device through mDNS and DNS-SD #55

Closed
marvinroger opened this issue Apr 3, 2016 · 6 comments
Closed

Advertise device through mDNS and DNS-SD #55

marvinroger opened this issue Apr 3, 2016 · 6 comments

Comments

@marvinroger
Copy link
Member

No description provided.

@marvinroger marvinroger added this to the v2.0.0 milestone Apr 3, 2016
@marvinroger
Copy link
Member Author

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

@marvinroger marvinroger removed this from the v2.0.0 milestone Apr 19, 2016
@rigorm
Copy link

rigorm commented Apr 19, 2016

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 ? ;)

@marvinroger
Copy link
Member Author

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. 😄

@rigorm
Copy link

rigorm commented Apr 20, 2016

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 :)

@qtronik
Copy link

qtronik commented Apr 23, 2016

Wow! Should put this trick in the readme file!

@marvinroger
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants