DaveGut / HubitatActive

Hubitat Environment Developments
64 stars 87 forks source link

KasaDevices does not support larger than /24 subnets #15

Closed sfabel closed 2 years ago

sfabel commented 2 years ago

In my home, I have assigned 10.0.0.0/8 to my IoT network and the DHCP address range spans across all of these addresses. The way KasaDevices is constructing the hosts to scan when adding devices is such that it is impossible to enter values into the "Lan Segments" and "Host Address Range" fields that would properly construct a class A network address to scan for in the findDevices() function.

I am not familiar enough with Groovy to go ahead and just adjust this myself, but it seems to me that allowing to scan a network based on the network and a mask would solve this problem?

DaveGut commented 2 years ago

I support Class C networks only. Time to scan a class A network could be impossibly excessive. Assuming the final format for the address is AAA.BBB.CCC.DDD, you could install a device at a time using segment = AAA.BBB.CCC and host range = DDD, DDD. Will look for one device.

UPDATE: Another method is to use the Kasa Cloud to discover the devices. That returns the IP address to the app and when installed, sets the IP address.

sfabel commented 2 years ago

Thanks. It times out for me when trying to discover using CLOUD.

2021-11-03 03:08:38.569 pm errorjava.net.SocketTimeoutException: Read timed out on line 862 (method addDevicesPage)

DaveGut commented 2 years ago

Can not duplicate. This is code that has been in effect for 4 years.

Provide me with the log for the app only.

DaveGut commented 2 years ago

Closed. No further activity and I can not do the code to repair.