Home Assistant Community Add-on: UniFi Controller

Thanks a lot Frenck,
I already did have the devices configured using a previous controller, so this did the trick (in case anybody has the same problem):
Reset the devices using a the reset button (paperclip, small button on the back, hold for 10 seconds).

OK I removed the addon and re-added it. Started a restore and left it. After about 20 mins the the web page appeared and it had restored my config. So it seems I was impatient!

I still this error in the log though:

OpenJDK Client VM warning: You have loaded library /usr/lib/unifi/lib/native/Linux/armv7/libubnt_webrtc_jni.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.

Unfortunately I could not get this add-on to work: I left it running for over an hour without result. If I subsequently restarted the add-on, login failed with unkown user/password. Hence something is failing during the config import.

I reverted back to https://github.com/stefanlaheij/hassio-addons which work fine.

Hi,
I’m running the addon succesfully on my Debian install of Hassio. I have added a USG and will need to edit a file within the install (config.gateway.json). This seems to be the only way to change the mac address of the USG. How can I access that file within the docker environment, is there any way to ssh into the running container? Otherwise I may just install the controller directly in the OS and abandon the plugin.

I just install and transfer my old controller config to UniFi Controller Add-on. It’s working like a charm. Is it possible to add shortcut to Hass.io side bar?

Thanks for your efforts.

:tada: Release v0.1.2

Full Changelog

Changed

  • Upgrades UniFi to v5.8.24

Hi Guys,

Is there any way to access the unifi controller config files? I have a need to edit the config and add some code that disables NAT on my USG so that I can let my pfsense box handle nat / routing

2 Likes

Where is this file located?

<unifi_base>/data/sites/site_ID/config.gateway.json.

Is there any conflict between using this and the inbuilt mqtt on 1883 / 8883 ports on hass.io. was thinking about installing this but had some vague recollection of there being an issue?

Hi Kiwi,

I use both and haven’t had any issues. I do however run hassio on an Intel NUC for better performance.

1 Like

Thanks. I’ll give it a whirl then. I’m also looking to eventually repurpose my old nuc as well.

I’m trying to use https://www.home-assistant.io/components/device_tracker.unifi/. It reports Failed to connect to Unifi: Login failed - status code: 400 at startup. I suspect that it is since Unifi Controller addon isn’t started yet.

Anyone here that that has a working device_tracker.unifi and any suggestions?

This is great! Thanks so much! Would it be possible to add the beta version of the controller as well? I am currently running version 5.9.4.

I installed the controller and it works great. Thank you.

1 Like

I’m considering this at this point.

Im unable to access the web UI, and the logs are being filled with errors like this, any ideas? :

org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: destroy called
Exception in thread “launcher” org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘Object’ defined in class com.ubnt.service.AppContext: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [com.ubnt.service.Object.O0OO com.ubnt.service.AppContext.Object()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘dbService’ defined in class com.ubnt.service.AppContext: Invocation of init method failed; nested exception is com.mongodb.MongoCommandException: Command failed with error -1: ‘db side execution is disabled’ on server 127.0.0.1:27117. The full response is { “ok” : 0.0, “errmsg” : “db side execution is disabled” }
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1055)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:951)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.context.annotation.AnnotationConfigApplicationContext.(AnnotationConfigApplicationContext.java:73)
at com.ubnt.service.B.õO0000(Unknown Source)
at com.ubnt.service.B.Õ00000(Unknown Source)
at com.ubnt.ace.Launcher.main(Unknown Source)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [com.ubnt.service.Object.O0OO com.ubnt.service.AppContext.Object()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘dbService’ defined in class com.ubnt.service.AppContext: Invocation of init method failed; nested exception is com.mongodb.MongoCommandException: Command failed with error -1: ‘db side execution is disabled’ on server 127.0.0.1:27117. The full response is { “ok” : 0.0, “errmsg” : “db side execution is disabled” }
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:181)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586)
… 15 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘dbService’ defined in class com.ubnt.service.AppContext: Invocation of init method failed; nested exception is com.mongodb.MongoCommandException: Command failed with error -1: ‘db side execution is disabled’ on server 127.0.0.1:27117. The full response is { “ok” : 0.0, “errmsg” : “db side execution is disabled” }
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:305)
at com.ubnt.service.AppContext$$EnhancerBySpringCGLIB$$d0b6a376.dbService()
at com.ubnt.service.AppContext.Object(Unknown Source)
at com.ubnt.service.AppContext$$EnhancerBySpringCGLIB$$d0b6a376.CGLIB$Object$0()
at com.ubnt.service.AppContext$$EnhancerBySpringCGLIB$$d0b6a376$$FastClassBySpringCGLIB$$d25bb5f5.invoke()
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:293)
at com.ubnt.service.AppContext$$EnhancerBySpringCGLIB$$d0b6a376.Object()
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:160)
… 16 more
Caused by: com.mongodb.MongoCommandException: Command failed with error -1: ‘db side execution is disabled’ on server 127.0.0.1:27117. The full response is { “ok” : 0.0, “errmsg” : “db side execution is disabled” }
at com.mongodb.connection.ProtocolHelper.getCommandFailureException(ProtocolHelper.java:115)
at com.mongodb.connection.CommandProtocol.execute(CommandProtocol.java:114)
at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:168)
at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:289)
at com.mongodb.connection.DefaultServerConnection.command(DefaultServerConnection.java:176)
at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:216)
at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:187)
at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:161)
at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:134)
at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:124)
at com.mongodb.operation.CommandWriteOperation.execute(CommandWriteOperation.java:55)
at com.mongodb.Mongo.execute(Mongo.java:845)
at com.mongodb.Mongo$2.execute(Mongo.java:828)
at com.mongodb.DB.executeCommand(DB.java:724)
at com.mongodb.DB.doEval(DB.java:565)
at com.mongodb.DB.eval(DB.java:579)
at com.ubnt.service.OoOO.OOoo.õO0000(Unknown Source)
at com.ubnt.service.OoOO.S.ö00000(Unknown Source)
at com.ubnt.service.OoOO.S.do(Unknown Source)
at com.ubnt.service.OoOO.S.super(Unknown Source)
at com.ubnt.service.OoOO.oOoo.Ò00000(Unknown Source)
at com.ubnt.service.OoOO.oooO.void(Unknown Source)
at com.ubnt.service.OoOO.OOoo.afterPropertiesSet(Unknown Source)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)
… 35 more`

I have the same issue, is there anyway around using port 8080?

I would suggest just using the Mosquitto broker add-on.

Hey guys, quick question… if I already have a UniFi CloudKey running the Controller software, is there any real benefit to justify swapping it out with this add on?