Blockly with numbers

Basically the answer is right about the fact that the value contains units.

You probably fell into the same “trap” like I did quite some time ago where I opened a bug myself: Blockly handles comparison differently when taken from state directly or from intermediate variable · Issue #836 · openhab/openhab-webui · GitHub

You can see my answer here and we also had a rather long discussion here:

I hope that helps to understand the background.