Problems with controlling Haier AC using OpenMqttGateway

I meant all the errors that VS Code reports and still the project builds:


It seems it’s looking for header files in “*/OpenMQTTGateway/include”, at least that’s the path added to c_cpp_properties.json in .vscode folder and this path does not exist. It adds */main as well, where all header files are but it’s missing lib ones I believe, because those are in .pio/libdeps.

I mean that even if I set Base_Topic variable it set’s it I don’t know from where, the current one I’m flashing has home, the fresh one I flashed had ‘omg’…I’m confused…

Code_F3TX0vHcIm

Still nothing :confused: In serial monitor I get:

Hey I got a callback 
MQTTtoIR json
MQTTtoIR value || raw || datasring ok
MQTTtoIR OK
Pub json into:
home/OpenMQTTGateway_ESP8266_IR/IRtoMQTT
{"hex":"0xA6BCF20040600020000000000519","protocol_name":"HAIER_AC_YRW02"}
Hey I got a callback
Store str

Thanks for all the help and spending time to debug this with me! :+1:

I will take a look

The Base_Topic is overridden by the flash setting if there is one, currently if you want to change it you need to use wifimanager or do an erase flash before uploading.

Oh, didn’t know that. Maybe I just should use Wifi Manager then.

I wonder if there is a better way now, I’m still using it like old days, making changes in user config but now, with OTA and all maybe I should change approach.

Once this modification done at line 713 could you try to send your hex data like that:
{"datastring":"A6,BC,F2,0,40,60,0,20,0,0,0,0,05,19","bits":14,"protocol_name":"HAIER_AC_YRW02"}

Yeah! It beeped! I don’t know why others didn’t but this worked! Man oh man, I’m confused why there is so much hustle with Haier. I feel like noone has so many issues with the gateway and their AC as me :slight_smile:

Wow great!
Now I need to update the docs and correct the issue with the protocols that have several variants.

No, you are great! :slight_smile:

But tell me, do you have any idea why value and hex do not work?

Also, to integrate it with Home Assistant (any thermostat control) I need to get all the possible states, modes, temperatures and build some kind of huge switch case/id statement, right?

Have you ever considered using state topic?

The value is too big to be handled currently, and the hex data was used only for a part of the devices (not HAIER AC), I have optimized the code so as to have a better handling of hex values, would it be possible to test it there:

With this type of payload:
{"hex":"0xA6BCF20040600020000000000519","bits":14,"protocol_name":"HAIER_AC_YRW02"}

Sorry for the delay, I kinda missed the message. Do you want me to test it (dev branch or sth) or wait for official 0.9.4?

If you can test the development branch of v0.9.4 it would be great !

Sure thing. I’ll try later today or tomorrow :slight_smile:

1 Like

Ok, so I tried 0.9.4 beta.

I still don’t know how to wipe clean before flashing again, tried the switch in Home Assistant but I don’t believe it worked.

Anyway.

I did:

  1. Downloaded dev branch
  2. Build project (to download libs)
  3. Change IRremoteESP8266 IRrecv.h kRawBuf to 300
  4. Change emitter pin for my Lolin shield in config_IR.h
  5. Change JSON_MSG_BUFFER on line 277 in User_config.h to 1280
  6. Replace line 713 in ZgatewayIR.ino to if (strcmp(protocol_name, "HAIER_AC") == 0)

Tried sending:
{"hex":"0xA6BCF20040600020000000000519","bits":14,"protocol_name":"HAIER_AC_YRW02"}
In monitor got:


AC did not react.

Tried sending:
{"datastring":"A6,BC,F2,0,40,60,0,20,0,0,0,0,05,19","bits":14,"protocol_name":"HAIER_AC_YRW02"}
Got:


AC beeped.

With the last dev branch you don’t need to do these steps

It’s probably an issue with the development version retrieving.

datastring is not anymore used on the last development version, if you are able to send with it, it’s an indicator that you still have a previous version.

How can that be? In MQTT explorer I see
MQTT_Explorer_SeCaoCOWJV

There is several iterations during the beta process. I don’t change the version each time ( maybe I should).
You may be on an earlier v0.9.4beta. If you need I can build a new one.

Oh, I thought that if I grabbed beta from the releases it’s the latest :wink: So, should I grab source and compile?

Yes it would be great !

I’ll try to give it a shot over the weekend.

1 Like

Ok. I used the dev branch from sources and not the one from Releases.

When I press buttons on the remote I am getting in monitor:
N: --no pub unknwn prt--
When I tried sending
{"hex":"0xA6BCF20040600020000000000519","bits":14,"protocol_name":"HAIER_AC_YRW02"}
to
home/OpenMQTTGateway_ESP8266_IR/commands/MQTTtoIR
I got an exception and OMG restarted:

N: Received json : {"hex":"0xA6BCF20040600020000000000519","bits":14,"protocol_name":"HAIER_AC_YRW02"}

Exception (9):
epc1=0x40235ee3 epc2=0x00000000 epc3=0x00000000 excvaddr=0x3ffffc23 depc=0x00000000

>>>stack>>>

