Upgrade Check [5.2.0.0;5.9.9.9]

WARNING: Users who have this template already installed for versions of OH 5.1 and before, after removing the old template and installing this new one, open your rule(s), click on the code tab, and change the ruleTemplate property to ohrt-upgradeCheck before regenerating the rule.

A rule which runs at midnight that checks GitHub for a new release of OH. It updates three Items, one with the current version of OH, one with the latest version and a Switch which will be ON when the current version doesn’t match the latest. It also logs at the info level when there is an upgrade available and at the debug level when there isn’t.

TODO: handle milestone releases

Language: JS Scripting

Dependencies:
JS Scripting.

May depend on OHRT in the future

Changelog

Version 1.1

  • migration to new YAML file format for OH 5.2
  • use wrapper
  • standardized logger names

Version 1.0

  • Reformatted to new YAML file format
  • Added logs

Sponsorship

If you want to send a tip my way or sponsor my work you can through Sponsor @rkoshak on GitHub or PayPal. It won’t change what I contribute to OH but it might keep me in coffee or let me buy hardware to test out new things.

Resources

https://raw.githubusercontent.com/rkoshak/openhab-rules-tools/refs/heads/main/marketplace-templates/ohrt-upgradeCheck.yaml

Shouldn’t this rather be(come) a part of Main UI?

Sure, but until then there’s this rule template. Note this rule template is a direct port of the one I wrote more than a year ago after someone complained that OH doesn’t do this.

Ideally it should be a part of core with an API endpoint and some info level logging as well as being shown in MainUI.