Git Product home page Git Product logo

homebridge-unifi-poe-control's Introduction

Homebridge UniFi POE Control

Downloads Version verified-by-homebridge

HomeKit support to control the POE status of UniFi Switches using Homebridge. With homebridge-unifi-poe-control you can enable/disable or Powercycle POE ports of UniFi Switches. Per port you can define two HomeKit switches - one for On/Off state und one for PowerCycle. The PowerCycle feature only works for enabled POE ports.

Configuration

For most people, I recommend using Homebridge Configuration web UI to configure this plugin rather than doing it directly. It's easier to use and less prone to typos, leading to other problems.

You can use your Ubiquiti account credentials, though 2FA is not currently supported.

That said, I strongly recommend creating a local user just for Homebridge instead of using this option. The local UniFi user should have the SiteAdmin role to control the POE status of the ports.

UniFi Manage Users and Roles

Example config

{
  "platforms": [
    {
      "platform": "UniFiPoeControl",
      "name": "UniFi POE",
      "url": "https://CONTROLLER_ADDRESS:443",
      "username": "YOUR_USERNAME",
      "password": "YOUR_PASSWORD",
      "refreshInterval": 60, // seconds - optional
      "apiMode": null, // optional ("old" | "UniFiOS")
      "ports": [
        {
            "mac": "aa:bb:cc:dd:ee:ff", // mac address of the switch
            "idx": 17, // port number on the switch
            "name": "ALTERNATIVE NAME", // optional
            "onMode": "auto" // optional ("auto" | "pasv24" | "power_cycle")
        }
      ]
    }
  ]
}

The plugin should work with old firmwares (!= UniFi OS) and UniFi OS firmwares.

The plugin will try to find out which API is present to use the right API endpoints. If it doesn't work you can force a specific API mode (apiMode - old | UniFiOS).

The onMode defines which mode should be used if POE port changes status from offline to online. If you set powerCycle you can power cycle the POE port - only if the POE port is online. To control the On/Off state of the POE port define another port with onMode="auto" | "pasv24".

homebridge-unifi-poe-control's People

Contributors

kienz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

homebridge-unifi-poe-control's Issues

Can only control ports that have existing port overrides

Took me a lot of trial and error to figure out why only some arbitrary ports on my switches would show up as HomeKit accessories and others were ignored completed. I finally read through the code and enabled debug logging and figured it out: the code looks at the port_overrides dictionary for the switch to figure out whether to set up the accessory. But this only exists for switch ports that have had an override set in the Unifi network controller. If you have not done this, the Unifi-PoE-Control plugin ignores the port and does not create the HomeKit accessory.

I understand why this might be difficult to fix, since the code modifies the existing override rather than creating a new one, but it would be great if the documentation had a note explaining this. Once I understood this, it was very easy to fix: I toggled the PoE setting in the Unifi network settings for the port, and the plugin picked it up and created the accessory on the next refresh.

Support for UDM?

Hi,

Me like many others wanted an easy way to switch cameras on and off.

[8/21/2022, 2:44:29 PM] [UniFiPoeControl] Refreshing devices...
[8/21/2022, 2:44:29 PM] [UniFiPoeControl] Request-Error proxy/network/api/self/sites Error: Request failed with status code 403
[8/21/2022, 2:44:29 PM] [UniFiPoeControl] Successfully logged in to UniFi controller
[8/21/2022, 2:44:59 PM] [UniFiPoeControl] Refreshing devices...
[8/21/2022, 2:44:59 PM] [UniFiPoeControl] Request-Error proxy/network/api/self/sites Error: Request failed with status code 403
[8/21/2022, 2:45:00 PM] [UniFiPoeControl] Successfully logged in to UniFi controller

But nothing shows up. Any tips?

on Value of POE-port (24v vs. Poe+)

I am using mixed Unifi Lite and Unifi LR access points.
Unifi AC Lite = 24v passive = mandatory !!
Unifi AC LR (long range) = 24v passive, but can also work if POE port is configured as POE+

That is why I set the option "on-value of the poe port" to 24v passive when it comes to configuring the
port of the Unifi AC LITE access point.

BUT: after turning the port OFF (which is ok) the plugin always sets POE+ when enabling the port again.
That means the Unifi AC LR access points successfully restart as they can handle the POE+ setting, but the
Unifi LITE keeps disabled as for it the 24v passive setting is mandatory!

I use the original Unifi US 250 Watt 24 Port POE Switch

thanks for your work

time schedule

