I have used this rule in OH2 to convert the smart meter value for total energy consumtion.
rule "smartmeter to kWh" when Item smartmeter_Wh received update then smartmeter_kWh.postUpdate(smartmeter_Wh.state as DecimalType / 1000) end
I want to do this also in OH3. For this reason I’ve created a new element (item?) below of the smart meter equipment. What is additional needed to get this rule running?
This is my try in OH3.
var item_Wh = itemRegistry.getItem("smartmeter_Wh").state; var item_kWh = itemRegistry.getItem("smartmeter_kWh"); item_kWh.postUpdate(item_Wh.state / 1000);
Does someone have a hint for me?