ctx: cont
sp: 3ffff6b0 end: 3fffffc0 offset: 01a0
3ffff850:  3ffe9853 3ffe9a58 3ffe9856 64695f71
3ffff860:  3ffff8bc 00000000 3ffe8304 4023209c  
3ffff870:  00000002 3ffffb70 76222c22 745f6c61
3ffff880:  3a226c70 207b7b22 756c6176 00000008  
3ffff890:  3ffffb70 3ffe8304 3ffe8742 402356a4
3ffff8a0:  00000801 0000000a 00000000 00000000  
3ffff8b0:  00000000 3ffffa24 00000003 6e650030
3ffff8c0:  5454514d 65746147 5f796177 38505345  
3ffff8d0:  5f363632 2c225249 6e616d22 63616675
3ffff8e0:  65727574 223a2272 5f474d4f 6d6d6f63  
3ffff8f0:  40100178 10f48059 765f7773 40100166
3ffff900:  40100178 10f48287 40252f27 00000001  
3ffff910:  ffffffff 00000000 3ffe9e51 00000008
3ffff920:  00000001 00000000 00000014 40256ac7  
3ffff930:  4025305a 3ffed448 401014ab 3ffed448
3ffff940:  00000014 3fff1970 00000008 3fff1538  
3ffff950:  40251fe8 3ffed448 3ffedbd0 3fff1970
3ffff960:  00000000 402453f3 3ffee938 40100166
3ffff970:  00000000 00000002 00000000 3ffed448
3ffff980:  3fff1552 40104def 3fff1970 3fff290c  
3ffff990:  3fff151c 401004c8 3fffc258 00000022
3ffff9a0:  40100178 4023755d 3fff0634 3fff290c  
3ffff9b0:  3fff1552 00000109 00000000 40100166
3ffff9c0:  4010059d 00000002 00000000 00000000  
3ffff9d0:  3fff0ad0 3fff0a98 3fff151c 402377df
3ffff9e0:  3fffc200 3fff0a98 3fff151c 40237bd0
3ffff9f0:  3fff08ac 00000000 0000001f 40105049  
3ffffa00:  4000050c 00000030 00000004 3fff08b0
3ffffa10:  3fff0ad0 00000000 3fff0a98 40235264  
3ffffa20:  402352f8 00000000 00000000 00000000
3ffffa30:  00000000 00000000 00000000 00000000  
3ffffa40:  00000000 00000000 00000000 00000000
3ffffa50:  00000000 01010101 01010101 00000101  
3ffffa60:  00000000 00000000 00000000 00000000
3ffffa70:  00000000 00000000 00000000 00000000  
3ffffa80:  00000000 00000000 00000000 00000000
3ffffa90:  00000000 00000000 00000000 00000000
3ffffaa0:  00000000 00000000 00000000 00000000  
3ffffab0:  00000000 00000000 00000000 00000000
3ffffac0:  00000000 00000000 00000000 00000000  
3ffffad0:  00000000 00000000 00000000 00000000
3ffffae0:  00000000 00000000 00000000 00000000  
3ffffaf0:  00000000 00000000 00000000 00000000
3ffffb00:  00000000 00000000 00000000 00000000
3ffffb10:  00000000 00000000 00000000 00000000  
3ffffb20:  00000000 3ffed6c8 3ffede80 00000000
3ffffb30:  3ffffc00 3ffffbf0 0000000c 3fff3b48  
3ffffb40:  3ffe873e 00000000 00000000 00000000
3ffffb50:  00000024 1296df09 40102696 3ffffc30  
3ffffb60:  00000003 3fff3b75 3ffe873e 40230eb0
3ffffb70:  3fff3b4a 00000014 3fff2e1c ffff0204  
3ffffb80:  3fff3b48 00000016 3ffffcc2 4021ef42
3ffffb90:  3fffc278 40230f6c 3fffc200 40266536  
3ffffba0:  00000025 00000000 3fff0370 4021ac14
3ffffbb0:  00000025 0000000a 00000000 4021eef7
3ffffbc0:  3ffffc70 3ffefc50 40266537 4021abff
3ffffbd0:  3fff3b8f 3ffffd58 3ffffc00 3ffffbf0  
3ffffbe0:  00000008 3ffe8c66 3fff0370 40201496
3ffffbf0:  656d6f68 65704f2f 3ffffc23 3ffffc20  
3ffffc00:  3fff3b42 00000001 36363238 2f52495f
3ffffc10:  00000000 73646e61 0000000e 40201eb1
3ffffc20:  00000000 3ffe8c66 3ffefc50 3ffffc70  
3ffffc30:  00000000 00000519 3ffffc20 00200000
3ffffc40:  3fff3b42 3ffffc8c 3ffffc80 3fff3b75
3ffffc50:  0000000e 00000000 3ffffc80 3ffffc70  
3ffffc60:  0000000e 00000519 00200000 4020527c
3ffffc70:  00000000 223a2278 36417830 32464342  
3ffffc80:  3ffffd00 3ffe8b85 30303032 00000000  
3ffffc90:  35303030 2c223931 74696222 313a2273
3ffffca0:  70222c34 6f746f72 5f6c6f63 656d616e
3ffffcb0:  3fff3b75 00000000 3fff3b40 3ffffd00  
3ffffcc0:  007d2232 3ffef76c 3ffffd00 00000000  
3ffffcd0:  3ffffcd8 00000053 ff005454 3ffef7ae
3ffffce0:  3fff3b8f 3ffef77c 3ffffd00 40206207
3ffffcf0:  4022e360 3ffffd00 00000200 00000068  
3ffffd00:  3ffffcf0 3ffffd08 3ffffd28 4021bedc  
3ffffd10:  3fff3b3c 3ffed6c8 00000002 3ffef76c
3ffffd20:  3fff3b40 40204d28 3ffffd48 40102256  
3ffffd30:  3fff3b5f 00000000 00000001 3ffef76c
3ffffd40:  3fff3b64 40204d28 00000000 40101366  
3ffffd50:  3fff3b67 4010474c 00000002 3ffef76c
3ffffd60:  3fff3b75 40204d28 3ffede80 00000100  
3ffffd70:  40103dd2 12b93dbe 3ffee184 40102256
3ffffd80:  00000000 00000000 0000001f 40105049
3ffffd90:  00000005 00000000 00000020 40101366  
3ffffda0:  3ffe9d05 40104767 3ffed6c8 ffffffff
3ffffdb0:  4010207d 3ffed6c8 00000020 40101366  
3ffffdc0:  00007fff 12bad9ae 3ffee184 40102256
3ffffdd0:  3ffea5bc 00000000 00000000 00000022  
3ffffde0:  00007fff 12bad9ae 40102696 00000100
3ffffdf0:  7fffffff 3ffea5bc 3ffea5bc 00000001
3ffffe00:  00000001 00004288 00000000 4bc6a7f0  
3ffffe10:  00000000 12bad9ae 00000000 4000050c
3ffffe20:  3fffc278 40102430 3fffc200 00000022  
3ffffe30:  3ffea5b0 12bad807 00000000 00000030
3ffffe40:  4022d388 00000030 00000010 ffffffff  
3ffffe50:  4022d362 00000001 00000001 00000000
3ffffe60:  00004bc6 00000000 00000000 fffffffe  
3ffffe70:  00000000 4bc6a7f0 3f3b645a 00000000
3ffffe80:  3fff05f0 000004ec 000004ec 4021f620  
3ffffe90:  00000000 00000000 3fff330c 4021fa48
3ffffea0:  00000000 00000000 40100394 40240b4c  
3ffffeb0:  00000000 4bc6a7f0 3fff2e1c 4023b656
3ffffec0:  3fff330c 00000000 3fff2e1c 40208768  
3ffffed0:  0004cb7d 3fffff12 0000007d 402087be
3ffffee0:  00000002 3fffff12 3ffef76c 00000053
3ffffef0:  40206248 3ffef77c 3fffff10 3ffef7ae  
3fffff00:  3ffffcf0 3fff3b8f 3fff3b84 4021f80a
3fffff10:  007d0089 3ffef77c 3fff3b3c 4020629a  
3fffff20:  3fffff50 00000001 3ffefb6c 00000031
3fffff30:  0004cb7c 3ffefb6c 3ffef76c 4022d100  
3fffff40:  0004cb7c 3ffefb6c 3ffef76c 40206b9c
3fffff50:  40259b02 3fff0460 00000000 00000001  
3fffff60:  00000002 00000005 3ffef770 00000089
3fffff70:  3fff2e84 40207b48 3ffef76c 3ffefbd0  
3fffff80:  0004cb7c 3ffef76c 3ffefbcc 40205ff7
3fffff90:  00000000 00000000 00000001 3fff0490  
3fffffa0:  3fffdad0 00000000 3fff0460 4021d2d0
3fffffb0:  feefeffe feefeffe 3ffe8620 401009f9  
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v8b899c12
~ld
N: ␎W: ESP8266: Forcing to wifi 0
{"mqtt_server":"X.X.X.X","mqtt_port":"1883","mqtt_user":"user","mqtt_pass":"pass","mqtt_topic":"home/","gateway_name":"OpenMQTTGateway_ESP8266_IR"}*WM: [3] allocating params bytes: 20
*WM: [2] Added Parameter: server
*WM: [2] Added Parameter: port
*WM: [2] Added Parameter: user
*WM: [2] Added Parameter: pass
*WM: [2] Added Parameter: name
*WM: [3] Updated _max_params: 10
*WM: [3] re-allocating params bytes: 40
*WM: [2] Added Parameter: topic
{"mqtt_server":"X.X.X.X","mqtt_port":"1883","mqtt_user":"user","mqtt_pass":"pass","mqtt_topic":"home/","gateway_name":"OpenMQTTGateway_ESP8266_IR"}N: IR_EMITTER_PIN: 0
N: IR_RECEIVER_PIN: 2
N: Setup OpenMQTTGateway end
W: MQTT connection...
N: Connected to broker
N: Subject: /SYStoMQTT

Could you try:
{"hex":"A6BCF20040600020000000000519","bits":14,"protocol_name":"HAIER_AC_YRW02"}