How to push HTTP to a HVAC API

Posted on
Mon Jul 24, 2017 3:28 pm
jasoncheeseman offline
Posts: 2
Joined: Jul 23, 2017

How to push HTTP to a HVAC API

Hi,

Very new to home automation. I live in Australia where Ducted Air Conditioner Controllers seem to live in the 1960's where it isn't possible to control them with Ecobee, Nest etc.

I've found a few companies that make cool controllers. One of them AdvantageAir has an API for it's MyAir5 controller. When I started this journey I was looking at Fibaro and it has a way to push HTTP commands which looks pretty easy; see below

http://www.duppeditten.com/blog/fibaro-ifttt-integration

I've put the API below. Before I set down the path of Indogo, is there a way to send these commands to the MyAir5 unit via Indigo.

Thanks in advance.

The API looks like this:

This is the API documentation for the MyPlace system by Advantage Air, this allows third parties to connect and control the airconditiong functions of a MyPlace system within a simple home network.

The Wall Mounted Touch Screen must have the latest versions of the following apps - AAConfig, AAService and MyPlace from the Google Play Store.

Terminology:

Aircon - one air conditioning unit and associated zones.
Zone - on a ducted aircon a zone is a vent or multiple vents to which the airflow is controlled via a motor.
System - a system is a collection of air conditioners - currently we support up to 4 aircons.
Wall Mounted Touch Screen - the wired android tablet on the wall that controls the system.


1) Connectivity

The Wall Mounted Touch Screen needs to be connected and have a reliable WiFi connection to the router.

We suggest that the router is connected to the internet to allow Google Play Store updates.


2) Discovery

We do not provide a method for discovering the IP address of the Wall Mounted Touch Screen. For the rest of the document we will use 10.0.0.10 as the Wall Mounted Touch Screen IP address.

We suggest that you configure the router to provide the Wall Mounted Touch Screen with a "static" IP address.


3) Read aircon data

Tip: The following commands can be tested using any standard browser.
To get the system data as a single JSON file - use a http GET command on port 2025.
http://10.0.0.10:2025/getSystemData


Here is a heavily edited response to show the relevant data:

{
"aircons": {
"ac1": {
"info": {
"constant1":1, - Readonly - Constant zone 1 - the system will decide if this zone needs to be automatically opened to protect the ductwork (0 - disabled)
"constant2":2, - Readonly - Constant zone 2 - the system will decide if this zone needs to be automatically opened to protect the ductwork (0 - disabled)
"constant3":0, - Readonly - Constant zone 3 - the system will decide if this zone needs to be automatically opened to protect the ductwork (0 - disabled)
"countDownToOff": 0, - Number of minutes before the aircon unit switches off (0 - disabled)
"countDownToOn": 0, - Number of minutes before the aircon unit switches on (0 - disabled)
"fan": "high", - Fan speed - can be "low", "medium" or "high". Note some aircon units also support "auto".
"freshAirStatus": "none", - Fresh Air status - can be set to "on" or "off". Note: not many aircon units have this fitted.
"mode": "heat", - Mode - can be "heat", "cool" or "fan". Note some aircon units support "dry".
"myZone": 0, - MyZone settings - can be set to any zone that has a temperature sensor (0 - disabled)
"name": "AirconHome", - Name of aircon - max 12 displayed characters
"setTemp": 24.0, - Set temperature of the aircon unit - this will show the MyZone set temperature if a MyZone is set.
"state": "on" - Aircon unit state - whether the unit is "on" or "off".
},
"zones": {
"z01": {
"name": "FREEGGVFUX", - Name of zone - max 12 displayed characters
"setTemp": 25.0, - Set temperature of the zone - only valid when Zone type > 0.
"state": "open", - State of the zone - can be "open" or "close". Note: that the
"type": 0, - Readonly - Zone type - 0 means percentage (use value to change), any other number means it's temperature control, use setTemp.
"value": 20 - Percentage value of zone - only valid when Zone type = 0.
}
}
}
},
"system":{
"name":"MyPlaceSystem", - Name of system - max 12 displayed characters
"needsUpdate":false, - If true, you need to prompt user to update the apps on the Wall Mounted Touch Screen
"noOfAircons":1 - Number of aircon units - this can be 0-4.
}
}


