{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/smarthome/issues/5880","repository_url":"https://api.github.com/repos/eclipse/smarthome","labels_url":"https://api.github.com/repos/eclipse/smarthome/issues/5880/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/smarthome/issues/5880/comments","events_url":"https://api.github.com/repos/eclipse/smarthome/issues/5880/events","html_url":"https://github.com/eclipse/smarthome/pull/5880","id":339396876,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwMDU5Mzcw","number":5880,"title":"MQTT Things (with Homie 3.x and HomeAssistant thing discovery)","user":{"login":"davidgraeff","id":66436,"node_id":"MDQ6VXNlcjY2NDM2","avatar_url":"https://avatars2.githubusercontent.com/u/66436?v=4","gravatar_id":"","url":"https://api.github.com/users/davidgraeff","html_url":"https://github.com/davidgraeff","followers_url":"https://api.github.com/users/davidgraeff/followers","following_url":"https://api.github.com/users/davidgraeff/following{/other_user}","gists_url":"https://api.github.com/users/davidgraeff/gists{/gist_id}","starred_url":"https://api.github.com/users/davidgraeff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidgraeff/subscriptions","organizations_url":"https://api.github.com/users/davidgraeff/orgs","repos_url":"https://api.github.com/users/davidgraeff/repos","events_url":"https://api.github.com/users/davidgraeff/events{/privacy}","received_events_url":"https://api.github.com/users/davidgraeff/received_events","type":"User","site_admin":false},"labels":[{"id":921540941,"node_id":"MDU6TGFiZWw5MjE1NDA5NDE=","url":"https://api.github.com/repos/eclipse/smarthome/labels/Binding-MQTT","name":"Binding-MQTT","color":"048a8e","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":27,"created_at":"2018-07-09T10:42:03Z","updated_at":"2018-10-01T12:01:44Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/eclipse/smarthome/pulls/5880","html_url":"https://github.com/eclipse/smarthome/pull/5880","diff_url":"https://github.com/eclipse/smarthome/pull/5880.diff","patch_url":"https://github.com/eclipse/smarthome/pull/5880.patch"},"body":"This is a friendly re-take over of #5101, originally #3876 with changes from @sjka:\r\n\r\n* incorporate (my...) review feedback (see #3876 (review))\r\n* update the license headers\r\n* adaptation to mockito 2\r\n* adding the binding to the docu structure\r\n* Eclipse & Karaf features\r\n\r\n## Abstract\r\nAt this very moment there exist no means to actually connect mqtt topics to ESH things. Specialized bindings for all those commercial MQTT products out there makes sense. \r\n\r\nBut for a start this PR provides a simple generic MQTT topics to thing/channel mapping. \r\n\r\n## Define Generic MQTT Things with unlimited custom channels\r\n\r\n* Use bridges of the main MQTT bundle (broker connections).\r\n* Manually add a thing and an arbitrary number of channels (Text, Number, OnOff, Color, Dimmer) and bind those to MQTT states and/or command topic.\r\n* Allow to use a transformation pattern to extract a state from a formatted response like JSON. An example would be the pattern `JSONPATH:$.device.status.temperature` for an incoming message of `{device: {status: { temperature: 23.2 }}}`.\r\n* The number as well as dimmer channel can have a configured min, max and step.\r\n* The OnOff channel takes a configuration for the ON and OFF state. Some people use \"1\" and \"0\", some \"true\" and \"false\", we support all variants.\r\n\r\n### Channels\r\n\r\n* TextChannel: String\r\n* NumberChannel: Number, Rollershutter, Dimmer\r\n* OnOffChannel: Contact, Switch\r\n* ColorChannel: Color\r\n\r\n## MQTT Device and Thing discovery\r\n\r\nIf MQTT topics would follow a convention, auto discovery would be possible. Fortunately, there are some MQTT conventions appearing now. This binding supports two.\r\n\r\n### Homie 3.x convention\r\nThis convention only defines the topic layout and where to find meta data. With the help of attribute helper topics \"devices\", \"nodes\" and \"properties\" are described.\r\n\r\n* A \"device\" is translated into an ESH Thing\r\n* A \"node\" is translated into an ESH Channel Group\r\n* A \"property\" is translated into an ESH Channel\r\n\r\nLimitations:\r\n\r\n* I'm not too keen to support node instances at that moment in time. The specification is not entirely clear to me in this regard.\r\n* Some attributes like the `localip` or `mac` attribute do not make sense in the standard and will not be used or required from peer devices.\r\n\r\n### HomeAssistant MQTT components\r\n\r\nAlthough this convention is not fully thought trough, it is quite common in the IoT scene.\r\nThe convention describes full \"components\", like a Light, a Fan, a Switch and so on. Each component can consist of multiple channels, the fan for example has a on/off switch, an oscillation channel, a speed channel and so on. A Component belongs to a specific \"object\"-\"node\" instance.\r\n\r\n* A \"object\"+\"node\" is translated into an ESH Thing\r\n* A \"component\" is translated into an ESH Channel Group\r\n* A \"component channel\" is translated into an ESH Channel\r\n\r\n## Full implementation test\r\n\r\nA full in-deep implementation test is part of this PR. The embedded broker is started and a fake homie MQTT device and homeassistant MQTT component is created. Almost all code paths of this PR (except the generic thing handler class), the MQTT service and the embedded broker service are tested by requesting and modifying the homie attribute and node hierarchy or the homeassistant MQTT component channel state.\r\n\r\nCheers,\r\nDavid"},"comment":{"url":"https://api.github.com/repos/eclipse/smarthome/issues/comments/425882383","html_url":"https://github.com/eclipse/smarthome/pull/5880#issuecomment-425882383","issue_url":"https://api.github.com/repos/eclipse/smarthome/issues/5880","id":425882383,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTg4MjM4Mw==","user":{"login":"davidgraeff","id":66436,"node_id":"MDQ6VXNlcjY2NDM2","avatar_url":"https://avatars2.githubusercontent.com/u/66436?v=4","gravatar_id":"","url":"https://api.github.com/users/davidgraeff","html_url":"https://github.com/davidgraeff","followers_url":"https://api.github.com/users/davidgraeff/followers","following_url":"https://api.github.com/users/davidgraeff/following{/other_user}","gists_url":"https://api.github.com/users/davidgraeff/gists{/gist_id}","starred_url":"https://api.github.com/users/davidgraeff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidgraeff/subscriptions","organizations_url":"https://api.github.com/users/davidgraeff/orgs","repos_url":"https://api.github.com/users/davidgraeff/repos","events_url":"https://api.github.com/users/davidgraeff/events{/privacy}","received_events_url":"https://api.github.com/users/davidgraeff/received_events","type":"User","site_admin":false},"created_at":"2018-10-01T12:01:44Z","updated_at":"2018-10-01T12:01:44Z","author_association":"CONTRIBUTOR","body":"@htreu, @kaikreuzer I must have been blind, you are right, the error message even mentioned the mqtt package. I have added it as dependency and travis agrees now.\r\n\r\nAlso feature complete is my MQTT feature text:\r\nhttps://gist.github.com/davidgraeff/6c00d2ad5e4bc553f5f209118307d8fd\r\n\r\nComplete in the sense that it will not grow considerably anymore as I thing I have covered all bits and pieces. I still want refine some text passages and add missing images. Because nobody complained about the overall structure, I guess that is fine. But if you have any comments on the content, please let me know."}}
{"actor":{"display_login":"davidgraeff"}}