Hi there,
I’m running a pretty complex home assistant setup in my RV and I have home assistant already updating the home location dynamically via a usb dongle on my router, but it seems you can only set lat and long and no other parameters like the elevation… I would like to update the elevation as well so I can use it for some automations… for example control the fuel mix on my diesel heater and a bunch of other fun things. Any chance this can be done?
Don’t forget to vote for your own WTH…
Thank you
@gradeloff Could you share how you update your lat/long location? I am trying to get my RV setup going and would love to automate that from my GPS.
Hello, sure:
So I have a usb dongle plugged into my router and installed gpsd on the router (I run rooter firmware, a version of openwrs) and then I added the gpsd sensor in my Homeassistent config file. Then I have a automation that every minute or so does this:
service: homeassistant.set_location
data:
latitude: "{{ state_attr('sensor.truck_location', 'latitude') }}"
longitude: "{{ state_attr('sensor.truck_location', 'longitude') }}"
Also added a condition to only run it if the GPS location is mode 3 (full 3d location lock) otherwise it occasionally writes location to 0 if the dongle has no lock
Interesting, another fulltimer here.
Did you consider using directly the altitude from the GPS sensor?
BTW, to update the location of my RV I don’t use an additional GPS dongle, but I get the coordinates from the android tablet already installed in my RV as a dashboard, infotainement, etc.
Here is my pretty simple automation:
alias: RV location update
description: ""
trigger:
- platform: numeric_state
entity_id: device_tracker.ags2_l09
for:
hours: 0
minutes: 1
seconds: 0
attribute: speed
above: 10
condition: []
action:
- service: homeassistant.set_location
data:
latitude: "{{ state_attr('device_tracker.ags2_l09', 'latitude') | round(4) }}"
longitude: "{{ state_attr('device_tracker.ags2_l09', 'longitude') | round(4) }}"
mode: single
Hi @gradeloff
I am looking at the same solution you do inregard with setting HA Altitude parameter, have you ever found a way to do this ?
Thanks