Skip to content

cirola2000/Unifi-Java-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unifi Java API

Java API for communication with Ubiquiti UniFi devices.

##Simple example: The following example creates a new connection to the UniFi controller and retrieves a list of users and all devices connected in the last hour.

	public static void list() {
	  // Creating a connection with the UNIFI controller
		UnifiAPI unifi = new UnifiAPI("10.40.0.3", 8443, "admin", "");
		try {
			unifi.connect();
			
			// printing all client hostnames connected in the last hour
			List<ClientDevice> listClients = unifi.getClients().getAllClientsNh(1);

			int i = 0;
			for (ClientDevice client : listClients) {
				System.out.println((i++) + " " + client.getHostname());
			}

      			// printing all devices IP
			List<UnifiAccessPoint> listDevices = unifi.getDevices().getAllDevices();
			for (UnifiAccessPoint device : listDevices) {
				System.out.println(device.getNetworkConfiguration().getIp());
			}

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

About

Java wrapper for communication with UNIFI devices.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages