I have had this working and I have no idea what I have done to break it, I am a fiddler so I have no doubt I have done something… I have been trying to add persistence to my setup so could be I have caused some damage there???
I set a target temperture, in a Number item called LR_Tgt_Temp it is declared like so:
Number LR_Tgt_Temp "Livingroom Thermostat Target Temperature" (gLivingroomThermostat) [ "TargetTemperature" ]
I was having issue with a maths part of the rules and after investigation I realised that the target had been set as NULL somewhere. I figured I would simply set it to a value for now and worry about why it got set to NULL later when I have more time.
I used the REST interface here is a GET:
{
"link": "http://qtpi:8080/rest/items/LR_Tgt_Temp",
"state": "NULL",
"type": "Number",
"name": "LR_Tgt_Temp",
"label": "Livingroom Thermostat Target Temperature",
"tags": [
"TargetTemperature"
],
"groupNames": [
"gLivingroomThermostat"
]
}
And here is the unexpected result of a PUT; I was trying to put 19 as the value
{
"error": {
"message": "java.lang.IllegalStateException: Expected BEGIN_OBJECT but was NUMBER at line 1 column 3 path $",
"http-code": 500,
"exception": {
"class": "com.google.gson.JsonSyntaxException",
"message": "java.lang.IllegalStateException: Expected BEGIN_OBJECT but was NUMBER at line 1 column 3 path $",
"localized-message": "java.lang.IllegalStateException: Expected BEGIN_OBJECT but was NUMBER at line 1 column 3 path $",
"cause": "java.lang.IllegalStateException"
}
}
}
Any help appreciated.
Paul