UniFi devices communicate to their controller via HTTP POST as
application/x-binary containing it's current status every ~10 seconds to the
inform URL defaults to
http://unifi:8080/inform but may be set to the controller's IP address.
A controller will respond with either a no-op and an interval for the next inform or command for the device to execute.
A UniFi device will execute commands and send another inform packet.
Requests and responses share the same format encoded in big endian byte order.
When reading, inform packets are decrypted before decompression, inverse is true for writing.
There is currently only one payload version. Payload version 1 is JSON content and is the current version.
There are two possible ciphers used to encrypt the inform payload.
Although you can send the controller plain-text, it will not respond to non-encrypted payloads.
AES-CBC is used, and is the default, if the
1st-bit is set on the flag, or
AES-GCM if the
4th-bit are set.
The Initialization Vector is 16 bytes in length and is sent in the header.
The default encryption
authkey is the MD5 hash of
AES-GCM the first 40 bytes of the packet is used as the additional authenticated data (AAD) and the last 16 bytes of the payload is the tag.
|0-3||u32||Magic Header (|
|8-13||[u8; 6]||Hardware Address|
|16-31||[u8; 16]||Initialization Vector for encryption|