Install Gladys on Qnap NAS

Hello,

As a Home Assistant user, I have just discovered Gladys and, as Pierre-Gilles suggests in his comparison video, I am tempted to use both solutions in parallel.

To date, Home Assistant runs on my QNAP NAS in a virtual machine. In parallel, the Container Station package is installed.

Can Gladys be installed on a QNAP NAS and, if so, how?

Thanks for your help,

Yann.

Hello and welcome to the forum.
I don’t know whether anyone has already installed Gladys on a QNAP NAS, but it has already been done on a Synology.

The prerequisite is to install Docker, because Gladys runs in a Docker container.

Here’s the link to the documentation if that can help you.

Hi @Yann_Gourrier, welcome aboard :slight_smile:
As @_Will_71 indicated, the install on QNAP should (normally) be as simple as on Syn

Hello and thank you both.

I was looking in vain for a link to download the image…

Thanks to your help it’s installed and I can find Gladys in Container Station.

Now I’m going to tinker to see how it goes.

I have a doubt about the storage folder. I created it and modified the script from the manual, but it’s empty… How can I check that everything is correct?

I don’t use Zigbee modules; I have quite a few bulbs, smart plugs and Hue remotes, and Meross Wi‑Fi modules recognized in Apple Home and Home Assistant.

Thanks again for your help.

Sincerely,

Yann.

You should have things like this:
![image|426x500, 75%](upload://lNafYvBdj

None of that.

I think QNAP’s Container Station must be different from Synology’s, and as a result the script is probably not suitable even though I modified the path like this:

\-v /DataVol1/docker/gladysassistant/:/var/lib/gladysassistant \\\

And since I don’t know anything about creating Docker containers, I’d rather not venture further.

Have a good evening.

Sincerely,

Yann.

My very personal opinion: I don’t recommend using the command line (I’m not good with it and I prefer to be able to modify what I want in docker compose without having to rewrite everything).
Now QNAP needs to support docker compose graphically — is that the case?
… I just saw that it’s called Applications in Container Station:

By the way this site explains very well the complete installation of Container Station and Portainer, which allows managing docker compose very well (called Stack).

So either you use a QNAP Application that you name GladysAssistant, or you use Portainer (which I recommend because it’s independent of the NAS you use and it’s what I have at home), and you put this code (in accordance with your storage directory for persistent data):

version: "3"

services:
  gladys:
    image: gladysassistant/gladys:v4
    container_name: gladys
    restart: always
    privileged: true
    network_mode: host
    cgroup: host
    logging:
      driver: "json-file"
      options:
        max-size: 10m
    environment:
      NODE_ENV: production
      SQLITE_FILE_PATH: /var/lib/gladysassistant/gladys-production.db
      SERVER_PORT: 8420 # port changed to avoid overlapping with the NAS ports
      TZ: Europe/Paris
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /DataVol1/docker/gladysassistant/:/var/lib/gladysassistant # to verify and validate
      - /dev:/dev
      - /run/udev:/run/udev:ro
  watchtower:
    image: nickfedor/watchtower
    restart: always
    container_name: watchtower
    command: --cleanup --include-restarting
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

To check:

  • path of the directory because I found /share/Container/ on several sites including the one mentioned above
  • make sure to give read-write (RW) rights on the directory to your user who created the docker to avoid write permission issues.

If needed, I can guide you on Portainer because I use this service a lot.
Here’s the example on my setup:
image

Hello and thank you for the time spent and these tips.

The integration of Portainer on the QNAP as explained in the link went smoothly.

Note that it was done inside Container Station by creating an application.

Then I pasted the script (thanks) into Portainer after checking the storage path.

Then deployed it as in the example from the link.

After that I found Gladys and Watchtower in Container Station with a message telling me that the Docker containers will have limitations because they come from outside.

I noticed that there is neither an IP address nor a MAC address linked to the containers, unlike the virtual machine that hosts Home Assistant (HA).

While digging around in Gladys, I realized that IPv6 addresses are required, which are not enabled in my setup.

And finally, no way to connect Gladys to Apple Home — the procedure after scanning the QR code on my iPhone failed several times in a row. A pity; for Hue everything was very smooth.

So I give up with regret, being taken with Gladys’s philosophy and its French origin.

If a QNAP owner more skilled than me would be willing to write a tutorial, I’m all for it.

Thanks again for your help and best of luck to Gladys.

Regards,

Yann.

PS: One last point about the paths for storage.

I have the impression that CACHEDEV1/_DATA /Container is the path to specify and that DataVol1 is a display name in File Station. Indeed, here’s what I see in the terminal:

Good news, glad you managed to get all that working.

Yes, because it’s Portainer that manages Docker Compose and therefore the containers.

That’s normal: VMs have IPs assigned by your router (usually via DHCP), and the containers are linked to the machine’s IP — in this case your QNAP.

This part is only for Matter, but we need to look again at whether IPv6 is essential or not, because I manage to pair Matter devices with Apple Home without IPv6…

That’s odd because I had already done it about a year ago and it worked.
I just tried again (iOS 18.7.2) and there is indeed an issue because no pairing is possible but without a crash :thinking: @pierre-gilles if you’re around.
However the HomeKit integration allows you to "see" Gladys in Apple Home, not the other way around. Is that what you want to do?

Haaaa good news! Well I don’t have any Hue devices so I won’t be able to help on that topic.

I have a question: do you use only Apple Home to manage your devices, only HA (Home Assistant), or a mix of both?
The goal with Gladys (at least in my opinion) would be to be able to control everything directly from Gladys.
And if an integration is missing (like Meross, which seems well managed by HA (Home Assistant) apparently) then I expose those devices via MQTT from HA to retrieve them later in Gladys.

So I retested and it works.
The scenario:

  • create a new home in Apple Home
  • in this new home click on Add or +
  • go to the Apple HomeKit integration on Gladys and click Relaunch
  • scan the new QR code with the phone
    Then it works and I get all my devices.

@bertrandda apparently HomeKit pairing seems to be crashing since the dependency update: Upgrade hap dependency to latest stable version by bertrandda · Pull Request #2379 · GladysAssistant/Gladys · GitHub

I’ll look into that

1 Like

I just tried re-pairing HomeKit, it went well. I suspect the mDNS part. Is it possible to check:

  • that the container’s Network configuration is set to Host
  • that there aren’t multiple network interfaces on the NAS
  • did you try resetting the integration before pairing by clicking on image in the HomeKit integration configuration?

I see that Homebridge is running on a QNAP NAS so we should be able to find a solution

1 Like