Linux has a very strict file access permission policy.
Add your user in this case pi to the group openhab. For the group policy to have effect you must reboot.
sudo usermod -a -G openhab pi
Change all file permissions in the openhab folder to be read, write, execute for owner and group, and to be read and executable by all. This has to be repeated eg, when you install a new binding, the cfg for the binding will not have the permission set. I set the sgid bit to make the files and folders inherit the file permissions from the parent bu it seems not to work. I have not look into ACL managment which would be the next step.
sudo chmod -R 2775 /etc/openhab2
Now after reboot you should be able to edit and save the files.
The benefit of VSCode is, it helps a lot.
The Items are all object types. This means they are more then e.g. just a plain number. They have functions you can call and the information is store into them.
Contact ContactItem
Switch SwitchItem
String StringItem
Number NumberItem
DateTime DateItme
If you want to get the number from NumberItem you need to
var aNumber = NumberItem.state
var aString = StringItem.state
here you can see getting a state from a string can not compare with a state from a Number.
I don’t know how your Items where defined, so this is just an assumption.
Also the error when you hover over the red marked Variables will help you resolve this errors.
Type mismatch: cannot convert from State to Number
To put it simple, the runtime environment is sometimes able to guess what you intended to do but not always.
But explicitly converting the value from item state to a number object will solve that.
if( ( NumberItem_1.state as Number ) > ( NumberItem_2.state as Number ) ){
logInfo("Show me your number", NumberItem_1.state.toString )
}
To get into this you have also post your items file.