4) Sending a command to a single aircon

Tip: The following commands can be tested using any standard browser.
The set command uses a subset of the JSON structure from the getSystem command. However each command can only target one aircon unit. If you have multiple aircons you will have to send one command message per aircon.

Example aircon unit commands:

To set the first aircon (ac1) state on or off use the following:

http://10.0.0.10:2025/setAircon?json={"ac1":{"info":{"state":"on"}}}
http://10.0.0.10:2025/setAircon?json={"ac1":{"info":{"state":"off"}}}

To set the second aircon (ac2) mode to heating (heat) use the following:

http://10.0.0.10:2025/setAircon?json={"ac2":{"info":{"mode":"heat"}}}

You can also combine messages, so to set aircon ac1 to state=on and mode=cool

http://10.0.0.10:2025/setAircon?json={"ac1":{"info":{"state":"on","mode":"cool"}}}

Example zone commands:

To set the first aircon (ac1), second zone (z2) state to open.

http://10.0.0.10:2025/setAircon?json={ac1:{"zones":{"z2":{"state":"open"}}}}

To set the third aircon (ac3), tenth zone (z10) value to 80%.

http://10.0.0.10:2025/setAircon?json={ac1:{"zones":{"z10":{"value":80}}}}


Example aircon unit and zone commands:

For a combination of settings you can use the one command

http://10.0.0.10:2025/setAircon?json={ac1:{"info":{"state":"on","mode":"cool"},"zones":{"z10":{"value":80}}}}}


Posted on
Mon Jul 24, 2017 4:52 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: How to push HTTP to a HVAC API

Indigo uses Python as it's scripting language, which makes pretty much anything possible. It looks like they have a pretty nice API. For a very simple integration to set stuff a simple Python script would suffice:

Code: Select all
import urllib
urllib.urlopen('http://10.0.0.10:2025/setAircon?json={"ac1":{"info":{"state":"on"}}}')


Basically, take the URLs in their docs, wrap them in single quotes ('), and use the urllib.urlopen function to get the URL.

Deeper integration is certainly possible, like getting the system data JSON and doing something with it. The best solution would be a plugin that would create AdvantageAir devices. However, you could grab whatever data you want and stuff it into an Indigo Variable if you didn't want to build a full-on plugin. I'd recommend starting with the simple script above and as you get more familiar with how Indigo works then tackle a more full-featured integration. Just be aware that there are lots of possibilities for integrating!

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Jul 25, 2017 3:06 am
Coolcaper offline
Posts: 299
Joined: Aug 30, 2013
Location: Australia

Re: How to push HTTP to a HVAC API

I have the air conditioner system mentioned and I am using Indigo to control it when required using the GhostXML plugin and Indigo variables. I can turn on/off aircon/zones, set temp and modes. That is as far as I have progressed and left as I did not need control over how much a zone is open or closed or setting programs as I can do that using the MyAir app.


Sent from my iPhone using Tapatalk

Posted on
Tue Jul 25, 2017 4:58 am
jasoncheeseman offline
Posts: 2
Joined: Jul 23, 2017

Re: How to push HTTP to a HVAC API

Thanks both for your input. I have a programmer at work who could probably write the plug-in for me with enough beer and chips. I will definitely go down the road of Indigo now as I already have an Apple Mac Mini pretty much doing nothing at the moment and it's way cheaper than a Fibaro.

Posted on
Tue Jul 25, 2017 6:40 am
Coolcaper offline
Posts: 299
Joined: Aug 30, 2013
Location: Australia

Re: How to push HTTP to a HVAC API

jasoncheeseman wrote:
Thanks both for your input. I have a programmer at work who could probably write the plug-in for me with enough beer and chips. I will definitely go down the road of Indigo now as I already have an Apple Mac Mini pretty much doing nothing at the moment and it's way cheaper than a Fibaro.


Best thing you can do mate (getting with Indigo). If the plug-in does come to fruition, I'd be willing to pitch in for it. Let me know and all the best on your home automation journey with THE best platform out there!


Sent from my iPhone using Tapatalk

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest