hey guys. I must be missing something simple. I’m trying to add two items together. here’s the items file and rule file.
the rule is firing but its not adding the two items together and updating the combined item with the combined value. any help would be awesome
Number Inverter_1_Generation "INV 1 Gen" { channel="fronius:powerinverter:89b7524c:inverterdatachannelpac" }
Number Inverter_1_Grid "INV 1 Grid" { channel="fronius:powerinverter:89b7524c:powerflowchannelpgrid" }
Number Inverter_1_Load "INV 1 Load" { channel="fronius:powerinverter:89b7524c:powerflowchannelpload" }
Number Inverter_2_Generation "INV 2 Gen" { channel="fronius:powerinverter:008407eb:inverterdatachannelpac" }
Number Inverter_Generation_Combined "INV Gen"
rule "Add Inverter Generation"
when
Item Inverter_1_Generation changed or
Item Inverter_2_Generation changed
then
logInfo("Add Inverter Generation", "Rule triggered")
Thread::sleep(200)
Inverter_Generation_Combined.postUpdate((Inverter_1_Generation.state as DecimalType) + (Inverter_2_Generation.state as DecimalType))
logInfo("Add Inverter Generation", "Rule sent command")
end