# Need help with MQTT configuration for QBUS system

**URL:** <https://community.gladysassistant.com/t/besoin-daide-sur-la-configuration-mqtt-pour-systeme-qbus/8672>\
**Category:** Configuration\
**Created:** [January 5, 2024, 10:19pm UTC](https://community.gladysassistant.com/t/besoin-daide-sur-la-configuration-mqtt-pour-systeme-qbus/8672 "2024-01-05T22:19:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mydnic](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mydnic/32/14093_2.png) [@mydnic](https://community.gladysassistant.com/u/mydnic)\
**Post date:** [January 5, 2024, 10:19pm UTC](https://community.gladysassistant.com/t/besoin-daide-sur-la-configuration-mqtt-pour-systeme-qbus/8672/1 "2024-01-05T22:19:01Z")

</div>

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](https://github.com/QbusKoen/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:

- [GitHub - thomasddn/qbha: Qbus Bridge for Home Assistant](https://github.com/thomasddn/qbha)
- [GitHub - nicojanssens/qbus-ha](https://github.com/nicojanssens/qbus-ha)

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 🙂

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 😛

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 🙂

So I need a bit of help 🙏

I forked this repo [GitHub - nicojanssens/qbus-ha](https://github.com/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:

 ![Screenshot 2024-01-05 at 22.55.48](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/4/468ed7ea7c14f3a4ddcda2c595933c6b8c53425e.png)

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 😃 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

 ![Screenshot 2024-01-05 at 23.08.28](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/8/8b7450ea49229a559b3188083e9c1e2734a4cd98.png)

And here is the config behind that I could find

 ![Screenshot 2024-01-05 at 23.01.02](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/5/507da97eb8c3b73e0bec6473ed709f88475da186.png)

What is this template thing ([example](https://github.com/nicojanssens/qbus-ha/blob/main/lib/Discoveries.js#L48))?  
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 🙂

Thanks a lot in advance!

---

<div class="post-metadata">

**Author:** ![Sescandell](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/sescandell/32/3759_2.png) [@Sescandell](https://community.gladysassistant.com/u/Sescandell)\
**Post date:** [January 5, 2024, 10:29pm UTC](https://community.gladysassistant.com/t/besoin-daide-sur-la-configuration-mqtt-pour-systeme-qbus/8672/2 "2024-01-05T22:29:45Z")

</div>

Hello !

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

---

<div class="post-metadata">

**Author:** ![mydnic](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mydnic/32/14093_2.png) [@mydnic](https://community.gladysassistant.com/u/mydnic)\
**Post date:** [January 6, 2024, 7:59am UTC](https://community.gladysassistant.com/t/besoin-daide-sur-la-configuration-mqtt-pour-systeme-qbus/8672/3 "2024-01-06T07:59:05Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![GBoulvin](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/gboulvin/32/10006_2.png) [@GBoulvin](https://community.gladysassistant.com/u/GBoulvin)\
**Post date:** [January 6, 2024, 1:25pm UTC](https://community.gladysassistant.com/t/besoin-daide-sur-la-configuration-mqtt-pour-systeme-qbus/8672/4 "2024-01-06T13:25:20Z")

</div>

> [@mydnic](#):
>
> How can I load it into my Gladys instance to test it?

You need to generate a test Docker image:

> [@Développeur Gladys : Comment builder une image Docker de test?](https://community.gladysassistant.com/t/developpeur-gladys-comment-builder-une-image-docker-de-test/8182):
>
> Salut à tous slight_smile Un petit tutoriel destiné aux développeurs Gladys pour expliquer comment builder une image Docker de test. Pré-requis: Avoir un compte Docker Hub Etape 1: Créer ces variables d’environnements dans Github Actions Rendez-vous sur votre fork de Gladys, dans les «&nbsp;Settings&nbsp;» de votre repo: Créez ces secrets : DOCKERHUB\_PASSWORD (Peut-être un mot de passe clé d'API) DOCKERHUB\_REPO (L'image Docker a pousser, exemple: `pierregille…

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

> [@Tutoriel: Lancer une image Docker de test](https://community.gladysassistant.com/t/tutoriel-lancer-une-image-docker-de-test/8042):
>
> Parfois, un développeur veut proposer une image Docker «&nbsp;de test&nbsp;» sur le forum pour permettre à des utilisateurs de tester une nouvelle intégration avant qu’elle soit déployée en production. Contrairement à l’image Docker «&nbsp;officielle&nbsp;» qui est hébergée sur le compte du projet gladysassistant/gladys, une image de test sera hébergée sur le compte Docker du développeur proposant l’image. Exemple: jeanfrancois/gladys. Pour lancer une image Docker de test, c’est le même process que décrit sur la …

---

<div class="post-metadata">

**Author:** ![mydnic](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mydnic/32/14093_2.png) [@mydnic](https://community.gladysassistant.com/u/mydnic)\
**Post date:** [January 6, 2024, 2:43pm UTC](https://community.gladysassistant.com/t/besoin-daide-sur-la-configuration-mqtt-pour-systeme-qbus/8672/5 "2024-01-06T14:43:58Z")

</div>

Great, thanks!
