i would like to do some calculation before a value from a thing-channel gets written to the item state - is that somehow possible in OH3?
At OH2.5 i used a second item and a rule but i would like to “simplify” this:
rule "Umrechnung Ventilstellung HM_WZ_Heizkoerper_K_Level"
Item HM_WZ_Heizkoerper_K_Level changed
var valvelevel_wz_k = triggeringItem.state as Number
HM_WZ_Heizkoerper_K_Valve.postUpdate(valvelevel_wz_k * 100)
At OH3 i also get an error with this rule - i think i would have to add an if condition for the case the value is 0?
18:47:51.558 [ERROR] [.internal.handler.ScriptActionHandler] - Script execution of rule with UID 'heizung_calc_valvelevel-4' failed: cannot invoke method public abstract org.openhab.core.types.State org.openhab.core.items.Item.getState() on null in heizung_calc_valvelevel