Skip to content
A Unifi Controller device status to mqtt bridge process
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.travis.yml
Dockerfile.template
LICENSE.md
Makefile
README.md
bridge.go
client.go
config.go
go.mod
go.sum
interfaces.go
main.go
mqttClient.go
wire.go
wire_gen.go

README.md

unifi2mqtt

An experiment to publish device statuses from the Unifi Controller to MQTT.

Software License Travis CI Coverage Status Go Report Card

Installation

Via Docker

docker run -d --name="unifi2mqtt" -v /etc/localtime:/etc/localtime:ro mannkind/unifi2mqtt

Via Make

git clone https://github.com/mannkind/unifi2mqtt
cd unifi2mqtt
make
./unifi2mqtt

Configuration

Configuration happens via environmental variables

UNIFI_HOST              - The hostname of the controller, defaults to "unifi.local"
UNIFI_PORT              - The the port of the controller, defaults to "8443"
UNIFI_SITE              - The site of the controller, defaults to "default"
UNIFI_USERNAME          - The username used to access the controller, defaults to "unifi"
UNIFI_PASSWORD          - The password used to access the controller, defaults to "unifi"
UNIFI_AWAYTIMEOUT       - The timeout before marking a device as away, defaults to "5m"
UNIFI_LOOKUPINTERVAL    - The interval to lookup devices on the controller, defaults to "10s"
UNIFI_DEVICEMAPPING     - The map of mac addresses to names, defaults to "11:22:33:44:55:66;MyPhone,12:23:34:45:56:67;AnotherPhone"
MQTT_TOPICPREFIX        - [OPTIONAL] The MQTT topic on which to publish the collection lookup results, defaults to "home/unifi"
MQTT_DISCOVERY          - [OPTIONAL] The MQTT discovery flag for Home Assistant, defaults to false
MQTT_DISCOVERYPREFIX    - [OPTIONAL] The MQTT discovery prefix for Home Assistant, defaults to "homeassistant"
MQTT_DISCOVERYNAME      - [OPTIONAL] The MQTT discovery name for Home Assistant, defaults to "unifi"
MQTT_CLIENTID           - [OPTIONAL] The clientId, defaults to "DefaultUnifi2MqttClientID"
MQTT_BROKER             - [OPTIONAL] The MQTT broker, defaults to "tcp://mosquitto.org:1883"
MQTT_USERNAME           - [OPTIONAL] The MQTT username, default to ""
MQTT_PASSWORD           - [OPTIONAL] The MQTT password, default to ""
You can’t perform that action at this time.