-
Notifications
You must be signed in to change notification settings - Fork 781
Mqtt generic things and Homie 3.x things #5450
Conversation
5004d43
to
ccd14d5
Compare
Your daily Travis report ;-)
|
That is expected. The bridges of the mqtt bundle #3839 are used |
@davidgraeff: #3839 is merged, you may proceed here. |
@davidgraeff I would strongly advice NOT to put homie stuff into the |
Sorry - I just noticed that I confused "homie" with "homee" - so as "homie" is a generic protocol for MQTT IoT integration, it indeed makes sense to support it in here. So forget my previous comment! |
Hm, there's one point that might make this complicated. The Eclipse foundation usually doesn't tend to like any other license then Eclipse or Apache. The Homie MIT license requires a copyright and license notice. Where should I put it, so that it is visible to the ESH user during runtime, to comply to the used license. Maybe in the bundles "binding.xml"? |
NOTICE file. |
Yes, NOTICE file will probably do it. I'm not using anything external except the name Homie. |
I doubt that referencing "homie" requires any kind of license inclusion or CQ. |
7fd8c64
to
57fda33
Compare
57fda33
to
9eefd3f
Compare
Could you please have a look at the Travis build log?
There are several other warnings regarding potential null pointers, but with this one the tooling is confident enough in its own capabilities so that it breaks the build. |
The full code part is:
But yeah a local variable should do. |
@davidgraeff Just fyi: I would like to schedule the openHAB 2.3 release for end of May with a code freeze on May 21 - it would be cool to have this PR merged soon as it will improve MQTT support in openHAB tremendously! Btw, many thanks for pushing that topic, I am sure many users will be grateful 😎 . |
@davidgraeff I see that your last commit does an "Adapt to future API" - which means that this PR now depends on all your other new PRs, which will make it impossible to get it merged within the next week (which would be necessary for getting it into the openHAB 2.3 release). Note that once this PR is ready, we will also require a CQ which can take a few days for being processed & approved. What is your opinion on this? Would it be possible to get this PR in a mergeable state on the current API? Imho, the internal refactorings won't break the binding from a user perspective, so it should be fine to do this as a separate step afterwards. |
@kaikreuzer When you revealed the release planning I was already secretly thinking that's a tough plan. I always wanted a full implementation test with all MQTT components involved and a real non-mocked broker running. I'm happy that I finally had time to implement it. That final piece uncovered some crucial shortcomings in the MqttBrokerConnection API that leads to unpredictable behavior (like silently failing subscriptions). To still make it for the release, one idea is to just review, discuss and merge the CompletableFuture API for MqttBrokerConnection. That's about 500 LOC and no CQ is required. After the release someone need to tidy the class up though. |
Thanks @davidgraeff. I am not myself in the MQTT code base, so it is difficult for me to assess - I'd leave that to @htreu as he is imho deepest into the code.
Which PR is that exactly? And I assume you mean that PR AND the this here, right? (because the MQTT Things are the most important part from a user perspective). |
@davidgraeff lets make a concrete plan for the openHAB release: When I understand you right your preferred option is to strip down the "CompletableFuture API" PR to only have the new MqttBrokerConnection API, w/o the MqttService refactoring and other stuff. This would be then a smaller PR which we might get reviewed and merged on time. |
With @maggu2810's comment #5535 (comment) its up to you @davidgraeff whether we wait with this MQTT things/homie PR until the new API is approved and merged or geht this one merged first. |
Bind Mqtt topics to things. Broker connections are listed as brigdes. A generic thing can be added. The thing can host one or multiple channels, each linked to a mqtt state / command topic and an own optional transformation. A channel is one of the following types: * TextChannel * NumberChannel * PercentageChannel * OnOffChannel A channel can be configured with a transformation pattern for an incoming message from a Mqtt state topic. This allows to extract a value from JSON/XML/etc, as it seems to get popular on some Mqtt topics to encode multiple values into json. Homie 3.x MQTT convention also supported (except node instances). The handlers and all value classes are backed by tests. Also-By: Simon Kaufmann <simon.kfm@googlemail.com> Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com> Signed-off-by: David Graeff <david.graeff@web.de> Signed-off-by: David Gräff <david.graeff@web.de>
This is a friendly re-take over of #5101, originally #3876 with changes from @SJKA:
Abstract
At this very moment there exist no means to actually connect mqtt topics to ESH things. Specialized bindings for all those commercial and non-commercial MQTT products out there makes sense.
But for a start this PR provides a simple generic MQTT topics to thing/channel mapping.
JSONPATH:$.device.status.temperature
for an incoming message of{device: {status: { temperature: 23.2 }}}
.Channels
Homie 3.x convention
Discovery of Things/Channels is possible by supporting the Homie convention.
localip
ormac
attribute do not make sense in the standard and will not be used or required from peer devices.Cheers,
David