When your home is constantly on the move, keeping your smart home system updated with your current location can be a challenge. Here’s a simple yet effective automation we use to keep our Home Assistant instance aware of our sailboat’s location:

alias: Set Location
trigger:
  - platform: time_pattern
    minutes: /15
action:
  - data_template:
      latitude: "{{ states('sensor.victron_gps_latitude_100') }}"
      longitude: "{{ states('sensor.victron_gps_longitude_100') }}"
    action: homeassistant.set_location
mode: single

This automation does something simple but crucial: every 15 minutes, it updates Home Assistant’s location with the current GPS coordinates from our Victron system using a cheap USB GPS dongle.

You could also use ESPHome for the job if you’re not into Victron gear.

Why is this important? It allows location-based integrations to work correctly, even as we sail to new destinations. Some key benefits include:

  • Accurate Weather Data: Weather integrations can provide forecasts for our current location.
  • Lightning Alerts: Our Blitzortung integration can warn us about nearby lightning strikes based on our actual position.
  • Geofencing: We can set up automations that trigger when we enter or leave certain areas.
  • Sunrise/Sunset Calculations: Accurate location data ensures that time-based automations using sunrise or sunset triggers work correctly.

By keeping our smart home’s location synchronized with our actual position, we ensure that all our automations and integrations work seamlessly, whether we’re docked in our home port or exploring a remote anchorage.

Remember, the key to a truly smart sailboat is not just having advanced systems, but ensuring they all work together harmoniously – and knowing where you are is the first step!

By Romain

Leave a Reply

Your email address will not be published. Required fields are marked *