uid: rules_tools:upgradeCheck label: Upgrade Check description: Runs at midnight and checks to see if the current version of OH differes from the latest release configDescriptions: - name: curr type: TEXT context: item filterCriteria: - name: type value: String label: Current Version Item required: true description: Item that holds the current running version of OH. - name: latest type: TEXT context: item filterCriteria: - name: type value: String label: Latest Version Item required: true description: Item that holds the latest published version of OH. - name: up type: TEXT context: item filterCriteria: - name: type value: Switch label: Upgrade Available Item required: true description: Item that will be set to ON when an upgrade is available triggers: - id: "1" configuration: time: 00:01 type: timer.TimeOfDayTrigger conditions: [] actions: - inputs: {} id: "2" configuration: type: application/javascript script: >- // Current Version var currVersion = org.openhab.core.OpenHAB.version; // Latest Release var releasePage = actions.HTTP.sendHttpGetRequest('https://api.github.com/repos/openhab/openhab-distro/releases/latest'); var parsed = JSON.parse(releasePage); var latestVersion = parsed.tag_name; items['{{curr}}'].postUpdate(currVersion); items['{{latest}}'].postUpdate(latestVersion); items['{{up}}'].postUpdate((currVersion == latestVersion) ? "OFF" : "ON"); type: script.ScriptAction