Bonaire MyClimate - Creating a custom integration

I have had a bit more of play with this, but I think I am quite a few steps behind where you are at. I have managed to capture data and analyse it through Wireshark, though it appears as though both direct connect through the LAN/WLAN as well through the cloud use SSL encryption.

How were you able to find the API calls? Did you use a man in the middle approach or something else?

Maybe having another set of eyes going over the code may reveal something. Please feel free to send on through.

Guys, I’ve totally reverse engineered this about 6 months ago. I will post code shortly. I run it through AppDaemon

Edit: I have had a quick read through this thread, and I am not using any calls to bonaires garbage cloud service, it’s all local thank god

1 Like

Man that would be great. I’m at the stage of modifying the APK and setting up a man in the middle, but as you would know it’s a lot of mucking around.

I’ve uploaded my code to https://github.com/bremor/bonaire-pyclimate

  • This is not a Home Assistant Integration, it will take a bit of tinkering to get it working.
  • You will need the MQTT plugin set up through AppDaemon.
  • Bonaire MyClimate is a flaky piece of **** and I would never recommend it to anyone.
  • I’m happy to help people get it set up, but I am rather time poor at the moment.
1 Like

Thank you so much for sharing your work!

May I ask why you say its flaky? Do you think its worth getting the wifi module, to integrate with Home Assistant?

If you already have a Bonaire system I dont think you have much choice. The IOS/Android app feels very poorly put together, sometimes works, sometimes doesn’t. Sometimes tries to go cloud, sometimes local. Weird disconnects after a couple of minutes, connection tables appearing to be full on the wifi module requiring a hard reset. Sometimes commands are not acknowledged by the wifi module, requiring it to be sent multiple times. No local authentication (which actually worked to my advantage). Just an all round piece of garbage, but it has been very stable running my code.

Unfortunately as I’ve discovered, there isn’t really any other option for the bonaire systems, and as you say, we don’t have much choice.

Sounds promising that your code seems stable at least. I’ve never used appdaemon before, so have just installed it, to see if I can wrap my head around it.

Unless some clever cookie can somehow make this into a custom component?

I will have a crack at this!

2 Likes

I haven’t got the wifi module yet, but it’s on my shopping list. Appreciate the work here Brendan (and all the others working on this!)
Will definitely help with writing some code when I’m in a place to contribute - though I have no specific knowledge about building integrations beyond what you guys do :slight_smile:

Absolute legend! :star_struck:

Thanks again for all your hard work.
If I could make one small request please - could you make it work for units with 4+ zones please?

Awesome stuff and thank you very much, I think I have just about all I need to start writing up a device handler.

Edit: I had to append to this post as I couldn’t add another post to the same thread…Newby limitation :slight_smile:

I have been pulling my hair out with Hubitat and local TCP/UDP comms as there just doesn’t seem to be a great deal of information out there about Hubitat IP comms. Anyway I decided to break away from the Hubitat and just concentrate on working out the communications with the Bonaire Wifi module using Packet Sender. FWIW here is what I have found:

LOCAL DIRECT COMMS

Local IP: 192.168.0.10
MyClimate IP: 192.168.0.11

To establish comms, first you have setup a TCP listener on the Local IP for port 10003 (i.e. TCP 192.168.0.10:10003). Check your inbound firewall rules.

When the listener is listening, send a UPD packet containing the following to the MyClimate IP on port 10001. Change the IP address below to match your Local IP.

<myclimate><get>discovery</get><ip>192.168.0.10</ip><platform>android</platform><version>1.0.0</version></myclimate>

What I can gather from here is that the MyClimate interface establishes a TCP connection back to your Local IP listener on port 10003.

Importantly this connection should be left open as subsequent communication seems to require this connection remain open. If the connection closes, you’ll will need to perform the discovery again. Also note; the connection will timeout after a period of no activity (no rush though, it’s a minute or two)

