-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WAN IP[Question] #308
Comments
that really depends on your network setup. it could be under interface you use for outside traffic. |
You could use an existing integration- https://www.home-assistant.io/integrations/dnsip/ Another option would be to enable the IP/Cloud functionality (which is MT's native dynamic DNS service-free), which tracks your external IP as a property you can query with a script as:
You would need to determine how you want to handle this- it could behave as a function just returning text for example, that you parse as a template sensor, and have the Script option in the Integration enabled so you can trigger that as a switch. It would probably be better to have the integration here do the lookup- where if Cloud was enabled, this value would be returned, since there could be more flexibility if there were multiple links, or if you wanted to have HA updated if the external IP changed etc. |
I mean, maybe? I will have to look up what /ip cloud is even about. |
Many thanks so far guys. I appreciate all the options. I was looking for it in the mikrotik integration and never thought about an option to let another integration check the IP and send it. I guess it's even allot easier this way. I'm no mikrotik pro so writing scripts and stuff isn't really an option for me. It also isn't a big problem though I can try to get the IP from another integration. I do however have some problems with entities doing nothing in the integration and other entities that are becoming unavailable. But I think that's something for another time (thread) |
certainly, if there is a problem you notice, let me know. I'm transitioning my integration to new model to take advantage of all new HA features, so there may be some issues. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This issue was closed because it has been stalled for 5 days with no activity. |
@sygys It is certainly possible to create a script for the WanIP in the environment. @tomaae is right in this one. When the environment variable is set, the MikroTik Router Integration automatically picks it up. He is also right when it depends on the set up you have. In my case I have the MikroTik Router as a switch connected on the ISP browser. I my case the script is quite easily applied. In routerOS go to System -> Script, than add a script. The script I use to set the environmental variable wanIP: :global wanIP; On the dots of interface enter the name of the interface which is connected to your ISP. Then test the script by clicking Run Script. In the tab Environment you should no see the declare variable with the IP-address as it's value. If did not work, locate the desired variable and test reading this variable in the terminal using the MikroTik scripting. Then it helps to set a schedule to run the script at the desired interval. Go to System -> Scheduler and add a schedule. Simple add in the On Event section: /system script run ... Enter the name of your scripts on the dots. You can set the start time on startup and the interval. More on MikroTik scheduling. Hope it helps. |
Many thanks for this answer I will test this out. This would be awsome |
When testing I helped me to run the commands from the terminal in routerOS by using While working on my reply to you I tweaked my comment to get the address not from the IP Address List, but directly from the IP DCHP-client list. You can use the following command: |
Is there a way to get the WAN ip in home assistant? I have an automation to check if the connection is lost or when ha reboots and send me the latest ip address by telegram when connection is restored. In the Fritzbox integration there was a way to get this ip. I can't find it in the mikrotik integration. Is there a way?
The text was updated successfully, but these errors were encountered: