I have a rental house with a v2 hub in it. A few days ago the DDNS service on a different device quit working, and I no longer can find the IP the router currently has.
I was hoping to build a quick SA or DT that would allow me to simply send a REST command to an outside web server that would return the JSON encoded IP. I’ve tried using HubAction, but nothing ever seems to happen. The web server logs show no connection, and parse() never gets called. I would even settle for creating the connection from the hub to the web server and then manually checking the web server logs on the receiving end for the IP, but would prefer to get the IP back and display it in the DT or SA.
All of the documentation I’ve found on this site show that this should work, but I’ve found several posts that indicate it was broken by the v2 platform changes last fall.
Is there an alternative to doing what I want to do? Thanks for any insight.
Go to my github.com/ady624 in the HomeCloudHub repository, under smart apps, that app uses lots of them. Look through the source code. Currently driving, can help more when I land home. Sorry, arrive :))
Officer pulls over a speeding Ferrari. What’s wrong officer? Was I going too fast? Oh no, not at all, but you were flying too low…
Oh I see where the problem is. You want to figure out your external IP… Find a non-password-protected page on your router that gives you the broadband status and use HubAction on it, then try to parse the return to extract the IP?
Yeah, so doing httpGet or some of those other methods doesn’t work, the request comes from the cloud. I really need the request to come from the hub, but I need for it to hit an external IP in order to do so.
I played around with a few things I saw in your code, like using httpGet from within a sendHubCommand, but even though the request gets sent, it still comes from the cloud and not the hub.
Perhaps there’s a better way to get the public IP than what I’m trying, and I’d certainly try any other suggestions.
I like that idea, but I’m pretty sure all of the pages on the router are protected, and without something to hit against and play, I can’t get anywhere there.
A LAN device like a ddwrt router, a raspberry pi, a Synology NAS can provide you with the means to use HubAction… They would check your external IP for you…
I’m trying to get my HubAction to return something, then I’ll see if I can find a public page on my router. I’m apparently not writing this device type properly, however. Can you just look this over and see if you see any glaring mistakes? The parse function never gets called:
I don’t know if the router will respond to non-https requests, so that could possibly be the underlying issue. As long as there’s nothing glaringly wrong with the code, I’ll keep trying.
No dice. I’ve also tried a few other IPs on the network that may be running web servers as well, nothing calls the parse method, which I assume means nothing is responding, or something isn’t right with my device type.
May just have to give up and wait until I physically get up there to fix things.