Reverse Geocode Sensor ("Places") using OpenStreetMap - custom component

I have updated to yesterdays version and postal_town is not showing in HA. Either in the Dashboard or History.

However it is showing in the logs.

Does the “stationary” attribute come from a calculation in the app or directly from the device tracker? I am seeing a moving towards home when my phone is plugged in charging at home.

Change the Display Options to (with the square brackets):

street, postal_town[]

I added it as an Advanced Display Option. In order to trigger the Advanced Display Options, you need to use a bracket or parenthesis in the Display Options. The standard options were written by the previous author for this integration and are difficult to expand. I haven’t replaced them as it would break or at least change the output for existing installations. I may still do it in the future, but for now, just adding a bracket gets you the expanded options.

2 Likes

Are you referring to the Direction of Travel attribute? If so, it is calculated in the app. It looks at the previous lat/long to the current lat/long. If it is less than 200 m, it will report as stationary. Otherwise it looks to see if the distance from home is increasing (Direction away from home) or decreasing (Direction towards home).

I am referring to the direction of travel attribute. The phone was stationary for 10 hours. Showed Home zone ( correct) and traveling toward home (incorrect). It should have shown stationary. I don’t think I can get the data from the android app from last night to see if incorrect data was sent.

Thanks @Snuffy2 that worked.

Ahhhh. I suspect I know why. I honestly never really looked at that attribute. Anyway, when the current location = prior location, the sensor does not update. Thus, for the entire time you are at home, the Direction of Travel likely reports the last state that was different from its prior. This would likely be the first state where you get home (with the previous one before that being just before you got home). Thus, the Direction of Travel would be toward home but it would never update since the state doesn’t change until you leave home again.

Let me see what I can sort out to get the direction of travel to go to stationary when the current state = prior state which makes perfect sense.

Would it make sense to use if it doesn’t update after a time period, stationary? It has worked correctly today.

I am now seeing a traveling towards home but I am stationary in a known zone. The last coordinate update is 35 minutes ago. Wouldn’t this be better if the device tracker attribute is shown as stationary?

See if v2.3.3 works better to correctly report stationary for the Direction of Travel attribute.

1 Like

Looks like I spoke too soon. Shows towards home when plugged into my charger for over 10 minutes

Please enable debug logging, open an issue on GitHub and put the logs from when you get to a zone and it doesn’t change/stay stationary so I can try to further troubleshoot. You can put the logs in PasteBin (or similar) and link to it in the issue.

I had already turned on the debugging, but updated something in HA that needed a restart. After the restart the sensor is back to stationary. When / If it fails again I will post on Github. The is the image of the sensor I made to track movement. It showed toward home from 1PM to around 4:50 ( the reboot time).
image

I have reviewed the log files and the log shows:

023-02-27 17:26:00.088 INFO (SyncWorker_17) [custom_components.places.sensor] (bill) Travel Direction: stationary

But the sensor that comes from this shows something different. Towards home. No where in the logs do I see this.

image

Very strange. Not sure what information to but in the GitHub issue?

image

I have been using this for a little while, and it works quite well.

However, has anyone come up with a way to make it work like a person sensor, where the popup shows the location on a map?

In the forum https://community.home-assistant.io/t/person-cards-show-off-yours/347020/58
@cowboysdude John Wade, posted code that does this. I use a modified version of this and it works well for me.

I use the config-template-card. Example below. Clicking will open the map_link in a browser or associated maps app.

type: custom:config-template-card
entities:
  - entity: sensor.snuffy2s_place
card:
  type: entities
  entities:
    - entity: sensor.snuffy2s_place
      tap_action:
        action: url
        url_path: ${states['sensor.snuffy2s_place'].attributes.map_link}

@Snuffy2

Hi there.

I stepped away from Home Assistant 4 years ago - but have decided to jump back in and am slowly building up my system. There have been so many changes since I left.

I wanted to say that I think you’ve done a great job maintaining and extending this awesome component :grin: and I’m happy to see that many people still find it useful.

I also have a request for a future update:

It would be great if the “(since 11:15)” could be updated to display (“since Mar23”) if the person has been at a place more than 24 hours or for multiple days. At first I was thinking maybe “(since 1d)”, “(since 2d)”, etc - but that would mean you’d have to check it daily. If you just use the date “(since Jul5)” or “(since 07/05)” then you’d only have to update it once - 24 hours after it had last sent a status update.

No rush - and it’s not super important if it turns out to be too difficult. (I’ll just have to try to get out more so I’m never at the same place for more than a day.). Either way - thanks for keeping this component alive!

Thanks!

Welcome back! And thank you for the kind words. Thank you for building it in the first place.

I’ve added your request to GitHub so I can track it, but it should be doable and makes good sense.

https://github.com/custom-components/places/issues/157

Oooh thats close isnt it.
Just not as clean as the HA person popup – i wonder if i can make that work in a similar way