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

homeassistant

12084 readers
6 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 1 year 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@lemmy.world 3 points 1 year 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@lemmy.world 1 points 1 year 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

[–] mlaga97@lemmy.mlaga97.space 1 points 1 year ago

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

[–] solidgrue@lemmy.world 0 points 1 year 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.