New Version of Can't Find My Hub

I've got a C5 that I'm trying to find and setup. I've struck out in finding the hub via all the ways -- hitting the Hubitat find button, mDNS, MAC (which I have) -- and I can't get the IP address.

I suspect that the root cause problem is that I'm an idiot. This was a hub I had setup in another home using a reserved IP address. I didn't bother to wipe or factory reset the hub before bringing it here and plugging it in. The LED is green. But I can't find it?

BTW the reason I can't find the IP address is because I'm one of the many Orbi mesh users (RBR750 and RBR850) who haven't had working router software for months. Supposedly Netgear is working on it. Uh huh.

Any suggestions on how to find my hub in the meantime. I'm thinking I could bring it back to the first house, factory reset it, and then come back here. Problem is, the 2 homes are a thousand miles apart so...

Do you have a spare router you could connect the hub and one laptop to? You might be able to at least set the hub back to DHCP that way before putting it back onto the main network (connect the hub first). Though I think there is supposed to be a network reset button on the hub somewhere. Not checked on mine and I can't reach it right now

great idea, but I don't

I just edited to add I think there is a network reset button on the hub I seem to remember. Ah found the thread! Static IP address Recovery Options - No Button, No Hard Reset - #2 by bertabcd1234

1 Like

Do you have another hub running on the same LAN? If so, I have an idea...

YES it is #curious

EDIT: Actually the suggestion from @Inge_Jones solved it! Press the network reset button on the underneath side of the hub (never knew it was there) did the trick. You have to hold it for 7 seconds, according to the Hubitat documentation. Nonetheless, @thebearmay, you've got me intrigued. What was your idea?

Need to find it, but somewhere I have a code snippet that if I remember correctly will pull back the IP from a MAC address.

Havenโ€™t found the code I was looking for, but here is a brute force method that should eventually (about 5-7 minutes) bring back all hubs on the LAN segment:

Find Hub IP
 /*

 */
import groovy.json.JsonSlurper

@SuppressWarnings('unused')
static String version() {return "0.0.0"}

metadata {
    definition (
        name: "Find Hub IP", 
        namespace: "thebearmay", 
        author: "Jean P. May, Jr.",
        importUrl:"https://raw.githubusercontent.com/thebearmay/hubitat/main/xxxx.groovy"
    ) {
        
        
        capability "Actuator"
        attribute "hubList", "string"
        attribute "ipList", "string"
        attribute "status", "string"

        command "findIP"

    }   
}

preferences {


}

@SuppressWarnings('unused')
def installed() {

}
void updateAttr(String aKey, aValue, String aUnit = ""){
    sendEvent(name:aKey, value:aValue, unit:aUnit)
}

def findIP(){
    netBase=location.hub.localIP
    bp=netBase.lastIndexOf(".")
    netBase=netBase.substring(0,bp+1)
    ipList = []
    updateAttr("ipList", "[]")
    updateAttr("status","running")
    updateAttr("hubList","[]")
    for(int i=2; i<254; i++){
        serverAddr="$netBase$i"
        hubitat.helper.NetworkUtils.PingData pingData = hubitat.helper.NetworkUtils.ping(serverAddr, 1)
        pingDataS = pingData.toString()
        pLoss = pingDataS.substring(pingDataS.lastIndexOf(":")+1,pingDataS.length()-1).toInteger()
        if(pLoss == 0) {
            ipList.add(serverAddr)
            checkForHub(serverAddr)
        }
        if(i%20==0) updateAttr("status", "running..$i")
    }
    updateAttr("status", "complete")
    updateAttr("ipList", ipList)
 
}

def checkForHub(ipAddr){
    Map params = [
        uri    : "http://$ipAddr:8080/hub2/hubData"
    ]
    if (debugEnable) log.debug params
    asynchttpGet("getHubData", params, [ip:ipAddr])
}

void getHubData(resp, data){
    try{
        if (resp.getStatus() == 200){        
            def jSlurp = new JsonSlurper()
            Map h2Data = (Map)jSlurp.parseText((String)resp.data)
            work=device.currentValue("hubList",true)
            work=work.substring(0,work.length()-1)
            if(work.length() > 1 && h2Data.name != null)
            work+=", $h2Data.name:${data['ip']}]"
            else
                work+="$h2Data.name:${data['ip']}]"
            updateAttr("hubList",work)
        }
    } catch (Exception ex){
        if (!warnSuppress) log.warn ex
    }
}               

1 Like