Google Maps/Places popular times component

This component generates a sensor which shows the current popularity for a place which can be found in Google Maps using the Places API.

Sensor attributes are also generated which indicate past popularity at each hour of the day.

Installation

Either:

  1. Install via HACS
  2. Download files as zip and put the contents of the populartimes folder in your home assistant custom_components folder.

Configuration

sensor:
  platform: populartimes
  name: 'your_sensor_name_here'
  address: 'your_address_here'

The address should preferably be in the following format:
“(location name) , full address, city, province/state/etc, country”

Repo with installation files:

If you have any questions, or find any bugs, please let me know here or raise an issue on Github.

4 Likes

exactly what I’ve been looking for. fantastic component!

1 Like

Sensor says unknown. In Google Console it says 100% error for the requests made. How do I go about to see why it generates an error? Cant find a log in Google console that is more specific.

Any common mistakes that are known in conjunction with this component?

Home assistant log says

No popularity info is returned by the populartimes library.

listening in here - im getting the same error.

/

I’m seeing the same here. It seems the underlying library is broken at the moment. There seems to be a replacement available. I’ll try to find some time to test it in my component and see if I can create a working update.

I have updated the component, it should be working again.
However, it is no longer required to have a Google APIKey, or a Google Places ID.

Instead, the configuration is based on an address. Please see the opening post for the required configuration.

Let me know if it works for you!

1 Like

I love this component, but there’s a limitation if the store doesn’t have live busyness I still want to see the typical value. It would be GREAT if we could have an attribute which indicates whether live busyness is being reported, and a second attribute that has the typical value for the current day and hour.

In the meantime, and in case it helps someone, here’s how I do this with a template, for example for my local UPS store:

{% if states("sensor.ups_store")|int == 0 %}
typ: {{ state_attr("sensor.ups_store", "popularity_" + now().strftime('%A').lower())[now().strftime('%-H') | int] }}%
{% else %}
live: {{ states("sensor.ups_store") }}%
{% endif %}

This will show the typical value, if the current value is zero. I’m not sure this is quite the right approach (if it really is zero, I want to know that) but I only use it on the locations that don’t report live data anyway.

I wrapped this up in a template sensor, probably unnecessary but it makes it easier to show the value in more than one place.

2 Likes

After a couple of days this component is not working anymore. Are there more people with this problem?

I don’t have this problem, the component never crashes for me.

I get this error in the logs:

Platform error sensor.populartimes - Requirements for populartimes not found: [‘git+https://github.com/GrocerCheck/LivePopularTimes@master#LivePopularTimes==1.0’].

I go this error also. I raised an issue on github.

I also updated the manifest file to 1.1 as the Grocercheck repository referenced is now on version 1.1.

If I can figure out the URL it might work but no luck so far…

Yeah I saw your issue on Github.
I tried many forms of the requirements URL but it does not work in any form indeed :frowning:
When I have more time I’ll try to solve it.

Thanks,

If you need any testing. I’m happy to help.

Hi all, I have just updated the component with a fix for the issue.
Please update and test it out!

Thank you. Working for me now!

1 Like

Looks great, thanks!
Any chance of looking at the earlier request I made, to add a couple of attributes?

I love this component, but there’s a limitation if the store doesn’t have live busyness I still want to see the typical value. It would be GREAT if we could have an attribute which indicates whether live busyness is being reported, and a second attribute that has the typical value for the current day and hour.

Very nice, it works again! Thankyou!

I am having an issue when installing this. I used HACS to install and restarted twice. I am trying to add the sensor to my configuration.yaml, but it won’t pass the configuration validation. I tried removing the name & address lines, leaving just the platform, and even that won’t validate.

sensor:
 # Google Maps popular times
  - platform: populartimes
    name: 'ShopRite'
    address: 'ShopRite of Roxborough, 6901 Ridge Avenue, Roxborough, PA 19128, USA'

Any suggestions? I am still very new to this.

You configuration looks fine to me. Are you sure there is not another component that causes the validation error? Does it still happen when you remove the sensor entity entirely?

I reinstalled the repo thru HACS, rebooted, and now everything seems to be working just fine. Not sure what happened, that hasn’t happened to me before.

1 Like