Ubiquiti Unifi Controller: how to install on Hass.io image?

Besides running Hass.io I’d like to run the Ubiquiti Unifi Controller software on the same Raspberry Pi. But being a complete noob on the ResinOS/Docker thing I’m not sure how to take care of this. Would creating an add-on be the way to go? Or is there a way to install the software separately? Because there is no reason for the Unifi Controller and HA to communicate it really doesn’t matter where it runs I guess, I just want to use the same hardware to run two applications.

It would be helpful if someone could point me in the right direction, thanks in advance!

I have the same question, I was able to do that when I installed HA using All-in-One installation, but recently I moved to hass.io and can’t figure out how to install custom software, specifically UnFii Controller.

I tried to install docker, but it fails to run because there is no rc-update or service commands :frowning:

So far I haven’t found any answers, but if I find out more I’ll definitely let you know here!

I have i running on a separated pi Zero W. that way you never have problems updating the two. the total investment was below €20

Thx, I’ve found an old RasPi 2B and installed the controller there. But to be honest I’m still interested in getting it to work on one RasPi just to get to know the way Hassio/Resinos works a little better.

And since you’ve got this setup working, maybe you can help me with another problem? I do have the controller running on my 2B but it can’t find the Unifi device in my network although it’s connecting over wifi through that actual AP. The Raspi gets an IP address from my router on the same subnet as the AP. When I use the controller from my Mac everything just works fine but the controller on the Raspi can’t find the AP. Any clue what I might be doing wrong? Thx a lot!

i got the same problem. i backup my controller from the pc and load teh backup file in the RPI Controller. then wait a long time. and it was up and running.

Awesome, that sounds hackish enough so that it just might work :wink: I’ll give it a try!

I have created a Hass.io add-on running the UniFi controller. If I can find the time I will setup a repository so you can test it.

That was’nt too hard. :slight_smile:
You can install and test it by adding this repository: https://github.com/stefanlaheij/hassio-addons

2 Likes

Thanks for the add-on!

However, when I click on the Install button it start to install the add on (the loader gif appears). After some time (approx. 5 minutes) the install button appears again, but the add-on is not installed.

What platform are you running Hassio on? I have only tested this on a Raspberry Pi 2.

I´m also running on a Raspberry Pi 2. I installed the Hassio image for Rpi 2, is that why it does not work?

That’s strange. I used the SD-card image last week from https://home-assistant.io/hassio/installation/

Can you check Hassio>3-dot menu (top right)>Advanced Settings>View Logs?

This is what the log is saying:

17-10-19 19:28:02 INFO (SyncWorker_9) [hassio.dock.addon] Start build ceecc69e/armhf-addon-unifi:0.94
17-10-19 19:31:22 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py”, line 422, in start
resp = yield from self._request_handler(request)
File “/usr/lib/python3.6/site-packages/aiohttp/web.py”, line 306, in _handle
resp = yield from handler(request)
File “/usr/lib/python3.6/site-packages/hassio/api/util.py”, line 31, in wrap_api
answer = await method(api, *args, **kwargs)
File “/usr/lib/python3.6/site-packages/hassio/addons/addon.py”, line 463, in install
if not await self.docker.install(self.last_version):
File “/usr/lib/python3.6/site-packages/hassio/dock/util.py”, line 18, in wrap_api
return await method(api, *args, **kwargs)
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/lib/python3.6/site-packages/hassio/dock/addon.py”, line 198, in _install
return self._build(tag)
File “/usr/lib/python3.6/site-packages/hassio/dock/addon.py”, line 211, in _build
image = self.docker.images.build(*build_env.get_docker_args(tag))
File “/usr/lib/python3.6/site-packages/docker/models/images.py”, line 175, in build
raise BuildError(chunk[‘error’])
docker.errors.BuildError: The command '/bin/sh -c apt-get update && apt-get install -y --no-install-recommends oracle-java8-installer=${JAVA_INSTALLER_VERSION} oracle-java8-set-default && rm -rf /var/lib/apt/lists/
&& rm -rf /var/cache/oracle-jdk8-installer’ returned a non-zero code: 100

Maybe the package repository has some issues.
I will have a look if I find the time.

Hi,

I think the problem here is the apt commands that does not exist in the hassio build.

I can install your sprinkler add-on without any problem and I can see that you are not using any apt command in the docker file at all there. What do you think?

I now had the same issue with the java installer.
I created a new version that uses the built-in Java version. This should work. Please let me know!

I had the same java error message when trying to install on a PI 3 B. It is fixed now.

Thanks!

Thanks for making this add on - greatly appreciated as I want to stop using a power-sucking server to run my UniFi controller! I have things almost set up but am stuck on “Provisioning” (actually seems to be going back and forth between Adopting & Provisioning) when I’m logged into my rpi:8443 UniFi web management page. When I set this up through my original server, it adopts quickly with no fuss. Has anyone else seen this?

Hi, thx for this addon. I seems to work fine.

Can you tell me, where to put die config.json files? I need to make a change in the config.gateway.json file. But I cant find a folder on my hassio to put the config in. Thx a lot.