Ubiquiti Unifi Binding Feature Discussion

Tags: #<Tag:0x00007f213caf9e70> #<Tag:0x00007f213caf9c40>

(Stefan Höhn) #397

First @mgbowman, thank you very much for your effort in doing the binding.

Your binding was actually the main reason for me to setup a standalone unify controller :wink:

Using the PI3 for the unify controller

For those who don’t want to buy a unify cloud key and rather install the unify controller to a raspberry pi, I recommend going for a PI3 (don’t try Pi2 or below - it will fail due to missing 64 Bit and believe me, I tried for hours…) and follow this explanation: https://dougrathbone.com/blog/2018/03/31/configuring-a-ubiquiti-unifi-controller-to-run-on-raspberry-pi
It worked exactly as described!

Binding Updates in rules

now @mgbowman, I have a question regarding updates sent by the binding:

When I am writing a rule as follow

rule "Phone updates" 
 Item StefansPhone received update

I get updates every other 10 seconds

2018-09-14 08:10:56.789 [INFO ] [smarthome.model.script.Phone updates] - Stefan's Phone OFF 
2018-09-14 08:11:07.141 [INFO ] [smarthome.model.script.Phone updates] - Stefan's Phone OFF 
2018-09-14 08:11:17.623 [INFO ] [smarthome.model.script.Phone updates] - Stefan's Phone OFF 
2018-09-14 08:11:27.948 [INFO ] [smarthome.model.script.Phone updates] - Stefan's Phone OFF 
2018-09-14 08:11:38.360 [INFO ] [smarthome.model.script.Phone updates] - Stefan's Phone OFF 

Is there a way to suppress the updates only if the state has actually changed ? Or do you recommend to cater for that in the rule by statically remembering the last state and compare to it to the current and check if there was actually a transition between ON and OFF?


(Pali) #398

You can define filters on your rule triggers

rule "Phone updates" 
 Item StefansPhone changed from ON to OFF

See more details from https://www.openhab.org/docs/configuration/rules-dsl.html#event-based-triggers

(Stefan Höhn) #399

Thanks @pauli_anttila for reminding me. Stupid me… Sure I have seen this before!


(Matthew) #400

Glad there are people who find it useful! Makes the effort that went into it mean that much more :wink:

This is due to the fact that a “properly” implemented binding does not keep any sort of “state” of Items nor should it keep an internal “cache” of sorts. Bindings should only act as a communication channel between OH2 and the external system.

In the case of this binding, it simply reports the state as viewed by the controller.

(Stefan Höhn) #401

Makes sense to me.

Thanks for clarifying this, Matthew.

(Crispin) #402

I’d be lost without it! Thanks!

(Mr. Wiseman) #403


(Thefathefa) #404

I have to say that this is one of the key elements of my Openhab setup. It works very well and it is very useful. Thanks,

(Matthew) #405

@Crispin @jwiseman @thefathefa Happy to hear it!

I swear to you gentlemen that I am going to pick this binding back up, but I’ve just been so busy with my house I barely have time to sleep… rubs eyes

(J Wee) #406

“4 In-Ceiling PoE powered Echo Dots (which are fed into the In-Ceiling speakers using a ducking mixer - I don’t use the built-in speaker)”

Wow, exactly how did you wire the Echo Dots to your in-ceiling speakers?

(Matthew) #407

Each Echo Dot has 2x CAT6A cables ran to its location:

  1. PoE Adapter
  2. Audio over Ethernet Adapters: Echo Side + Mixer Side

Before pulling the trigger, I bought a pair of the audio adapters and tested it with 100m cable and it worked fine. All the In-Ceiling speakers are wired directly into the mixer.

Got the inspiration from a Reddit thread.

This is also one of the WAF requirements for PoE support in the UniFi binding. I have to be able to “kill” the dots by turning off their PoE via the UniFi switch in case we want to have a private conversation in the house

“Alexa, commit harakiri”


(Pumbadinho) #408

Any update on adding to repository?

(Craig) #409

Hey all, add me to one keeping a keen eye on this development. Sounds like it will be amazing

(Kristof Rado) #410

Hope someone can help me here. I want to develop my current network and I come up with Ubiquiti - besides that it has a working binding for OH. However if I want to use this binding, should I need the UNMS software running somewhere or it use (for example) an EdgeRouter directly?

If UNMS is required, what hardware do you recommend installing it, what do you use?

(Mark) #411

I’m not familiar with the UNMS software. I think that is relatively new. The Unifi binding works with the Unifi Controller software.

I manage my 2-site network using the Unifi controller software (v 5.8.30) running on an Ubuntu Linux box. I have 9 APs (AP-AC-LR, AP-LR, and AP-AC-Mesh) and one US-24-250W switch all of which are managed by one controller instance running in one of the sites.

(Kristof Rado) #412

Thanks! Which hardware do you use to run UniFi controller? An RPi should be enough for a smaller network?

(Mark) #413

You should have no trouble running it on an RPi. In my case, I have a number of services (including the Unifi Controller) running on a core i5 1U rackmount server.

Your other option would be the Cloud Key, but I don’t have any experience with that.

(Kristof Rado) #414

Thanks for your help! I’m also thinking of buying a ‘real’ server for these purposes, but I don’t know which way would be good. I live in a flat, so I don’t have much space for servers. What other services do you run on your server? I might want to use it as a file server (NAS), run openHab and UniFi Controller. (and maybe smaller services as well…)

(Mark) #415

I run Zoneminder, Zabbix, and a few other services.

I built my rackmount server based on this article. As described in my comments on the article, I deviated a bit from his specs to reduce the cost by several hundred dollars.

(Kristof Rado) #416

Thank you very much for your help! Really appreciate it!