From here you should have an open and established connection to the MyClimate WiFi unit to which you can issue commands. See some example commands below.
Of note with this connection established, you can optionally open a second TCP connection to the MyClimate IP on TCP port 10002 where the same commands can be issued. Note that issuing a disconnect as per the example below will close all connections.

To get the current settings of your Bonaire, send the following data over the open connection (i.e. from your listener port 10003 or the optional second connection connected to the MyClimate WiFi on TCP port 10002).

<myclimate><get>getzoneinfo</get><zoneList>1,2</zoneList></myclimate>

The return will be something like this:

<myclimate><post>postzoneinfo</post><system>on</system><type>heat</type><zoneList>Common</zoneList><mode>program</mode><setPoint>22</setPoint><roomTemp id="Common">22</roomTemp></myclimate>

To change the settings of your Bonaire simply resend the same response with your altered settings, but with the roomTemp parameter removed. For example:

Set Temperature to 21

<myclimate><post>postzoneinfo</post><system>on</system><type>heat</type><zoneList>Common</zoneList><mode>program</mode><setPoint>21</setPoint></myclimate>

To Turn On

<myclimate><post>postzoneinfo</post><system>on</system><type>heat</type><zoneList>Common</zoneList><mode>program</mode><setPoint>23</setPoint></myclimate>

To Turn Off

<myclimate><post>postzoneinfo</post><system>off</system><type>heat</type><zoneList>Common</zoneList><mode>program</mode><setPoint>23</setPoint></myclimate>

And so on.

When finished and you wish to disconnect, send the following command:

<myclimate><delete>connection</delete></myclimate>

The TCP connection will drop and you can move on.

CLOUD COMMS AKA MYCLIMATE API
I have also been able to get to the bottom of cloud comms by examining packets using a MIM approach. As a result I have been able to successfully reissue commands via the MyClimate API using curl.
The basic steps are as follows.

  1. Set a lock
  2. Get status (optional)
  3. Send an instruction or series of instructions
  4. Delete lock.

Example commands:

Set Lock

curl -H "X-Authentication-Key: 12345678901234567890123456789012" -H "User-Agent: Dalvik/2.1.0 (Linux; U; Android 5.0.2; SM-P900 Build/LRX22G)" -H "Connection: Keep-Alive" -H "Accept-Encoding: gzip" -X GET https://myclimate.bonaire.com.au/Api/Lock

Get Status

curl -H "X-Authentication-Key: 12345678901234567890123456789012" -H "User-Agent: Dalvik/2.1.0 (Linux; U; Android 5.0.2; SM-P900 Build/LRX22G)" -H "Connection: Keep-Alive" -H "Accept-Encoding: gzip" -X GET https://myclimate.bonaire.com.au/Api/State

Change Setting

curl -H "X-Authentication-Key: 12345678901234567890123456789012" -H "User-Agent: Dalvik/2.1.0 (Linux; U; Android 5.0.2; SM-P900 Build/LRX22G)" -H "Connection: Keep-Alive" -H "Accept-Encoding: gzip" -H "Content-Type: application/x-www-form-urlencoded" -X POST -d @C:\Test\Bonaire_POST.txt https://myclimate.bonaire.com.au/Api/Instruction

Example Bonaire_POST.txt Content (as per Change setting above)
Turn On

<myclimate><post>postzoneinfo</post><zoneList>Common</zoneList><system>on</system><type>heat</type><mode>econ</mode><setPoint>15</setPoint><fanSpeed>8</fanSpeed></myclimate>

Turn Off

<myclimate><post>postzoneinfo</post><zoneList>Common</zoneList><system>off</system><type>heat</type><mode>econ</mode><setPoint>15</setPoint><fanSpeed>8</fanSpeed></myclimate>

HEAT MODE

<myclimate><post>postzoneinfo</post><zoneList>Common</zoneList><system>on</system><type>heat</type><mode>thermo</mode><setPoint>15</setPoint><fanSpeed>8</fanSpeed></myclimate>

