Code Monkey home page Code Monkey logo

unifi-device-info's Introduction

Unifi AP Device info

Provide Unifi device info via api to Home Assistant that will give ap sensors

Thanks to valvex, https://community.home-assistant.io/t/monitoring-your-unifi-ap/259703 for giving the base for this.

To get started download, you must have https://github.com/custom-components/sensor.unifigateway install and working

The code above can be used with standalone as with https://github.com/finish06/pyunifi

Made to work with newer UnifiOS

Will give you a card as below:

ap switch

Scripts

Create a folder scripts in your config folder and copy the unifi_ap.py and/or unifi_switch.py into the folder. Edit with details in the section with your details:

 - `host`       -- the address of the controller host; IP or name
 - `username`   -- the username to log in with
 - `password`	-- the password to log in with
 - `version`	-- the base version of the controller API [v4|v5|unifiOS|UDMP-unifiOS]
 - `site_id`	-- the site ID to access
 - `port`       -- the port of the controller host
 - `verify_ssl`	-- Verify the controllers SSL certificate, default=True, can also be False or "path/to/custom_cert.pem"
 - `target_mac` -- the mac address of your AP device

Sensor

For AP:

Copy the content of configuration_ap.yaml to 'configuration.yaml' under sensor.

For Switch:

Copy the content of configuration_switch.yaml to 'configuration.yaml' under sensor.

Card

To create the card, you will need https://github.com/benct/lovelace-multiple-entity-row and https://github.com/kalkih/mini-graph-card

For AP:

card_ap.yaml can be copied to a manual card in the frontend to create card as per image above.

For Switch:

card_switch.yaml can be copied to a manual card in the frontend to create card as per image above.

Reboot command

shell_command.reboot_unifi_ap can be created via https://github.com/stevejenkins/unifi-linux-utils/blob/master/uap_reboot.sh, change uap_list to only the ip of the device.

Then adding to configuration.yaml under shell_command:

shell_command:
  reboot_unifi_ap: bash /config/shell/unifi_ap_reboot.sh

PS: command works via host, but not in home assistant. Will have to figure this out. Needs sshpass in home assistant

When you have more than one ap/switch

Duplicated as needed per ap and change unifi_ap to either ap name or unifi_ap1 an unifi_ap2

Duplicated as needed per ap and change unifi_switch to either ap name or unifi_switch1 an unifi_switch

Remember then to update the sensor and card accordingly

unifi-device-info's People

Contributors

w1tw0lf avatar

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.