Tracking the current ISP
In our RV, we are using a Unifi Ultra Gateway that has multi-wan support. I am using two Invisagig modems, one tied to Verizon, the other AT&T. I like to monitor which ISP we are using since once can be set as primary, and the other secondar/failover. I use this to notify me if the primary source is not being used for longer than a few minutes. LTE/5G has a few drops, failover is great, but if it does not switch back I would like to look into it.
This setup will work if you are using other common RV internet solutions like Starlink, T-Mobile Home Internet, or anything else.
ipify, a free service allows you to get the the details of your IP address, including the ISP.
Node Red
I am using Node-Red to make the simple API call, parse out the information I want, clean up the response and pass the result over to Home Assistant.
Below is my current Node Red flow
1
[{"id":"9729b2658b40c84f","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"149f569ce70c0c1d","type":"inject","z":"9729b2658b40c84f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"15","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":60,"wires":[["2b7ba9a54faadb89"]]},{"id":"2b7ba9a54faadb89","type":"http request","z":"9729b2658b40c84f","name":"IP Address","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://api.ipify.org","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":270,"y":60,"wires":[["94585df7ef809f0c"]]},{"id":"f710be84c0fe0eb3","type":"http request","z":"9729b2658b40c84f","name":"ISP Lookup","method":"GET","ret":"txt","paytoqs":"body","url":"{{{payload}}}","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":570,"y":60,"wires":[["839331c23af52e03"]]},{"id":"94585df7ef809f0c","type":"function","z":"9729b2658b40c84f","name":"Combine","func":"// Assuming msg.payload contains the original data\n// And you want to append some static text, e.g., \" is awesome\"\n\nmsg.payload = \"http://ip-api.com/json/\" + msg.payload;\n\n// This will append \" is awesome\" to the existing payload\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":420,"y":60,"wires":[["f710be84c0fe0eb3"]]},{"id":"839331c23af52e03","type":"json","z":"9729b2658b40c84f","name":"","property":"payload","action":"","pretty":false,"x":710,"y":60,"wires":[["4d830ec3f0a0e8f8","f445da93e4ab0ef0","476e240afb74ec0b"]]},{"id":"4d830ec3f0a0e8f8","type":"change","z":"9729b2658b40c84f","name":"ISP Name","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.isp","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":60,"wires":[["c5e0adf9566cd422"]]},{"id":"3855887513920495","type":"ha-sensor","z":"9729b2658b40c84f","name":"Current ISP","entityConfig":"c66fce9bfe4ea5e3","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1310,"y":60,"wires":[[]]},{"id":"c5e0adf9566cd422","type":"switch","z":"9729b2658b40c84f","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"Verizon","vt":"str"},{"t":"cont","v":"AT","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":970,"y":60,"wires":[["6ac243e27c363220"],["9b75a567e3bb3b85"]]},{"id":"6ac243e27c363220","type":"change","z":"9729b2658b40c84f","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Verizon","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1120,"y":40,"wires":[["3855887513920495"]]},{"id":"9b75a567e3bb3b85","type":"change","z":"9729b2658b40c84f","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"AT&T","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1120,"y":80,"wires":[["3855887513920495"]]},{"id":"f445da93e4ab0ef0","type":"change","z":"9729b2658b40c84f","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.regionName","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":120,"wires":[["92c910ba48703648"]]},{"id":"476e240afb74ec0b","type":"change","z":"9729b2658b40c84f","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.city","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":160,"wires":[["61e62c3910ca828c"]]},{"id":"92c910ba48703648","type":"debug","z":"9729b2658b40c84f","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1060,"y":120,"wires":[]},{"id":"61e62c3910ca828c","type":"debug","z":"9729b2658b40c84f","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1060,"y":160,"wires":[]},{"id":"c66fce9bfe4ea5e3","type":"ha-entity-config","server":"f702e938.50a63","deviceConfig":"","name":"sensor config for Current ISP","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Current ISP"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"f702e938.50a63","type":"server","name":"Home Assistant","addon":false,"rejectUnauthorizedCerts":false,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"","statusSeparator":"","enableGlobalContextStore":false}]
This will output a sensor in Home Assistant called sensor.current_isp
that I display on my dashboards and use in automations.