You are posting to the 3.x version of this rule template.
The code you posted code is the 4.x version of the rule template. See Thing Status Reporting [4.0.0.0;4.9.9.9].
If you are running OH 3, you installed the wrong version of this template. If you are seeing two versions of this rule template in the list under add-ons, make sure to choose the one with [3.2.0;3.4.9]
in the title.
If you are running OH 4, please make sure to post to that version of the template’s thread. But also make sure to look at the list of dependencies.
- OH 4.0.0 +
- JS Scripting add-on installed
- openhab-js 4.1.0 or later
- openhab_rules_tools 2.0.1 or later
openhab_rules_tools can be installed through openhabian-config or through the following command run from the $OH_CONF/automation/js folder:
npm install openhab_rules_tools
For more info see openHAB Rules Tools Announcements