Need help with MQTT configuration for QBUS system

Hello everyone,

I have a home automation setup in my house for all the lighting. I’m from Belgium and with my electrician we chose to install the QBUS system, which is “reputed” to be relatively open. They do provide an MQTT Gateway (GitHub - Qbus-Koen/qbusMqtt) which is functional and that I’m already running on a Raspberry Pi.

The only problem is QBUS is Dutch and it’s not very well known yet… They have an official plugin for Node-RED and for OpenHab (see link above). The Flemish community is fortunately quite enthusiastic and on the QBUS forum, some developers created scripts to implement this in Home Assistant:

And it works really well in Home Assistant, I see all my lights which I can turn on/off from the interface, and it synchronizes well with the LEDs in my switches, and also with the official QBUS app that allows me to turn things on/off. Which makes me understand that Home Assistant can both receive the on/off information but also send a new value, which is itself intercepted by the QBUS MQTT gateway that sends the information to the controller. So far OK I understand the operation :slight_smile:

I would like to implement this in Gladys, but I think I’m the first to push this door, because they don’t seem to know Gladys up north :stuck_out_tongue:

Having a dev background, I tell myself it shouldn’t be very complicated. However I’m completely discovering the MQTT protocol and I still have a bit of trouble understanding what kind of payload QBUS expects in order to turn a light on or off. Especially since the documentation is quite non-existent, it’s not like there’s a nice documented API :slight_smile:

So I need a bit of help :folded_hands:

I forked this repo GitHub - nicojanssens/qbus-ha which is written in JS and therefore quite easy for me to get into, but I’m stuck I think because of my poor understanding.

For now I can subscribe to a topic cloudapp/QBUSMQTTGW/config
When I then send a topic cloudapp/QBUSMQTTGW/getState
I get the list of my devices:

I imagine I must register each device in Gladys and have a feature “listen to the value that QBUS sends me” (if I use a physical switch) and a feature “send new value to QBUS”.
But how can I tell Gladys that device X must listen to the topic cloudapp/QBUSMQTTGW/UL1/UL41/state which corresponds to the state of my lamp X?

Having an example configuration for a lamp in Gladys would help me a lot :smiley: A lamp in Gladys that can both receive the information whether it is on or off, and at the same time be controllable from Gladys itself.

In the preconfigured Home Assistant by the Flemish devs, I do have my lamp with its current state and the possibility to turn it on/off

And here is the config behind that I could find

What is this template thing (example)?
And how to do in Gladys to control a dimmer lamp?

If someone could point me in which direction to go, that would be great :slight_smile:

Thanks a lot in advance!

Hello !

Take a look at this live coding: [(59) Live coding: A Z

2 Likes

Thanks a lot! I’ll go through all of that :slight_smile:

If I were to develop a new Gladys integration, how can I load it into my Gladys instance to test it?

You need to generate a test Docker image:

Which you can run in parallel (or better, on another machine)

1 Like

Great, thanks!