I tried to create an proxy item. But it will not update.
The rule is fired and i can see the output in the logs.
But the update of the proxy item will not be shown.
I want to add the the power values L1, L2 L3 to calculate the balance.
Then i want to store the values to create an chart.
But i can not update the item with the display name “Saldo”. Where is my mistake?
My item is shown in the sitemap but without any display:
I’d like to mention that a rule isn’t required to do this though. Assuming all you are doing is adding, or even if you are taking the average, you could put these three Items into a Group:Number:Power:SUM or a Group:Number:Power:AVG (I think that syntax is correct) then the aggregation function will take over from the rule.
The only gotcha is you will have to list this Group Item explicitly in the persistence config for it’s values to be saved.
Do you have JSONPATH installed? Why are you not applying the transform at the Channel or Profile level? It’s unusual to use this transform in the Item’s label.
Note, because the result of any transformation is a String, %.0f is almost certainly going to fail. You must use %d or you need to apply the transform before the value gets sent to a Number Item.
seems my problems are nearly solved.
The JSONPATH is installed. I first set up them in the GUI and want to move them in my config files. Sorry for confusing
I don’t know what you mean by “inverting in the items”. And I’ll not be much help from me if you are facing syntax errors in your text based configs. I haven’t looked at 2.5 in years, I never had my Things in .things files even when I used 2.5, and when OH 3 came out I moved all my configs to the UI.
The best I can say is make sure you have the right property names for each parameter.
The only thing I can think of based on a quick scan is [ profile="transform:JS", toItemScript="| Quantity(input).multiply(-1)" ] is almost certainly wrong. toItemScript isn’t something that existed until OH 4. It definitely wasn’t supported by OH 2. When looking at the docs, in the upper left there is a option to choose the version of OH you want the docs for.
Use openhab-cli backup or just make sure you include the userdata (/var/lib/openHAB) folder in your backup, which you should be doing anyway to have a complete backup.
Now I installed openHAB 4 (Docker on Synology) and trying the UI.
I created some mqtt things, created channels and linked them to new created items.
In the link i select “SCRIPT ECMAScript (ECMAScript 262 Edition 11)” in the type and set “Thing To Item Transformation” in the profile section to “| Quantity(input).multiply(-1).toString();”
and i created a link with “standard” for the original values
In the things tab i can see now that the links/ponint showing the original valu and the inverted value.
But if i create an graph in the pages section one value generates a floating average of two values. Sometimes there is a on single error.
Strange is if i create a new link and item with a new name there ist no problem in the chart.
netz_l1 is the original value netz_l1_inv the new negated value with the error.
and a new item/link withe the name netz_l1_inv2 has no error.