Hi all,
I am well on my way to getting my OH setup just how I want it, I am however struggling with one device and that’s my AirCon unit. I can control this through an App named Advantage Air which lets me control the aircon functions, there is a link about how to integrate with OH but I can not for the life of me get it to work. I have confirmed that I am able to get data via what I am led to believe is the API for the device by accessing http://localipofcoontroller:2025/getSystemData and it returns a bunch data to me. Has anyone had any luck with this integration at all?
Thanks in advance.
Your link is showing a (very outdated) openHAB configuration (openHAB2…)
So the main issue may be, you have to “translate” that configuration to a more up-to-date version.
Edit: Maybe paste a complete block of data here (if there is any sensitive data in it, make it xxxx), e.g.
{
"aircons": {
"ac1": {
"info": {
"state": "on",
"countDownToOff": 0,
"countDownToOn": 0,
"fan": "high",
"mode": "heat",
"myZone": 0,
"setTemp": 24.0,
"zones": {
"z01": {
"name": "XXXX",
"setTemp": 25.0,
"state": "open",
"type": 0,
"value": 20
}
}
}
}
}
}
It doesn’t matter if it’s nicely formatted or not:
{"aircons":{"ac1":{"info":{"state":"on","countDownToOff":0,"countDownToOn":0,"fan":"high","mode":"heat","myZone":0,"setTemp":24.0,"zones":{"z01":{"name":"XXXX","setTemp":25.0,"state":"open","type":0,"value":20}}}}}}
Hi, thanks for getting back to me, I assume your referring to the code in the link that explained how to do it being for a very old version of OH correct?
Thanks very much, I have managed to make some progress and got OH to actually connect to the AC Controller now, just stuggling to work out how to split up all the data from what I get from the HTTP Binding, I have attached an example of what I am getting, is there a guide I can use to work out to the parse through it all and pull the data that I want.
As it’s json, you can use JSONPath to get distinct data.
As I’m used to VisualStudio Code as an Editor, I use this with the plugin “JSON Path Status Bar”. But there are many other editors with similar functionality.
Just open the json as a text file in the editor, maybe format the json (context menu - format document), search for one of the values and set the cursor to the value. Now in the status bar of VS Code you can read the selected path, e.g. aircons.ac1.zones.z06.measuredTemp
for the value 27.7
.
In openHAB, you will have to write JSONPATH:$.aircons.ac1.zones.z06.measuredTemp
for incomming value transformation (and of course you have to install the JSONPath transformation service).
As the channel ist read only, you can use another trick, this is, create the channel as string channel and no transfomation. Then link multiple (Number) Items to this channel and set the JSONPath within the link through the profile. This way, you only need one channel to get many different values at once.
EDIT: Maybe consider to delete the text file, as it contains sensitive data 