#gpsd

1 messages · Page 1 of 1 (latest)

silent ocean
#

How do i automate setting home location on gps update?

silent ocean
#

using gpsd integration i tried to set home location but i have no idea how to reference the proper values

thorny flame
silent ocean
#

yes

thorny flame
#

yaml of the action:

action: homeassistant.set_location
metadata: {}
data:
  latitude: "{{states('sensor.latitude')|float}}"
  longitude: "{{states('sensor.longitude')|float}}"
#

change states('sensor.latitude') to whatever is needed to get your actual value obviously

silent ocean
#

perfect

#

can i get a city or state on the dashboard now?

#

also the timezone

thorny flame
#

not directly but you might be able find a integration/card that looks up that info based on home location.
system timezone is also set independently of location

silent ocean
#

even the weather things

#

thanks youve been great

thorny flame
# silent ocean thanks youve been great

no worries, i hope you get it working the way you want it to. i have been looking up if theres an easy way to automate timezone changes but it doesnt seem like there is a way

#

you might be able to do it on command line then set a shell command integration to do it. but that feels messy and i am not sure how reliable it would be

#

its an interesting problem but realistically... its not really designed for this 😛

silent ocean
#

ok forget HA, how do i get the rasberrypi to update its system clock

thorny flame
silent ocean
#

container

thorny flame
#

in your compose file your using:
- /etc/localtime:/etc/localtime:ro
i assume which makes it inherit from the host OS

#

on hacs there is an intergration called "SSH" which allows you to send ssh commands.
so you could have it depend a command to the host system via ssh

#

then you would send something like
sudo timedatectl set-timezone Europe/London
you might have to then restart the ha container though. I am not really sure

#

although you will have to tackle the password for sudo

#

echo "<your_password>" | sudo timedatectl set-timezone Europe/London
would work i guess although maybe a little insecure...

#

although you will still have to work out the timezone somehow

silent ocean
#

sounds fun, i'll see about it later

thorny flame
#

yeah indeed, although not a direct solution i hope i have pushed you in a direction that may lead to getting it working.

silent ocean
#

yes probably

#

docker still running as root