Allow semantic versioning threshold configuration Updater component

Currently, the Updater component triggers when a new semantic version shown here is updated. This results in all major/minor/patch version changes triggering an update.

It would be great if there was an optional configuration for this component such that only minor (monthly) updates triggered the binary_sensor value. Meaning: the binary_sensor value would only change if the minor version number changes (typically increases).

Iā€™m interested to know why you donā€™t want to know about major releases?

Sorry, I should have been clearer - I would care about major releases, considering those inclusive of minor releases from this perspective.

Framing this another way, this type of configuration would allow someone to get notifications for yearly, monthly, or more frequent releases.

The releases page mentions that releases are monthly, but this plugin triggers more than monthly since it includes patch releases as stable-tagged.

So you only want to be notified of monthly (major) releases?

There are no yearly releases.

It would be easy enough to write a condition for that (ā€˜0ā€™ minor release version).

1 Like

Yes, that is what I am thinking. For the situation where people primarily want feature updates, and donā€™t need all the bug-fix patches in between. (unless there are major security issues, not sure if those are communicated separatelyā€¦)

Iā€™m not sure if that ā€˜0ā€™ logic alone would be enough - any future minor update would need to trigger the logic, not just a ā€˜0ā€™. For example, if someone is on version 2021.12.9 and doesnā€™t update to 2022.2.0 when that is released, then 2022.2.1 is released, then the component should show ā€œUpdate availableā€ continuously through the release of 2022.2.1 (no ā€˜0ā€™ in that version).

Yeah, my workaround (if your request does not get implemented) was to simply use an automation with a condition to only notify the user if the minor release is 0. So they will always get a notification of the major release (20yy.mm.0) but no minor release notifications (20yy.mm.v where v != 0).

Oh, cool!

Would you mind sharing what that syntax looks like?

I have the notification configuration copied from the Updater integration web page, but am not familiar enough yet with the inline logical syntax to know what that conditional looks like.

Something like this:

trigger:
  - platform: template
    value_template: "{{ state_attr('binary_sensor.updater', 'newest_version').split('.')[2] == 0 }}"
action:
  - service: <your notification service here>
    data:
      message: "A new major release of Home Assistant is available, {{ state_attr('binary_sensor.updater', 'newest_version') }}"

It could do with a bit of refinement, e.g. a condition to prevent sending the notification if the newest version == your currently installed version. Otherwise this notification would happen after every restart. Iā€™m in a bit of a rush if you canā€™t work that out yourself reply here and Iā€™ll get back to it later.

1 Like

I turned on the Version integration to get the current installation version, and came up with this using condition instead:

  trigger:
    - platform: state
      entity_id: binary_sensor.updater
      from: "off"
      to: "on"
  condition: "{{ states.sensor.current_version.state != state_attr('binary_sensor.updater', 'newest_version') and (state_attr('binary_sensor.updater', 'newest_version').split('.')[2] == '0') }}"
  action:
    - service: notify.notify
      data:
        message: "A new major release of Home Assistant is available, {{ state_attr('binary_sensor.updater', 'newest_version') }}"

Are there any pros/cons to using condition as opposed to using platform: template?

Since the Updater integration is now deprecated, hereā€™s a revision using the Version integration:

- alias: "HA Major Version Update Available Notification"
  trigger:
    - platform: state
      entity_id: binary_sensor.home_assistant_website_update_available
      from: "off"
      to: "on"
  condition: "{{ states.sensor.current_version.state != states.sensor.home_assistant_website.state and (states.sensor.home_assistant_website.state.split('.')[2] == '0') }}"
  action:
    - service: notify.notify
      data:
        message: "HA Core major version {{ states.sensor.home_assistant_website.state }} is available."

Then again, the latest release also announces a monthly release newsletter which serves the same purpose of notifying when a new major release is available.