bremor / bonaire_myclimate

Reverse engineered implementation of the Bonaire MyClimate app.
19 stars 6 forks source link

Recognise existence of 'Common' zone #14

Closed boc-the-git closed 4 years ago

boc-the-git commented 4 years ago

Where there is only one 'zone', e.g. a system too small for actual zoning :(, the zoneList will be 'Common', which results in the HA presets being every combination of those characters, per the screenshot..

Installation response: 2020-09-01 20:31:06 DEBUG (MainThread) [custom_components.bonaire_myclimate.BonairePyClimate.bonairepyclimate] Server data received: <myclimate><response>installation</response><appliance><type>heat</type><zoneList>Common</zoneList></appliance><appliance><type>cool</type><zoneList>Common</zoneList></appliance><appliance><type>evap</type><zoneList></zoneList></appliance><zoneName id="Common">Common</zoneName></myclimate>

Presets with existing code: image

With the modified code, clicking preset does nothing.

I haven't tested extensively as I don't have a lot set up to use the integration as yet, but can't see how this would have too much in terms of unintended consequences.

bremor commented 4 years ago

Thanks! Before I commit I was wondering if you had a pcap or similar showing you doing a ‘postzoneinfo’ when you change any setting. I’m interested to see what the zoneList field would be? Is it blank or is it ‘Common’

boc-the-git commented 4 years ago

Thanks! Before I commit I was wondering if you had a pcap or similar showing you doing a ‘postzoneinfo’ when you change any setting. I’m interested to see what the zoneList field would be? Is it blank or is it ‘Common’

This is from my HA log, when running my modified code.. I first changed it from 19 to 20, then back from 20 to 19.

2020-09-02 12:53:13 DEBUG (MainThread) [custom_components.bonaire_myclimate.BonairePyClimate.bonairepyclimate] Server data received: <myclimate><post>postzoneinfo</post><system>on</system><type>heat</type><zoneList>Common</zoneList><mode>program</mode><setPoint>19</setPoint><roomTemp id="Common">20</roomTemp></myclimate>

2020-09-02 12:53:32 DEBUG (MainThread) [custom_components.bonaire_myclimate.BonairePyClimate.bonairepyclimate] Sending the command: <myclimate><post>postzoneinfo</post><system>on</system><type>heat</type><zoneList>Common</zoneList><mode>program</mode><setPoint>20</setPoint></myclimate>
2020-09-02 12:53:34 DEBUG (MainThread) [custom_components.bonaire_myclimate.BonairePyClimate.bonairepyclimate] Server data received: <myclimate><response>postzoneinfo</response><result>ok</result></myclimate>
2020-09-02 12:53:46 DEBUG (MainThread) [custom_components.bonaire_myclimate.BonairePyClimate.bonairepyclimate] Sending the command: <myclimate><post>postzoneinfo</post><system>on</system><type>heat</type><zoneList>Common</zoneList><mode>program</mode><setPoint>19</setPoint></myclimate>
2020-09-02 12:53:48 DEBUG (MainThread) [custom_components.bonaire_myclimate.BonairePyClimate.bonairepyclimate] Server data received: <myclimate><response>postzoneinfo</response><result>ok</result></myclimate>

To confirm, when making the above changes via the HA integration, I can see the navigator controller update to the new temperature, 19 or 20 respectively :)

Note when I capture packets sent from the mobile app, there are 2 differences..

  1. Meaningless, the <zoneList> tag sends before the <system> tag via phone..
  2. My phone also sends <fanSpeed>0</fanSpeed>

Screenshot (2 Sep 2020 12_33_54)

bremor commented 4 years ago

I haven't really done any experimentation with the "Program" mode, maybe that is why it looks a little bit different.

boc-the-git commented 4 years ago

Will give it a go this evening and report back.

My memory is I tried that and I then lost access to the "controls" (not sure exact name) via the climate entity.

boc-the-git commented 4 years ago

@bremor this is what happens with

    def get_zone_combinations(self, zoneList):
        # Installations without multiple zones will have one "common" zone
        if zoneList == 'Common':
            return list('Common')

image

bremor commented 4 years ago

Can you please post your <myclimate><response>installation</response> from your logs?

boc-the-git commented 4 years ago

Can you please post your <myclimate><response>installation</response> from your logs?

Will give a bit more of the surrounding logs for context too.

2020-09-02 21:19:50 DEBUG (MainThread) [custom_components.bonaire_myclimate.BonairePyClimate.bonairepyclimate] Sending discovery
2020-09-02 21:19:54 DEBUG (MainThread) [custom_components.bonaire_myclimate.BonairePyClimate.bonairepyclimate] Connected to Wifi Module
2020-09-02 21:19:56 DEBUG (MainThread) [custom_components.bonaire_myclimate.BonairePyClimate.bonairepyclimate] Server data received: <myclimate><response>discovery</response><ip>192.168.2.171</ip><serial>redcated</serial><version>1.2.3</version><port>10002</port><status>router</status></myclimate>
2020-09-02 21:19:57 DEBUG (MainThread) [custom_components.bonaire_myclimate.BonairePyClimate.bonairepyclimate] Server data received: <myclimate><response>installation</response><appliance><type>heat</type><zoneList>Common</zoneList></appliance><appliance><type>cool</type><zoneList>Common</zoneList></appliance><appliance><type>evap</type><zoneList></zoneList></appliance><zoneName id="Common">Common</zoneName></myclimate>

2020-09-02 21:19:58 DEBUG (MainThread) [custom_components.bonaire_myclimate.BonairePyClimate.bonairepyclimate] Server data received: <myclimate><response>getzoneinfo</response><system>on</system><type>heat</type><zoneList>Common</zoneList><mode>program</mode><setPoint>22</setPoint><roomTemp id="Common">22</roomTemp></myclimate>
bremor commented 4 years ago

Cool! Thanks. I found what the issue is. This should work.

    def get_zone_combinations(self, zoneList):
        # Installations without multiple zones will have one "common" zone
        if zoneList == 'Common':
            return ['Common']

Also, FYI, I haven't really done any testing or catered for using <mode>program</mode> so not sure if you will get some weird behaviour. I have only coded in econ, thermo and boost.

boc-the-git commented 4 years ago

This should work.

Cool, I'll give that a go this evening and report back.

Also, FYI, I haven't really done any testing or catered for using <mode>program</mode> so not sure if you will get some weird behaviour. I have only coded in econ, thermo and boost.

It seems to work pretty fine to be honest. The weirdest part of it is when you turn it off via the program (which means the system is still technically on but set to do nothing) it has a setpoint of 236 - but otherwise things seem to be working fine. I'll eventually get rid of the program and use HA to control it.

2020-09-02 21:23:14 DEBUG (MainThread) [custom_components.bonaire_myclimate.BonairePyClimate.bonairepyclimate] Server data received: <myclimate><post>postzoneinfo</post><system>on</system><type>heat</type><zoneList>Common</zoneList><mode>program</mode><setPoint>236</setPoint><roomTemp id="Common">22</roomTemp></myclimate>
bremor commented 4 years ago

Manually merged into master

boc-the-git commented 4 years ago

Thanks mate, looking good!