Generic support for external plug-ins in different languages
-
with mqtt inside openLuup, you'll completely remove many, many HTTP calls, and you'll not need polling anymore. so yes, MQTT is better from this point of view.
Indeed, it would make HTTP almost redundant for this application!
My development of openLuup’s own MQTT server is nearing the stage where it’s ready for Beta testing. It’s really nice to use with the Shelly devices (currently I only have i3 and sw2.5 implemented, but easily extended.). The bridge is by far the simplest that I have implemented, and so fast.
-
Just barely grasping the concept of MQTT here, but when you say embedded MQTT server, is that the same as a broker? or would one need that as a independent program?
If I understand this correctly, it seems to make many bridges redundant as well? Z-way, Domoticz, mabye not vera, but probably ezlo ..?Sound interesting either way!
-
Just barely grasping the concept of MQTT here, but when you say embedded MQTT server, is that the same as a broker? or would one need that as a independent program?
If I understand this correctly, it seems to make many bridges redundant as well? Z-way, Domoticz, mabye not vera, but probably ezlo ..?Sound interesting either way!
Let me try to explain it in more prosaic/layman terms:
The way the z-way bridge, the vera bridge and domoticz bridge work today is the host controller (i.e openLuup) is polling the server at regular intervals to get updates on every device over http. This is the concept of the REST API polling. The host can also send singular commands to that API to control devices on the secondary controller. The polling scheme generates a lot wasted traffic obviously because there is traffic even when nothing is happening/changing.
The idea is the same as for the zwave network management and the regular interval polling there which I advocated to eliminate back on the vera forum as z-wave devices don't need this anymore except for old light switches which did not support "instant status".
Another way to do this is to trigger updates only upon events. That's much more complicated to do because it requires setup on both the host and secondary controllers. The secondary controller needs to know where to send the messages to when an event occurs. That's what I did for home assistant to openLuup using purely HTTP APIs. It is tedious and every new device requires manually creating a virtual device on openLuup and a set of scenes/automation on both controllers to update one another and keep their status in sync over HTTP calls but it is a lot more efficient.
Now comes MQTT: It is a light weight protocol requiring a broker to manage all that traffic. It has all the various "clients" which are our controllers for example home assistant, z-way, openLuup etc... publish messages into topics. The broker then sends updates to all the controllers which subscribed to that topic. It is centralized event based communication and somewhat standardized as long as the different clients know how to interpret the messages and topics from one another (this is the part which is not standardized). It eliminates a ton of unnecessary polling and enables many clients to get updates instead of doing one to one communications.
A server is not a broker. I think AK is working on a client/server for openLuup to subscribe and publish to MQTT. There has been a variety of plugin attempt to do this but doing it inside of openLuup is new and make a lot of things simpler.
-
Thanks!
Have to correct you on the Domo bridge though, it includes a script in Domoticz that sends event updates immediately, polling is only needed if you havent installed that script. All that's needed in terms of domo setup is a user variable with an IP to openluup.
I guess that the broker would be even another container in my setup then.
-
Let me try to explain it in more prosaic/layman terms:
The way the z-way bridge, the vera bridge and domoticz bridge work today is the host controller (i.e openLuup) is polling the server at regular intervals to get updates on every device over http. This is the concept of the REST API polling. The host can also send singular commands to that API to control devices on the secondary controller. The polling scheme generates a lot wasted traffic obviously because there is traffic even when nothing is happening/changing.
The idea is the same as for the zwave network management and the regular interval polling there which I advocated to eliminate back on the vera forum as z-wave devices don't need this anymore except for old light switches which did not support "instant status".
Another way to do this is to trigger updates only upon events. That's much more complicated to do because it requires setup on both the host and secondary controllers. The secondary controller needs to know where to send the messages to when an event occurs. That's what I did for home assistant to openLuup using purely HTTP APIs. It is tedious and every new device requires manually creating a virtual device on openLuup and a set of scenes/automation on both controllers to update one another and keep their status in sync over HTTP calls but it is a lot more efficient.
Now comes MQTT: It is a light weight protocol requiring a broker to manage all that traffic. It has all the various "clients" which are our controllers for example home assistant, z-way, openLuup etc... publish messages into topics. The broker then sends updates to all the controllers which subscribed to that topic. It is centralized event based communication and somewhat standardized as long as the different clients know how to interpret the messages and topics from one another (this is the part which is not standardized). It eliminates a ton of unnecessary polling and enables many clients to get updates instead of doing one to one communications.
A server is not a broker. I think AK is working on a client/server for openLuup to subscribe and publish to MQTT. There has been a variety of plugin attempt to do this but doing it inside of openLuup is new and make a lot of things simpler.
@rafale77 said in Generic support for external plug-ins in different languages:
It is centralized event based communication
MQTT is distributed, to be completely right
So you could publish messages to n brokers, subscribe to topics from m clients, and have k servers, all working together.
Let put it in context.
Shelly => Broker => openLuup => Home Assistant => MS Reactor
or
MS Reactor => Broker => openLuup => InfluxDB => your own client
Possibilities are limitless. Bonus point is that you could integrate a lot of things (ZigBee2MQTT, ZWaveJS2MQTT, Hue2MQTT) with virtual no native plug-ins required in openLuup, beside a bunch of (easy) virtual device, to route the implementation of commands.
I've asked the eZlo guys to do this for luup/ezlo fw because it's really powerfull, when you realize a single box is not enough in order to truly mix and match various techonologies.
-
@PerH
Thanks for the precision on the domo bridge. I missed that.I am a bit allergic to containers... my entire setup (habridge/homekitbridge/z-way/home-assistant/mosquitto/openLuup/grafana) runs within a single VM on my NAS as I didn't see enough significant benefits of containerizing to justify the added complexity and overhead. It just takes 2 command line entries and a 2 line edit of a config file to install the broker. It is also much easier to upgrade and modify. Maybe I will come to it one day but I really nowhere close to it now.
-
Let me try to explain it in more prosaic/layman terms:
The way the z-way bridge, the vera bridge and domoticz bridge work today is the host controller (i.e openLuup) is polling the server at regular intervals to get updates on every device over http. This is the concept of the REST API polling. The host can also send singular commands to that API to control devices on the secondary controller. The polling scheme generates a lot wasted traffic obviously because there is traffic even when nothing is happening/changing.
The idea is the same as for the zwave network management and the regular interval polling there which I advocated to eliminate back on the vera forum as z-wave devices don't need this anymore except for old light switches which did not support "instant status".
Another way to do this is to trigger updates only upon events. That's much more complicated to do because it requires setup on both the host and secondary controllers. The secondary controller needs to know where to send the messages to when an event occurs. That's what I did for home assistant to openLuup using purely HTTP APIs. It is tedious and every new device requires manually creating a virtual device on openLuup and a set of scenes/automation on both controllers to update one another and keep their status in sync over HTTP calls but it is a lot more efficient.
Now comes MQTT: It is a light weight protocol requiring a broker to manage all that traffic. It has all the various "clients" which are our controllers for example home assistant, z-way, openLuup etc... publish messages into topics. The broker then sends updates to all the controllers which subscribed to that topic. It is centralized event based communication and somewhat standardized as long as the different clients know how to interpret the messages and topics from one another (this is the part which is not standardized). It eliminates a ton of unnecessary polling and enables many clients to get updates instead of doing one to one communications.
A server is not a broker. I think AK is working on a client/server for openLuup to subscribe and publish to MQTT. There has been a variety of plugin attempt to do this but doing it inside of openLuup is new and make a lot of things simpler.
@perh said in Generic support for external plug-ins in different languages:
MQTT server, is that the same as a broker?
@rafale77 said in Generic support for external plug-ins in different languages:
A server is not a broker.
To be sure 'server' is an overloaded term. However, within the scope of MQTT, a server is a broker. The OASIS MQTT specification (version 3.1.1, which is what I'm implementing) uses the term exclusively, and defines it (on lines 31-32) thus:
"A program or device that acts as an intermediary between Clients which publish Application Messages and Clients which have made Subscriptions."
I have, indeed, written a server, so you will not need Mosquitto, or any other server, installed anywhere, although, as @therealdb points out, you can have multiple servers (on different ports.)
-
@perh said in Generic support for external plug-ins in different languages:
MQTT server, is that the same as a broker?
@rafale77 said in Generic support for external plug-ins in different languages:
A server is not a broker.
To be sure 'server' is an overloaded term. However, within the scope of MQTT, a server is a broker. The OASIS MQTT specification (version 3.1.1, which is what I'm implementing) uses the term exclusively, and defines it (on lines 31-32) thus:
"A program or device that acts as an intermediary between Clients which publish Application Messages and Clients which have made Subscriptions."
I have, indeed, written a server, so you will not need Mosquitto, or any other server, installed anywhere, although, as @therealdb points out, you can have multiple servers (on different ports.)
@akbooer said in Generic support for external plug-ins in different languages:
I have, indeed, written a server, so you will not need Mosquitto, or any other server, installed anywhere
Fantastic. Thanks for your efforts on this one ak. It should be a really good addition to openLuup.