Companion App Latest Version Sensor

Haven’t seen this yet so I thought I’d throw it out there. I’m scraping the latest version of the Home Assistant app on the Google Playstore and comparing it to the current version sensor in the android mobile app to let me know if the apps on our phones need updating. There might be a better way to get the version off github with a rest sensor or something but this works for now.

sensor:
  - platform: scrape
    resource: https://play.google.com/store/apps/details?id=io.homeassistant.companion.android&hl=en_CA&gl=US
    name: HA Companion Latest Version
    select: ".htlgb span"
    index: 3


binary_sensor:
  - platform: template
    sensors:
      jphone_latest_version:
        friendly_name: Jason Phone App Version
        unique_id: jphone_latest_version
        icon_template: "{{ 'mdi:check-circle' if is_state('binary_sensor.jphone_latest_version','off') else 'mdi:alert-circle' }}"
        device_class: problem
        value_template: "{{ states('sensor.ha_companion_latest_version') != states('sensor.jphone_current_version') }}"
        attribute_templates:
          current: "{{ states('sensor.jphone_current_version') }}"
          latest: "{{ states('sensor.ha_companion_latest_version') }}"

image

Alternatively there is also the Github sensor: https://www.home-assistant.io/integrations/github/

if you prefer not to scrape :slight_smile:

That would be a super elegant solution if the beta versions we not reported as the latest version. :roll_eyes:

image

well it is the latest version but the github integration may need to decipher between pre-releases or not