GladysAssistant / Gladys

A privacy-first, open-source home assistant
https://gladysassistant.com
Apache License 2.0
2.67k stars 282 forks source link

Make used mosquitto more configurable #2020

Closed dmonizer closed 8 months ago

dmonizer commented 8 months ago

Describe the bug When running zigbee2mqtt, a mosquitto container is created, but the connection details are not advertized in the UI for user (to use, for example, within node-red service) When then configuring the mqtt service (for usage with node-red), ANOTHER mosquitto container is created, which is waste of resources.

To Reproduce 1) Start zigbee2mqtt integration 2) Start mqtt integration 3) run 'docker ps|grep mosquitto'

result would show 2 containers, named: eclipse-mosquitto gladys-z2m-mqtt

Expected behavior Either (mqtt / zigbee2mqtt) would use existing container OR create a new one if not present. Both should advertize connection details (internal hostname/ip and port) for mqtt container

Your Gladys installation (please complete the following information):

Manual docker-compose installation on Raspberry Pi 4

Terdious commented 8 months ago

Hello @dmonizer and thank you for your issue. You bring up 2 completely independent things here. First of all, a concern for clear information in the UX. Then the demonstration is rather a misunderstanding in the desired choice of having several docker containers for mqtt.

For the 1st, I agree, the UX lacks information for the user.

For the second, several topics discuss it on the forum. This is a deliberate choice and display to properly segregate the different integrations. In order to properly address the correct problem raised in the first place and if you wish to keep your comment for the second point (it is certain that if this second point is taken into account it will not be treated at the same time as the 1st point) , could you create another issue specifically addressing this need.

Thank you in advance.

dmonizer commented 8 months ago

Hi, I am certainly not in any position to question any deliberate choices made in the architecture (while I do understand the drive behind it, personally i would have probably not decided so) so I leave that issue to be decided on the project owner/maintainers/developers.

Another thing that just popped into my head is that currently the broker url for MQTT is shown as "mqtt://localhost" - but that (afaik) is possible to be connected only from the container itself (being localhost) - so instead, a container name should be shown there.

And thank you for the great piece of software - it is a breath of fresh air after trying (unsuccessfully) to get my head around HA multiple times :)

Pierre-Gilles commented 8 months ago

Hey @dmonizer :)

I confirm that it's by design that we start a separate mosquitto containers. Both integrations are independent, and they are several reasons that made us choose this option.

However, we do want to be able to connect the Zigbee2mqtt integration to an external Mosquitto container (added manually by the user), which will allow this behaviour of using the same Mosquitto container for both integration.

We started a PR with @atrovato ( https://github.com/GladysAssistant/Gladys/pull/1872 ), but the development is currently paused for a lack of time ( priority changed! :D ).

If you want to contribute to Gladys, feel free to take my PR and submit it again, I'll merge it with great pleasure !!

I'm closing this issue as we use Github only for bug tracking. If you don't want to develop this, but still want to push for this feature to arrive in Gladys, feel free to open a "feature request" : https://en-community.gladysassistant.com/c/feature-requests/7