Change Fan Speed

<myclimate><post>postzoneinfo</post><zoneList>Common</zoneList><system>on</system><type>heat</type><mode>fan</mode><setPoint>15</setPoint><fanSpeed>2</fanSpeed></myclimate>

Set Economy Mode

<myclimate><post>postzoneinfo</post><zoneList>Common</zoneList><system>on</system><type>heat</type><mode>econ</mode><setPoint>15</setPoint><fanSpeed>1</fanSpeed></myclimate>

Set Thermo Mode

<myclimate><post>postzoneinfo</post><zoneList>Common</zoneList><system>on</system><type>heat</type><mode>thermo</mode><setPoint>15</setPoint><fanSpeed>1</fanSpeed></myclimate>

Set Boost Mode

<myclimate><post>postzoneinfo</post><zoneList>Common</zoneList><system>on</system><type>heat</type><mode>thermo</mode><setPoint>15</setPoint><fanSpeed>1</fanSpeed></myclimate>

Set Manual Only Mode

<myclimate><post>postzoneinfo</post><zoneList>Common</zoneList><system>on</system><type>evap</type><mode>manual</mode><setPoint>15</setPoint><fanSpeed>1</fanSpeed></myclimate>

EVAP/COOL MODE

<myclimate><post>postzoneinfo</post><zoneList>Common</zoneList><system>on</system><type>evap</type><mode>manual</mode><setPoint>15</setPoint><fanSpeed>8</fanSpeed></myclimate>

Change Fan Speed

<myclimate><post>postzoneinfo</post><zoneList>Common</zoneList><system>on</system><type>evap</type><mode>manual</mode><setPoint>15</setPoint><fanSpeed>1</fanSpeed></myclimate>

Set Thermo Mode

<myclimate><post>postzoneinfo</post><zoneList>Common</zoneList><system>on</system><type>evap</type><mode>thermo</mode><setPoint>1</setPoint></myclimate>

Set Fan Only Mode

<myclimate><post>postzoneinfo</post><zoneList>Common</zoneList><system>on</system><type>evap</type><mode>fan</mode><setPoint>15</setPoint><fanSpeed>1</fanSpeed></myclimate>

Set Boost Mode

<myclimate><post>postzoneinfo</post><zoneList>Common</zoneList><system>on</system><type>evap</type><mode>boost</mode><setPoint>15</setPoint><fanSpeed>1</fanSpeed></myclimate>

Delete Lock (when finished controlling unit)

curl -H "X-Authentication-Key: 12345678901234567890123456789012" -H "User-Agent: Dalvik/2.1.0 (Linux; U; Android 5.0.2; SM-P900 Build/LRX22G)" -H "Connection: Keep-Alive" -H "Accept-Encoding: gzip" -X DELETE https://myclimate.bonaire.com.au/Api/Lock

Hopefully this is of help. Ohh and if anyone knows much about Hubitat comms, particularly TCP listeners, please feel free to chime in.

I am working on a first release now which can be added through HACS. First release will just have the base functionality of reading current temperature, and setting the temp. Should be ready in a couple of days.

1 Like

This is very exciting!

Do you (or anyone) know if other climate integrations in home assistant support zones?

I will be setting zones up as “hold_modes”

This is excellent progress! Thanks to everyone for your efforts. I’m very happy to assist with testing or troubleshooting.

It’s arrived!!

@BrendanMoran How close are we to having a “beta” in HACS?

Edit:

Any idea if there is already a way to integrate this into Google Home?

Get it off eBay? What did you pay?

Any chance you could put up a few pics of the internals of the electronic boards?

Made an offer for $200 and snapped it up! This was on eBay. It was brand new. :slight_smile:

Do you mean the internals of wifi part itself, the board in the blue/translucent box?

Just of the electrical boards. I’m curious what sort of control chips they are using. I’m more a hardware guy so would look at interfacing this directly using esphome or the like.