how to extract only the last 3 digits of %ip%
Moderators: grovkillen, Stuntteam, TD-er
how to extract only the last 3 digits of %ip%
Hi,
What is the easiest way to extract the last 3 digits of %ip%? (so I can display in a 4 digit 7seg led)
Thanks
Ken
What is the easiest way to extract the last 3 digits of %ip%? (so I can display in a 4 digit 7seg led)
Thanks
Ken
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: how to extract only the last 3 digits of %ip%
%ip4%
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: how to extract only the last 3 digits of %ip%
Hi @grovkillen,
Must be magic, it just works, so simple! I was thinking something complex like putting it in as a variable and using substrings, mid functions in rules (if espeasy has those functions).
Now I can have low costs tm1637 in all my espeasy to show the ip without having to use fing or interrogate the router.
What other magic tricks you have?
Merry Christmas and Happy New Year to you and all in the forum!
Thanks,
Ken
Must be magic, it just works, so simple! I was thinking something complex like putting it in as a variable and using substrings, mid functions in rules (if espeasy has those functions).
Now I can have low costs tm1637 in all my espeasy to show the ip without having to use fing or interrogate the router.
What other magic tricks you have?
Merry Christmas and Happy New Year to you and all in the forum!
Thanks,
Ken
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: how to extract only the last 3 digits of %ip%
Merry Christmas! 

ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: how to extract only the last 3 digits of %ip%
Hi,
Works when I type the the cmd 7dn,%ip4% on the web interface, however with the rule it does not work:
on system#boot do
Pulse,2,0,1000
7dn,%ip4%
endon
The idea is of course to display the last ip oclet on start. Am I missing something?
Environment:
Unit: 5
GIT version: mega-20181216
Local Time: 2018-12-17 09:33:15
Uptime: 0 days 0 hours 6 minutes
Load: 14.90% (LC=6706)
Free Mem: 7592 (6184 - sendContentBlocking)
Free Stack: 3584 (1732 - parseTemplate3)
IP: 192.168.20.112
Wifi RSSI: -64 dB (hg566)
HW: Wemos d1 mini
Thanks,
Works when I type the the cmd 7dn,%ip4% on the web interface, however with the rule it does not work:
on system#boot do
Pulse,2,0,1000
7dn,%ip4%
endon
The idea is of course to display the last ip oclet on start. Am I missing something?
Environment:
Unit: 5
GIT version: mega-20181216
Local Time: 2018-12-17 09:33:15
Uptime: 0 days 0 hours 6 minutes
Load: 14.90% (LC=6706)
Free Mem: 7592 (6184 - sendContentBlocking)
Free Stack: 3584 (1732 - parseTemplate3)
IP: 192.168.20.112
Wifi RSSI: -64 dB (hg566)
HW: Wemos d1 mini
Thanks,
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: how to extract only the last 3 digits of %ip%
Just as a test, try to have a timer in the boot event block that is set to 10 seconds. When the timer run out, set the text. It could be that the system variable is not set at the boot event.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: how to extract only the last 3 digits of %ip%
Yep works with a timer delay, got it down to timer delay of 3 sec or more works, but under 3 secs does not work.
Thanks
Thanks
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: how to extract only the last 3 digits of %ip%
Yep, makes sense since you haven't connected to the WiFi until after those 3 seconds.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: how to extract only the last 3 digits of %ip%
I was not thinking as fast as you!
Thanks and have a good holiday, you deserve one.
Ken,
NZ
Thanks and have a good holiday, you deserve one.
Ken,
NZ
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: how to extract only the last 3 digits of %ip%
Thank you! Same to you.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Who is online
Users browsing this forum: Bing [Bot] and 22 guests