Hi,
i want to correct the value of a sensor (Sonoff-Tasmota, AM2301) by a rule.
in my items:
Number KG_TH10_2_Temperatur "Außentemperatur [%.1f °C]" <temperature>
Number AT_korr "Außentemperatur korr [%.1f °C]" <temperature>
in my sitemap
Text item=KG_TH10_2_Temperatur
Text item=AT_korr
and the rule:
//Rule zur Korrektur der Temperatursensoren 07.01.2018
import org.eclipse.smarthome.core.items
import org.eclipse.smarthome.core.persistence
import org.eclipse.smarthome.core.library.types
import org.eclipse.smarthome.core.library.items
import org.eclipse.smarthome.model.script.actions
Rule "Temperaturkorrektur KG_TH10_2_Temperatur Sonoff-Sensoren"
when
Item KG_TH10_2_Temperatur changed
then
// korrigiere um -2 Grad
Var_AT = KG_TH10_2_Temperatur.state as DezimalType
var Number Var_AT_korr = Var_AT - 2
AT_korr.postUpdate(Var_AT_korr)
end
but it does´nt work:
2018-01-21 13:08:40.132 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'tempsensor.rules'
2018-01-21 13:08:40.160 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'tempsensor.rules' is either empty or cannot be parsed correctly!
2018-01-21 13:08:40.426 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'tempsensor.rules' has errors, therefore ignoring it: [7,8]: no viable alternative at input 'Rule'
[16,2]: missing EOF at 'AT_korr'
what is the mistake?
Thanks anybody for help!