Blockly: How to extract the number from an item state?

Feed your Item state into a variable first, and then use the append block (with an empty text block attached) to force the variable into a string. And then do your slicing.

This did the trick! Thank you very much. Now I can try and make a function from it and simply call it to convert my strings to numbers.

Probably. Did you try the method outlined in the post I linked?

I’ve read through it but did not get the point of methodology to use. Sorry.

Personally I don’t use any of the smart units stuff in openHAB - just keep everything in simple plain numbers.

It’s just the way those items were created automatically. And I am afraid to change them no to Number:Temperature (or something like that) not to break anything. I’ve already invested countless hours but for now OH is just a nice visual tool. Any “smart” functions you must program yourself.

1 Like