Google Maps/Places popular times component

Nice use-case. I’ve looked into using the Google popular times data as well, but Google blocks the data after a while. Maybe you all could try as alternative data-source https://BestTime.app . They provide foot-traffic data that comes closes to Google but with an easier software API. You can start with a free test account, but unfortunately it is paid for higher usage. Anyway this works for me to track the popularity for several places every hour.

I have been using the popular times component without problem but on 9/15 it appears to have stopped updating. I don’t see any error messages related to populartimes in the Logs. Anyone having similar problems or suggestions on how to troubleshoot?

I’m seeing the same thing. However, the cause seems to be that google maps has stopped reporting live busyness data for some places. I have 2 sensors, both report 0 busyness right now. But last week only one did. Google maps reported exactly the same though, so I cant fix that.

Hi,
Can you describe this step by step? I’m not sure where to add this :frowning:

I have now updated the component with these changes:

  • Added fallback to historical Maps data, for when live popularity is not reported for a place.
  • Added a new attribute to indicate whether current state is from historical or live data.

If you update (via HACS) to version 0.25 you should see historical data reflect in the sensor’s value :slight_smile:

Fantastic change - looks really good. Thanks!

To show if the current info with and indication if it is live data or not, I made the following. It also retrieves the historical data for the current day of the week and current hour.

{% set array = state_attr('sensor.peakhours', 'popularity_' ~ now().strftime('%A').lower()) %}
{% set popular_now = states('sensor.peakhours') | int %}
Popularity: {{ popular_now }}%
{% if state_attr('sensor.peakhours', 'popularity_is_live') == true %}This is live data.
{% else %}This is not live data.
{% endif %}
{% set historical_now = array[now().hour - 1] %}
Historical info on this day & hour: {{ historical_now }}%
Next 3 hours: {{ array[now().hour]}}%, {{ array[now().hour + 1]}}%, {{ array[now().hour + 2]}}%
{% if popular_now < historical_now %}Less busy than normal.
{% elif popular_now == historical_now %}Normal.
{% elif popular_now > historical_now %}Busier than normal.
{% endif %}

Any suggestions on how to show the popular times sensor data on a map card? Is it possible?