Simple Decade-Calculations directly in items....or Rule "a must"

I’ve seen people ask for calculations on item values…but always linked to “rules” and the need to do this based on rules every time a new value comes in…

Is this still required if Fritzbox binding delivers kbit/s and i would love to display mbit/s so a very simple calculation DIV 1000 ?

Thanks a lot Norbert

No rules are no must but programming still is. You can use transformations and code the division in Javascript.

1 Like

You could also make a feature request to have this supported by Units of Measurement.

I think it would be doable, but not sure how much effort it would take.

Some bindings allow to specify transforms directly in the Item binding parameters (1.x) or in the channel (2.x)
But I think you’re out of luck there with any of the Fritz bindings.

The new profiles feature (for 2.x channels only) allows transforms in principle (although I believe it does not yet work for JS on incoming data for a Number Item).

A ‘dimensioned’ Item like Number:Datarate might be nice in future, allowing easy conversion kbps, Mbps, baud, etc.
I think you’d still need a transform or profile, to tag the appropriate UoM onto an incoming vanilla number? Or, as in this case where units can be safely assumed from the source standards, that part can be built into the binding.

None of that is any use for 1.x bindings of course :crazy_face: just saying the pathway for the future.

The only option to avoid rules with whichever Fritz 1.x binding is involved, would be to enhance the binding to support transforms.

Do you actually care what value is stored in the Item state? Transforms for display only purposes are in everyday use, can be applied to any Item.

Data rate dimension is already implemented in UoM. Only the binding needs to be updated to take it in account

I apparently neglected to notice this is an OH1 binding … oops.

Brilliant. Does that need adding to the docs?

Yes, should have been :wink:

1 Like