Here’s an interesting idea for those who are interested! Sadly I don’t have the time to actually do it (new job, first daughter coming)
There’s an adapter already created for virtual things, this allows us to play around with, well, virtual things, but what if we could map those virtual things to MQTT topics & messages?
So, an example:
After configuring the MQTT broker settings, a user would be able to map:
An OnOffProperty could be mapped to 2 MQTT topics (but usually the same) with a configurable message…
Similarly a BrightnessProperty could be mapped to 2 MQTT topics, just as before to read & write the value set.
This approach is what about a 100% of MQTT dashboards for android use, and could be the missing link for wider adoption.
I’m not sure how current it is and I am also pretty sure that it was built more as a starting point to implement a specific MQTT dialect rather than usage as a generic, configurable MQTT adapter.
(I think the way you use “virtual thing” is how all adapters think of their things)
This adapter is not finished, I started to make mine and it’s still not yet published but meanwhile you can implement webthings to bridge mqtt to rest…
Maybe I should upstream this in webthing-node 1st or any other project ?
I am considering taking this on - at least for starters.
I greatly like the idea of starting from the virtual thing base.
One thing that would help me however is if I could simply bridge existing things instances (virtual or otherwise) with an MQTT client (I would write). I.e. bridge properties and events of things that currently live in the running gateway with my own code - which will connect to the MQTT broker.
But I have a feeling that this would be “hacking into the backdoor” and therefore probably not allowed/enabled.
@t1m1 has several add-ons that publish property data to other sources. For example, he created the azure-iot-bridge add-on. That may be a good place to start.
i have connected my mqtt server with the webthings gateway, i have also set the action and event but i am unable to see the message from the publisher in the mwebthings gateway