{"action":"created","issue":{"url":"https://api.github.com/repos/marvinroger/homie-esp8266/issues/306","repository_url":"https://api.github.com/repos/marvinroger/homie-esp8266","labels_url":"https://api.github.com/repos/marvinroger/homie-esp8266/issues/306/labels{/name}","comments_url":"https://api.github.com/repos/marvinroger/homie-esp8266/issues/306/comments","events_url":"https://api.github.com/repos/marvinroger/homie-esp8266/issues/306/events","html_url":"https://github.com/marvinroger/homie-esp8266/issues/306","id":210246429,"number":306,"title":"Compatibility with Home Assistant MQTT Discovery","user":{"login":"jasonmhite","id":868722,"avatar_url":"https://avatars1.githubusercontent.com/u/868722?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonmhite","html_url":"https://github.com/jasonmhite","followers_url":"https://api.github.com/users/jasonmhite/followers","following_url":"https://api.github.com/users/jasonmhite/following{/other_user}","gists_url":"https://api.github.com/users/jasonmhite/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonmhite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonmhite/subscriptions","organizations_url":"https://api.github.com/users/jasonmhite/orgs","repos_url":"https://api.github.com/users/jasonmhite/repos","events_url":"https://api.github.com/users/jasonmhite/events{/privacy}","received_events_url":"https://api.github.com/users/jasonmhite/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":24,"created_at":"2017-02-25T16:53:42Z","updated_at":"2018-02-27T09:35:37Z","closed_at":null,"author_association":"NONE","body":"So Homie already works great with [Home Assistant](https://home-assistant.io). Just recently, they added the ability to automatically [discover devices over MQTT](https://home-assistant.io/docs/mqtt/discovery/). Unfortunately it isn't really compatible with the Homie convention for advertising features, though it's not far off.\r\n\r\nI'm opening this because I want to implement compatibility to let HA automatically discover Homie devices. What do you think would be the best approach? I can see a bunch of ways to go about it.\r\n\r\n1. Modify Homie's current reporting to be compatible\r\n2. Modify HA's convention to be compatible\r\n3. Make a custom HA plugin to extend the discovery to the Homie convention\r\n4. Add a special extra feature to Homie that also lets you advertise features to HA that you can enable in addition to the current functionality\r\n5. Make a separate library that basically does the same as item 4\r\n6. Make a standalone bridge daemon that reads the MQTT channel for Homie devices and rebroadcasts them in HA's convention\r\n\r\n1-2 are probably too invasive and will break stuff. 3 is a decent idea but it's a lot of work. 4-5 seem like the best choices to me. 6 is probably the easiest, but also the ugliest.\r\n\r\nSo before I start working on this, what are your preferences?"},"comment":{"url":"https://api.github.com/repos/marvinroger/homie-esp8266/issues/comments/368808255","html_url":"https://github.com/marvinroger/homie-esp8266/issues/306#issuecomment-368808255","issue_url":"https://api.github.com/repos/marvinroger/homie-esp8266/issues/306","id":368808255,"user":{"login":"nerdfirefighter","id":29542626,"avatar_url":"https://avatars2.githubusercontent.com/u/29542626?v=4","gravatar_id":"","url":"https://api.github.com/users/nerdfirefighter","html_url":"https://github.com/nerdfirefighter","followers_url":"https://api.github.com/users/nerdfirefighter/followers","following_url":"https://api.github.com/users/nerdfirefighter/following{/other_user}","gists_url":"https://api.github.com/users/nerdfirefighter/gists{/gist_id}","starred_url":"https://api.github.com/users/nerdfirefighter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nerdfirefighter/subscriptions","organizations_url":"https://api.github.com/users/nerdfirefighter/orgs","repos_url":"https://api.github.com/users/nerdfirefighter/repos","events_url":"https://api.github.com/users/nerdfirefighter/events{/privacy}","received_events_url":"https://api.github.com/users/nerdfirefighter/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T09:35:37Z","updated_at":"2018-02-27T09:35:37Z","author_association":"NONE","body":"@timpur agree this needs to be a component. Its only pre req will be the mqtt component. the other option should be to do it as a platform for mqtt. which might make more sense given it has a direct relationship to the mqtt. the homie device would be its own component. lots of ways to do this. \r\nglade the code was useful. \r\n\r\nWhen would we be able to get the 2.1 framework in to the esp8266 code? that would be really useful for this work and make it much easier when migrating to V3.\r\nMy opinion is that we should try and mirror 2.1 of the frame work as best we can then work backwards to 2.0 for a couple of reasons. 1. is that there are a number of topics we can define by using \".setProperty(\"$unit\").send(\"c\");\" to mimic/code define parts of the 2.1 framework with out it being built directly in the code base. 2. the 2.0 framework is getting a little old 3. there are just so many things that are not defined in 2.0 and discovery/mapping really requires structure that can be mapped to. \r\n\r\nAre we best to have the repo for this next to the Homie framework and this repo?\r\nWhere ever it is i suggest we only have the code related to plugin in it and then have a different repo for it being merged with the HA code base. I have the repo https://github.com/nerdfirefighter/home-assistant which is where i was going to develop it if we dont want to have it next to the Homie.\r\n\r\nthe way i see it is we will have a number of definition dictionaries that will provide mapping between node types and layouts/displays we might use. there are a couple of simple ones i would start with which is switch and sensor. \r\nI can see the $state or $online topics being used as the CONF_AVAILABILITY_TOPIC saying if the device is available. \r\nA lot of the mappings are easy for topics. \r\n\r\nI also agree and intend that the code will break down in to a number of functions and classes including most likely a singleton or similar for the topic/message dictionary. \r\n\r\nWill start laying the base of these designs in the repo i used for the hacked together code over the next few days. "}}
{"actor":{"display_login":"nerdfirefighter"}}