{"action":"created","issue":{"url":"https://api.github.com/repos/marvinroger/homie-esp8266/issues/236","repository_url":"https://api.github.com/repos/marvinroger/homie-esp8266","labels_url":"https://api.github.com/repos/marvinroger/homie-esp8266/issues/236/labels{/name}","comments_url":"https://api.github.com/repos/marvinroger/homie-esp8266/issues/236/comments","events_url":"https://api.github.com/repos/marvinroger/homie-esp8266/issues/236/events","html_url":"https://github.com/marvinroger/homie-esp8266/issues/236","id":191013253,"number":236,"title":"Does homie-esp8266 allow two devices to discuss directly?","user":{"login":"sheda","id":1361088,"avatar_url":"https://avatars.githubusercontent.com/u/1361088?v=3","gravatar_id":"","url":"https://api.github.com/users/sheda","html_url":"https://github.com/sheda","followers_url":"https://api.github.com/users/sheda/followers","following_url":"https://api.github.com/users/sheda/following{/other_user}","gists_url":"https://api.github.com/users/sheda/gists{/gist_id}","starred_url":"https://api.github.com/users/sheda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sheda/subscriptions","organizations_url":"https://api.github.com/users/sheda/orgs","repos_url":"https://api.github.com/users/sheda/repos","events_url":"https://api.github.com/users/sheda/events{/privacy}","received_events_url":"https://api.github.com/users/sheda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-11-22T13:54:44Z","updated_at":"2016-11-24T05:19:07Z","closed_at":null,"body":"Hi there,\r\n\r\nFirst congrats for your impressive work!\r\n\r\nI would like to know if there is a way to make two devices to discuss directly with each other with only a MQTT broker. And without any third party MQTT-Client that would forward message published on one homie-device topic to the other homie-device topic.\r\n\r\nAn example may be be more explicit:\r\nI would like a homie light-device to be switched on by a homie switch-device . \r\n\r\nRoot subscription/publication on those device would be:\r\n- On switch-device side:\r\n1 MQTT publication on /homie/switch-device/switch/state -> true (possible with homie-esp8266)\r\n\r\n- On light-device side:\r\n1 MQTT subscription on /homie/switch-device/switch/state (not possible with homie-esp8266, due to API adding brand/device-id/ automatically )\r\n1 MQTT subscription on /homie/light-device/light/on/set (possible with homie-esp8266)\r\n1 MQTT publication on /homie/light-device/light/on (possible with homie-esp8266)\r\n\r\nI am currently using the v1.5, but it seems that two workarounds are possible with the v2, so I'll move on it:\r\n1- on v2, I saw that you recently added the broadcast channel: But I don't think this feature is designed for this kind of precise and device-to-device communication. In addtion it would wake up every device sleeping while message is obviouly useless for them..\r\n\r\n2- on v2, I saw on issues tracking that you added recently access to MQTT clients directly (AsyncMqttClient& getMqttClient();) and also added several callback addition for OnMessage()/OnSuscribe() on AsyncMqttClient lib.\r\nSo it would be possible to add a callback \"onSwitchedSwitch\" called on topic  \"/homie/switch-device/switch/state\" change. (To Note that I think this doesn't really break the \"Homie Convention\")\r\n\r\nWhy does this device-to-device channel need to be a workaround instead of having an public method that would allow a device to subscribe to another device topic?\r\n\r\nIf you have question or if I was unclear please let me know...\r\n\r\nThanks a lot,\r\nSheda \r\n\r\nUPDATE: precise using of Broker, and precise not using third party MQTT-Client taht would serve as topic forward\r\n\r\nBefore submitting your issue, make sure:\r\n\r\n- [X] You're using a [stable release](https://github.com/marvinroger/homie-esp8266/releases), not the Git development version which is, by definition, unstable\r\n- [X] You've read the documentation for *your* release, which is in the `docs/` folder of the `.zip` of the release you're using, especially the **Getting started** and **Troubleshooting** pages, which contain respectively the minimum required version of the dependencies, and some answsers to the most common problems\r\n- [X] You're using the examples bundled in *your* release, which are in the `examples/` folder of the `.zip` of the release you're using. Examples in the latest git revision might not be backward-compatible with your release\r\n\r\nThanks!\r\n"},"comment":{"url":"https://api.github.com/repos/marvinroger/homie-esp8266/issues/comments/262692340","html_url":"https://github.com/marvinroger/homie-esp8266/issues/236#issuecomment-262692340","issue_url":"https://api.github.com/repos/marvinroger/homie-esp8266/issues/236","id":262692340,"user":{"login":"n8twj","id":5016817,"avatar_url":"https://avatars.githubusercontent.com/u/5016817?v=3","gravatar_id":"","url":"https://api.github.com/users/n8twj","html_url":"https://github.com/n8twj","followers_url":"https://api.github.com/users/n8twj/followers","following_url":"https://api.github.com/users/n8twj/following{/other_user}","gists_url":"https://api.github.com/users/n8twj/gists{/gist_id}","starred_url":"https://api.github.com/users/n8twj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n8twj/subscriptions","organizations_url":"https://api.github.com/users/n8twj/orgs","repos_url":"https://api.github.com/users/n8twj/repos","events_url":"https://api.github.com/users/n8twj/events{/privacy}","received_events_url":"https://api.github.com/users/n8twj/received_events","type":"User","site_admin":false},"created_at":"2016-11-24T05:19:07Z","updated_at":"2016-11-24T05:19:07Z","body":"Hi Sheda -  Are you attempting to do something like this:\nhttps://github.com/n8twj/Homie-OLED/blob/master/Homie-OLED.ino  [does not\nwork as expected]\n\nFrom my quick scan of the code, it seems Homie does make a call to the\nonMessage function from the Async MQTT library.\nhttps://github.com/marvinroger/homie-esp8266/blob/develop/src/Homie/Boot/BootNormal.cpp#L659\n\nMy elementary guess would be that the HomieEvent type needs to be expanded\nto send [unhandled?] mqtt messages to the invoking application for further\nprocessing.\n\n\n\n\n\n\n\nOn Wed, Nov 23, 2016 at 12:31 PM, Sheda <notifications@github.com> wrote:\n\n> perhaps I am missing something but this implementation of \"Homie\n> convention\" on arduino (homie-esp8266) do *not* allows to\n> suscribe/publish to another homie-device due to the fact the library add\n> automatically \"brand\" and our own \"device-id\" when suscribing/publishing\n> from a device.\n>\n> I am not sure but I think homie-devices suscribing to one anothers topics\n> don't break the Homie convention compliance? So its more an issue of the\n> homie-esp8266 library?\n>\n> —\n> You are receiving this because you commented.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/marvinroger/homie-esp8266/issues/236#issuecomment-262581115>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AEyM8bjUMwkNEfgMZzGjeYcS_Nw6Br_gks5rBHiPgaJpZM4K5djD>\n> .\n>\n"}}
{"actor":{"display_login":"n8twj"}}