Is it possible to set a time schedule for ports to be deactivated and activated so that they do not provide power for a certain period, e.g. during the weekend and accordingly, the devices plugged into the ports are off (like a switchable power socket)?

Homebridge unable to access poe ports. Code 400

Hi there
Since the last few updates on unifi, including the addition of Ethernet port profiles, it is increasingly difficult to control or gain access to control the poe ports in this (brilliant) plug in. I do not think it’s an issue with the plug in but with unifi os. Can you help with a workaround, in unifi os, to getting the communication working?

Not possible to switch on passthrough-port on Switchmodel US-8

On Unifi switch model us-8 it is possible to configure one port with poe. This port has to be configured with poe 'passtrough' or 'poe off'. It is possible to switch off the port but it is not possible to switch it on via home app (homebridge plugin)! Is it possible to add the value 'Passthrough' to the configuration of the POE ON function? Currently only the settings 'auto', '24V Passive' and 'Power Cycle' are possible.

controller update to V7.2.95

Hello,
Unfortunately, since the controller update to V7.2.95, the connection no longer works.
see log:

[04/11/2022, 06:57:32] [UniFiPoeControl] Removing 4 device(s)
[04/11/2022, 06:58:33] [UniFiPoeControl] Setting up new accessory: USL24P (MAC: xxxxx) / #1 (POE AP-EG)
[04/11/2022, 06:58:33] [UniFiPoeControl] Setting up new accessory: USL24P (MAC: xxxxx) / #2 (POE AP-OG)
[04/11/2022, 06:58:33] [UniFiPoeControl] Setting up new accessory: USL24P (MAC: xxxxx) / #3 (POE AP Aussen)
[04/11/2022, 06:58:33] [UniFiPoeControl] Setting up new accessory: USL24P (MAC: xxxxx) / #4 (POE AP -Keller)
[04/11/2022, 06:58:33] [UniFiPoeControl] Removing 4 device(s)

Cannot add a bridged Accessory with the same UUID as another bridged Accessory

Thank you so much for this plugin, it is amazing! Today, my Hoobs apparently updated itself and now its not longer working though.

I always get the following error:
Only the first configured port of every switch shows up now.
Error getting devices: Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory

HomeKit device not showing up.

I installed the plugin and configured it correct following the description. But in my Home app it won't show a new device to control the PoE Port with. Am I doing something wrong?

I'm using an USW Lite 8 PoE & a UDM Pro as controller.
This is my Config:

"platforms": [
{
"platform": "UniFiPoeControl",
"name": "UniFi POE",
"url": "https://192.168.3.1:443",
"username": "xxxxx",
"password": "xxxxx",
"refreshInterval": 60000,
"ports": [
[
{
"mac": "xx:xx:xx:xx:xx:xx",
"idx": 3,
"name": "CCTV Switch",
"onMode": "auto"
}
]
]
}
]
Of course I blurred out the sensitive information.
Can someone help me please?

P.S. I'm sorry for the code markup

Non PoE

Hi! I am trying to see if this plugin works for regular switches? I have successfully installed it and have a button in the Apple home app. But flicking the button does not disable the port. I do see the switch "getting ready" when I hit it but the port does not change to disable.

log clutter

thanks for this useful plugin!

Is there any chance the "Refreshing devices..." message can be removed or disabled? It really clutters up the home bridge log.

Multiple ports controlled at the same time

We have a few items that we control all at the same time and would love to be able to automate them to a schedule. I've programed each port into the plugin however when I group them in HomeKit as one tile, only one in the group responds to the on/off action. Same thing occurs when controlling the three items with a scene. When the plugin sends its commands, is it only able to send one command at a time to the switch?

I've considered an SSH solution but don't have enough knowledge about it to put a dent in that plan. This plugin is much more elegant but I'm having this one tiny snafu.

Thanks for considering and thank you for the plugin.

Error 401 even though working fine

Everything working as expected, although im getting this through my logs:

Request-Error proxy/network/api/s/default/stat/device Error: Request failed with status code 401

Any thoughts?

No Update on Connection

After Install, No Log Update containing PoE control, as well as no buttons added for remote control. Unable to see any errors or why the plugin is failing.

Configuration behavior question

First of all, thank you very much for this awesome plugin!
I ran into the problem that my web GUI configuration was overwritten by the plugin. E.g. I configured a port and shortly after toggled a PoE port with the Home app.
It seems that the plugin always sends the complete, cached port configuration of all switch ports instead of configuring the single port I modify PoE for. If the cached configuration is older than the actual configuration, web GUI modifications get overwritten.
Is it possible to configure only one single port instead of all ports, or does the API not allow for that?
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.