openHAB version: 3.1.0 Release Build running on Docker 2.6.2
Bindings: Homematic Binding for CCU 2 (controlling lights via Alexa, logging the heating), Gardena Binding for Gardena Gateway / smart irrigation control (logging soil humidity), Alexa Binding (controlling the Homematic lights)
While I’m pretty happy the way the Gardena binding is working on my openHAB (primarily: logging the soil moisture and valve status; the actual irrigation is done by the Gardena smart irrigation control directly), the way the values are formatted in openHAB is pretty irritating:
While the battery level of the sensor looks perfectly fine…
I did read through the “transformation-chapter” in the tutorial (Transformations | openHAB), but since I have to substract a " one"-string from a string, convert it to a number and add a " %" I’m a bit puzzled on how to do that.
Anyone with the same problem / anyone can give directions? Specifically:
How to convert " one" to " %"?
How to change the y-axis-label in the graph “%unit%” to “%”?
‘one’ is a unit of a Number:Dimensionless in openHAB. If you post ‘50’ to Number:Dimensionless type, it will be interpreted as a ratio ‘50-to-1’ (hence the ‘one’. If you post ‘50%’ to a Number:Dimensionless you get 50%.
Okay, the difference here is that your Item is a plain Number type.
What you need to know to sort all this out are the types of the channels that you have linked to these Items. You should link these to matching Item types.
If your Gardena channel is just a number, you can link that to just a Number Item, and add a decorative % symbol to the presentation.
Or you can massage the plain number data from the channel with a profile to add a % symbol to the update, link to a ‘real’ Number:Dimensionless Item.
… but I noticed that the “preview-graph” in the cell itself does not appear anymore (compare left and right tile)…
I did compare the yaml-code of the two cells, and they’re identical. Since the “preview graph” did work before I implemented the formatting above, I assume it has to do with that?