this post was submitted on 25 Jun 2023
9 points (100.0% liked)

homeassistant

12280 readers
330 users here now

Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Available for free at home-assistant.io

founded 2 years ago
MODERATORS
 

What’s the best way that people have found to get their public IP address into Home Assistant? It’d be useful to run an automation to send a notification when it changes.

top 4 comments
sorted by: hot top controversial new old
[–] AwkwardPenguin 6 points 2 years ago

sensor:

  • platform: dnsip

group: External IP: - sensor.dnsip

automation: alias: Notify when external ip changes initial_state: on trigger: platform: state entity_id: sensor.dnsip action: service: notify.YOU data_template: message: "New external IP address is {{ states('sensor.dnsip') }}"

Here you go.

Source: https://community.home-assistant.io/t/display-public-ip-notify-of-change/74655

[–] Falmarri 3 points 2 years ago

If your use case is to access your home assistant from external, I highly suggest cloudflare tunnels. https://community.home-assistant.io/t/new-add-on-cloudflared/361637/10

[–] [email protected] 3 points 2 years ago

The "DNS IP" integration will give you your public IP address.

[–] solidgrue 1 points 2 years ago

Maybe not the best way, but I set up a Node RED work flow to query the API at ip.me every few minutes for my v4 and v6 addresses, and update sensors in HA.