No it can’t. That’s the problem. An Item is more than just it’s state. And it’s state isn’t always a number that math can be done with (any Item can carry UNDEF and NULL). If I have the Item which consists of:
{
"link": "http://10.10.1.112:8080/rest/items/vWeather_Temp",
"state": "20.804 °F",
"stateDescription": {
"pattern": "%.0f ॰F",
"readOnly": true,
"options": []
},
"editable": true,
"type": "Number:Temperature",
"name": "vWeather_Temp",
"label": "Outside Temp",
"category": "temperature",
"tags": [
"Measurement",
"Temperature"
],
"groupNames": [
"Weather_Equipment"
]
}
and I want to add it to another Item which consists of
{
"link": "http://10.10.1.112:8080/rest/items/Mainfloorsensors_Temperature",
"state": "68.42 °F",
"stateDescription": {
"step": 1,
"pattern": "%.0f °F",
"readOnly": true,
"options": []
},
"editable": true,
"type": "Number:Temperature",
"name": "Mainfloorsensors_Temperature",
"label": "Main Floor Temperature",
"category": "temperature",
"tags": [
"Measurement",
"Temperature"
],
"groupNames": [
"Mainfloorsensors"
]
}
What does that even mean? An Item is so much more than just it’s state. The state is one among many properties on an Item. So if you want to add two temperatures together, you need to get the two temperature values. Not the whole data structure.
Well, it’s not. See Rules | openHAB for a full explanation of the difference between sendCommand and postUpdate.
In short, sendCommand
when you want an end device to do something (e.g. turn on a light). postUpdate
when you want to change the state of an Item. Updates do not get sent to the end device, they stay within openHAB. Note that not all commands are reflected as a state on an Item (e.g. INCREASE/DECREASE) and not all commands result in an Item changing state.