Can't set Home zone

I’m running 0.98 and I have the normal start of configuration.yaml

homeassistant:

Name of the location where Home Assistant is running

name: Home

Location required to calculate the time the sun rises and sets

latitude: 49.000
longitude: -97.000

Impacts weather/sunrise data (altitude above sea level in meters)

elevation: 233

I’d like to set a more accurate Home zone and tried to do this via configuration/Integrations/+/Zone
I set the name to Home, set Lat/Long and the radius to 50 (the main thing I wanted to fix, 100 gets nearly a block over)
But, when I hit save, I get “Name already exists”
This is the preferred place to setup zones, correct?

Has HA secretly setup a Home Zone and not told me about it? I did some grepping of the files but couldn’t find one.

You need to remove or comment out the zone settings in the configuration yaml in order to use the home zone in the GUI.

I checked, I don’t have any zones set in configuration.yaml.

bash-5.0# grep -i zone configuration.yaml
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: America/SomePlaceCool
  zonedump_interval: 30
  zones:
bash-5.0#

The last zones: belongs to my alarm system config.

No he means that you need to remove the latitude/longitude settings from your configuration.yaml file

According to your first post, you do (with a lat of 49 and a long of -97):

DIdn’t realize it was an off-hand zone config, the file mentions it’s used to sunrise/sunset.
As soon as my wife is awake I’ll restart and see if I can set a proper zone. (Whenever I restart HA all the TVs in the house turn on, no idea why)

It’s the initial HOME zone setting. To set the actual home zone in the GUI, you go to Configuration, General. You don’t set it using the zone integration.

Are you using node-red and have nodes configured to fire on connect?

I removed the Lat/Long from configuration.yaml and restarted HA.
When I go to configuration/general, the map is now blank but that section still has:
“Editor disabled because config stored in configuration.yaml.”
I also tried removing timezone, metric, and elevation and I’m still not allowed to edit it.
I also tried integration again and 'name already exists.

When I click on the map, ‘Home’ is in the crook of Africa.

Ok, I removed ‘home:’ from configuration.yaml and now I can edit it.
But…
It’s just showing a map, of the planet. I’m supposed to zero in on my back yard with that?
I don’t see where I can set the radius with configuration/general.
I tried in config/integration and still can’t make a Home zone, "name already exists’ again.

Alright, I rooted around and found
/usr/share/hassio/homeassistant/.storage/core.config
contained Home’s config. I was able to edit the Lat and Long to properly fit where my house is but when I tried to add radius, boy was it annoyed, as in docker-go-boom annoyed.

Soooo, back to where I started. How do I adjust the radius of my Home zone? The current radius of 100 meters covers over 80 houses around mine.

I am using node red and I’m not sure if any nodes fire on connect.
Are you thinking about the Zones or the TVs in the house flipping on?

1 Like

A bunch have the option. If this is selected, it will fire after a reboot. IT’s not related to your initial question, but I had a similar issue with my TV and this was the cause.

I’m not sure why you would have any issues editing the “home” zone.

I have all of my initial config in an entry in my “homeassistant:” section (the “old-fashioned way” :wink:) and I also have a “Home” zone configured in my zones.yaml file so I can control the radius of the “Home” zone and everything works fine for me.

homeassistant:
  latitude: !secret lat
  longitude: !secret long
  elevation: 866
zone:
  - name: Home
    latitude: 41.xxxxxxxxxx
    longitude: -85.yyyyyyyyy
    radius: 200
    icon: mdi:home

I was trying to do this all via the GUI but it seems it’s not quite ready for that.
I tried your way (nice ol-fashioned txt files) and that did the trick.
My house is now in the center of a nice small circle.

Thanks for the help.

1 Like

A. you shouldn’t edit those files while HA is running.

B. You shouldn’t add entries to the files that it doesn’t expect.

Not sure why that’s so hard. It worked for me.

Reading the documentation, I was either to go to configuration/general or configuration/integrations/zones and add Home.
integrations/zones wouldn’t let me add the zone, no matter what (even if not defined anywhere) and configuration/general wouldn’t let me set the radius.
Where is the correct place (from what had been posted up to then) to set the radius?
streets
And that’s the best resolution I was able to get out of configuration/general.
There are 20-ish houses in that bit of map.

So, question. What is the correct way to set the home zone? (with radius)

You just need to define it in config.yaml with “zone:”

The last example on the documentation here - https://www.home-assistant.io/components/zone/

  # This will override the default home zone
  - name: Home
    latitude: 32.8793367
    longitude: -117.2474053
    radius: 100
    icon: mdi:account-multiple

I think you almost have it sorted…

In my config.yaml file this it what I added…
#######
zone:
name: Home
latitude: !secret latitude_home
longitude: !secret longitude_home
radius: 100
icon: mdi:home

zone 2:
name: GYM
latitude: !secret latitude_gym
longitude: !secret longitude_gym
radius: 100
icon: mdi:school
############
Not to state the obvious…
I have added the following to my secrets.yaml file

####################
latitude_home: -12.345
longitude_home: 123.456

latitude_gym: -12.345
longitude_gym: 123.456

##MQTT #######

mqtt_username: fakename
mqtt_password: something
###############

Also for my system I clicked on configuration at lower left panel, then General and as you say zoomed in on my house etc…
If you are unable to change the page I can’t help as it worked for me…
Good Luck…

I finally was able to change the home location. I went to the person icon for my profile on the lower left of the menue and enabled advanced mode. I was then able to drag the house icon from Amsterdam to North Carolina and zoom in on the map to put the icon in the correct map location.