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).
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).
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.
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.
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?
- 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."