Usage data of a custom component

Hi,

I always wanted to see some usage data of my custom integrations. Here my solution, do you have a better one?

Solution:
The HA analytics functionality delivers data about the custom_components too. I used a REST sensor to get the total installations.

Requirement:

sensor:
  - platform: rest
    name: MBAPI2020 Users
    scan_interval: 60000
    resource: https://analytics.home-assistant.io/custom_integrations.json
    value_template: >-
      {{ value_json.mbapi2020.get("total") }}

2 Likes

I do exactly the same!

1 Like

Thanks!
Here is a similar version with the additions for the versions attribute:

sensor:
  - platform: rest
    name: Daily Schedule Installations
    scan_interval: 86400
    resource: https://analytics.home-assistant.io/custom_integrations.json
    value_template: "{{ value_json.daily_schedule.total }}"
    json_attributes_path: $.daily_schedule
    json_attributes: versions
2 Likes

Just stumbled across this, thank you so much for sharing!