Is this a bug in YAML UI?

Edit: Not a but, it’s a PEBCAK issue ;).

I think I found a bug, looking for confirmation.

I created an automation in the UI that tests a person’s (me) state to be ‘Home’, but it failed on that test despite me being home and my state showing as ‘Home’ in the dev tools States. Checking the trace the condition shows as failed because the automation found ‘state: Home’ when it expected ‘state: home’.

Only thinking it’s a bug because I created the automation entirely in the UI and did not touch the YAML.

Home with a capital first letter is not a normal state that the UI would come up with for the location of your instance. Did you by any chance also make a zone called Home yourself? You should not do that, because zone.home is defined by HA itself. Now it is not sure which one you’ll get: home or Home. Non-gps device trackers will use home, gps trackers could pick either.

It is not a gui bug, you can enter any state with any capitalization. You just entered one that is different than the one you hoped, because the test is case sensitive.

Son of a …

Yes I did because the default home zone is so big that I could trigger it multiple times a day just driving by, which I do since we have quite a few clients in the area.

Thank you for the quick and informative response, much appreciated.

1 Like

If you keep it this way, remember that device trackers might still report home, even when in zone Home. So it may not work as intended.

For non gps trackers the accuracy is often better, so if you look at the specific non gps tracker, make sure to use home, not Home and you’ll be fine.

Using non-gps trackers (e.g. a router) is a good way to improve accuracy.

1 Like

You can customise the default home radius by using customize.yaml.

That will fix your underlying issue, but make sure to remove or rename the Home zone you set up in the UI to avoid confusion.

2 Likes

Good to know, I wasn’t aware.

1 Like

Great, thanks for the tip. Found the documentation for it :slight_smile: .

Cool.

For anyone else reading, this is all you need to add to customize.yaml

zone.home:
  radius: 90

You don’t need to restart all of HA for the change to take effect.
Just go to Dev Tools > YAML tab > YAML configuration reloading > Location & Customisations. Job Done

1 Like

Worked like a charm (almost) and now the condition passes.

However I could not get the map to update using the developer tools to reload Location & Customisations even with a hard refresh, I had to restart HA to see the changes. Am I missing something?

Weird. Don’t remember that happening to me but it’s been a few years.

I’d still blame cache (hard reload is different), but I could be wrong