That’s a detail concerning Blockly specifically which and I’m not an expert in that. Have you watched the YouTube tutorials? Rules Blockly | openHAB
But in general, only the blocks you see under the openHAB section are written by openHAB. All the other blocks in all the other categories are standard Blockly which means they don’t know anything about openHAB Items or anything else.
In fact, I cannot get either the Item block nor the “get state as Item” block to dock to the + operator block. But I’m running OH 4 snapshots and Blockly has had a ton of work done since January. In order to dock them to the addition block I need to assign them to a variable first. But that causes them to lose their type meaning I can dock any variable to the addition block.
var test, foo, bar;
test = items.getItem('MyItem').state;
foo = items.getItem('MyItem');
bar = test + (foo - 1);
Note that because I’m on OH 4 snapshots, Blockly “compiles” into JS Scripting ECMAScript 2021 instead of Nashorn JS Scripting ECMAScript 5.1 so the code will look different.
There is a feature called “AutoUpdate” which can be configured on an Item by Item basis. It’s enabled by default and what it does is guess what state the Item should become based on the command and updates the Item accordingly. If you disable that, sending a command to an Item will not cause the Item to update. Something else (e.g. the binding after the device reported it’s new state) will update the Item.
