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

Overview

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

You might also like...
Switch predictor for Home Assistant with AppDeamon

Home Assistant AppDeamon - Event predictor WORK IN PROGRESS - CURRENTLY NOT COMPLETE AND NOT WORK This is an idea under development (when I have free

Uses the Duke Energy Gateway to import near real time energy usage into Home Assistant
Uses the Duke Energy Gateway to import near real time energy usage into Home Assistant

Duke Energy Gateway This is a custom integration for Home Assistant. It pulls near-real-time energy usage from Duke Energy via the Duke Energy Gateway

Custom component for Home Assistant that integrates Candy/Haier Wi-Fi washing machines (also known as Simply-Fi).

Candy Home Assistant component Custom component for Home Assistant that integrates Candy/Haier Wi-Fi washing machines (also known as Simply-Fi). This

emhass: Energy Management for Home Assistant
emhass: Energy Management for Home Assistant

emhass EMHASS: Energy Management for Home Assistant Context This module was conceived as an energy management optimization tool for residential electr

 Python script: Enphase Envoy mqtt json for Home Assistant
Python script: Enphase Envoy mqtt json for Home Assistant

A Python script that takes a real time stream from Enphase Envoy and publishes to a mqtt broker. This can then be used within Home Assistant or for other applications. The data updates at least once per second with negligible load on the Envoy.

Electrolux Pure i9 robot vacuum integration for Home Assistant.

Home Assistant Pure i9 This repository integrates your Electrolux Pure i9 robot vacuum with the smart home platform Home Assistant. The integration co

Connect a TeslaMate instance to Home Assistant, using MQTT

TeslaBuddy Connect a TeslaMate instance to Home Assistant, using MQTT. It allows basic control of your Tesla vehicle via Home Assistant (currently, ju

Baseline model for Augmented Home Assistant

Dataset Preparation Step 1. Rename the Virtual-Home output directory to 'vh.[name]', for example: 'vh.door' Make sure the directory contains 100+ fram

Better support for Nuki devices to the Home Assistant
Better support for Nuki devices to the Home Assistant

Another attempt to add a better support for Nuki devices to the Home Assistant Features: Lock interface implementation Uses local webhook from bridge

Comments
  • Device info

    Device info

    @w1tw0lf which info are you looking for? if you pull the device-info you'll get a huge json file with all device information. just let me know maybe I can code something quickly.

    opened by phen0 15
  • Script fails since HA update

    Script fails since HA update

    Script stopped working for me since the latest HA major update:

    `Logger: homeassistant.components.command_line Source: components/command_line/init.py:44 Integration: command_line (documentation, issues) First occurred: 1. Juli 2022 um 18:27:37 (462 occurrences) Last logged: 09:49:40

    Command failed: python3 /config/scripts/unifi_ap.py`

    opened by nightfever77 1
Owner
null
Automate gate/garage door opening via 433.92MHz emitter with Raspberry Pi, Home Assistant and Homekit.

Automate opening your garage door / gate Summary This project sums up how I automated opening my garage door using a Raspberry PI, a 433Mhz emitter, H

Julien Fouilhé 29 Nov 30, 2022
Home Assistant integration for energy consumption data from UK SMETS (Smart) meters using the Hildebrand Glow API.

Hildebrand Glow (DCC) Integration Home Assistant integration for energy consumption data from UK SMETS (Smart) meters using the Hildebrand Glow API. T

Aniket 153 Dec 30, 2022
Resmed_myair_sensors - This is a Home Assistant custom component to pull daily CPAP data from ResMed's myAir service using an undocumented API

resmed_myair This component will set up the following platforms. Platform Description sensor Show info from the myAir API. Installation Using the tool

Preston Tamkin 17 Dec 29, 2022
Monitor an EnvisaLink alarm module running Honeywell firmware, and set a Nest device to Home/Away depending on whether the alarm is Disarmed/Away.

Nestalarm Monitor an EnvisaLink alarm module running Honeywell firmware, and set a Nest device to Home/Away depending on whether the alarm is Disarmed

null 1 Dec 30, 2021
Universal Xiaomi MIoT integration for Home Assistant

Xiaomi MIoT Raw 简体中文 | English MIoT 协议是小米智能家居从 2018 年起推行的智能设备通信协议规范,此后凡是可接入米家的设备均通过此协议进行通信。此插件按照 MIoT 协议规范与设备通信,实现对设备的状态读取及控制。

null 1.9k Jan 2, 2023
Volkswagen ID component for Home Assistant

Volkswagen ID component for Home Assistant This folder contains both a generic Python 3 library for the Volkswagen ID API and a component for Home Ass

null 55 Jan 7, 2023
Sensor of Temperature Feels Like for Home Assistant.

Please ⭐ this repo if you find it useful Sensor of Temperature Feels Like for Home Assistant Installation Install from HACS (recommended) Have HACS in

Andrey 60 Dec 25, 2022
Home Assistant custom integration for e-distribución

e-Distribución is an energy distribution company that covers most of South Spain area. If you live in this area, you probably are able to register into their website to get some information about your power demand, energy consumption, or even cycle billing (in terms of consumptions).

VMG 17 Sep 7, 2022
Home Assistant custom integration for Yi cameras: yi-hack-MStar, yi-hack-Allwinner and yi-hack-Allwinner-v2

yi-hack Home Assistant integration Overview yi-hack Home Assistant is a custom integration for Yi cameras (or Sonoff camera) with one of the following

roleo 131 Jan 3, 2023
Интеграция Home Assistant с ЛК "Интер РАО"

ЕЛК ЖКХ «Интер РАО» для Home Assistant Предоставление информации о текущем состоянии ваших аккаунтов в ЕЛК ЖКХ. Введение @ TODO @ Установка Посредство

Alexander Ryazanov 27 Nov 5, 2022