# Monitor external ip and warn ik changed

**URL:** <https://community.homey.app/t/monitor-external-ip-and-warn-ik-changed/90781>\
**Category:** Questions & Help\
**Created:** [October 2, 2023, 4:35pm UTC](https://community.homey.app/t/monitor-external-ip-and-warn-ik-changed/90781 "2023-10-02T16:35:00Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [October 4, 2023, 2:46pm UTC](https://community.homey.app/t/monitor-external-ip-and-warn-ik-changed/90781/10 "2023-10-04T14:46:21Z")

</div>

Update:  
A little improvement.  
While the filter `slice(2, 15)` is not flexible, I found a way to ensure the IP only is returned, no matter the number of digits:

```auto
var response = args[0];
// A) while the - symbol is (while the returned data doesn't change)
// the first one, and close to the actual IP address,
// we select the string following the - symbol. 
// B) when the IP has less than 12 digits, remove trailing HTML code "</"
var myIP = '' + response.split("-")[1].slice(2).split("<")[0];

console.log('args: ', args[0]);

return myIP;

```

* * *

> [@Eternity](#):
>
> Only thing I missed was the . at the end

So recognizable 😜 I don’t know how many days I’ve spend in total to find out about a missing `}``.``)` or the like. My urge to get it working helps, but oh I have given up on many scripts as well 🤣

---

_[View the full topic](https://community.homey.app/t/monitor-external-ip-and-warn-ik-changed/90781)._
