Github Boards Devices Community Docs Blog

Control AC Unit Riello with avatto IR

Hello everyone,

I Flashed openMqttGateway on a Tuya IR, I successfully switched on and off my television with this : {“hex”:“0x84c”,“protocol_name”:“RC5”,“bits”:12}

Now I want to control my AC Unit,
So I have this when I push ON and OFF :

// ON
home/OpenMQTTGateway_AVATTO_IR/IRtoMQTT {“value”:614835014,“protocol”:-1,“bits”:50,“hex”:“0x24A5A346”,“protocol_name”:“UNKNOWN”,“raw”:}
home/OpenMQTTGateway_AVATTO_IR/IRtoMQTT {“value”:2630044041,“protocol”:-1,“bits”:41,“hex”:“0x9CC34989”,“protocol_name”:“UNKNOWN”,“raw”:}
// OFF
home/OpenMQTTGateway_AVATTO_IR/IRtoMQTT {“value”:4197902752,“protocol”:-1,“bits”:50,“hex”:“0xFA36E9A0”,“protocol_name”:“UNKNOWN”,“raw”:}
home/OpenMQTTGateway_AVATTO_IR/IRtoMQTT {“value”:1245531107,“protocol”:-1,“bits”:41,“hex”:“0x4A3D4BE3”,“protocol_name”:“UNKNOWN”,“raw”:}
// ON
home/OpenMQTTGateway_AVATTO_IR/IRtoMQTT {“value”:614835014,“protocol”:-1,“bits”:50,“hex”:“0x24A5A346”,“protocol_name”:“UNKNOWN”,“raw”:}
home/OpenMQTTGateway_AVATTO_IR/IRtoMQTT {“value”:2630044041,“protocol”:-1,“bits”:41,“hex”:“0x9CC34989”,“protocol_name”:“UNKNOWN”,“raw”:}
// OFF
home/OpenMQTTGateway_AVATTO_IR/IRtoMQTT {“value”:4197902752,“protocol”:-1,“bits”:50,“hex”:“0xFA36E9A0”,“protocol_name”:“UNKNOWN”,“raw”:}
home/OpenMQTTGateway_AVATTO_IR/IRtoMQTT {“value”:1217350774,“protocol”:-1,“bits”:40,“hex”:“0x488F4C76”,“protocol_name”:“UNKNOWN”,“raw”:}
//ON
home/OpenMQTTGateway_AVATTO_IR/IRtoMQTT {“value”:614835014,“protocol”:-1,“bits”:50,“hex”:“0x24A5A346”,“protocol_name”:“UNKNOWN”,“raw”:}
home/OpenMQTTGateway_AVATTO_IR/IRtoMQTT {“value”:2120893734,“protocol”:-1,“bits”:40,“hex”:“0x7E6A4526”,“protocol_name”:“UNKNOWN”,“raw”:}
//OFF
home/OpenMQTTGateway_AVATTO_IR/IRtoMQTT {“value”:4197902752,“protocol”:-1,“bits”:50,“hex”:“0xFA36E9A0”,“protocol_name”:“UNKNOWN”,“raw”:}
home/OpenMQTTGateway_AVATTO_IR/IRtoMQTT {“value”:1245531107,“protocol”:-1,“bits”:41,“hex”:“0x4A3D4BE3”,“protocol_name”:“UNKNOWN”,“raw”:}

The ON and OFF are different, but I have a second line with different code.

I tried this :
{“bits”:50,“hex”:“0x24A5A346”} or
{“value”: 614835014}
or send
{“value”: 614835014} and after {“value”: 2120893734}

But it doesn’t work, do you you have any idea?

Thank you in advance

Edit : bought 2 avarro IR, and one of them is not flashed and work with Smart Life App, and it works with my AC Unit with Carrier and Midea Brand.

Hi,

good to see you here.

I feel a bit responsible for you current problem, as I suggested the Avattos and OMG to you, as this setup works so brilliantly for my setup here.

So if the 2nd Avatto does work with your AC, did you at the same time catch the MQTT payloads with the Avatto with OMG on it, to see what differences there might be to the above caught information form the actual AC remote?

I also have to use the Midea protocol_name for my AC, even if it’s a different brand, so what about sending

{“value”:614835014,“protocol_name”:“MIDEA”}’
{"value":2630044041,"protocol_name":"MIDEA"}'

etc. ?

The other issue to always look out for is the double quote signs. They need to be the straight ones, but a lot of text apps, or even here and copying from here, turns them into curly double quotes, which then will not work. See the difference above where I just put them as normal text with automatic conversion, and then preformatted text with the grey background, where they stay correct. “x” vs. "x"

I would still also suggest to catch the info the second Avatto with the Smart Life app sends, to see what might be different there.

Hope this helps to get you further.

1 Like

Hello,

Don’t worry, I will find why it don’t work.

So in the Smart Life App it work with Midea and Carrier, with Midea I can see this :
// ON
{“value”:137085900,“protocol”:-1,“bits”:50,“hex”:“0x82BC3CC”,“protocol_name”:“UNKNOWN”,“raw”:}
{“value”:1208885263,“protocol”:-1,“bits”:41,“hex”:“0x480E200F”,“protocol_name”:“UNKNOWN”,“raw”:}
// OFF
{“value”:4197902752,“protocol”:-1,“bits”:50,“hex”:“0xFA36E9A0”,“protocol_name”:“UNKNOWN”,“raw”:}
{“value”:1245531107,“protocol”:-1,“bits”:41,“hex”:“0x4A3D4BE3”,“protocol_name”:“UNKNOWN”,“raw”:}
// ON
{“value”:137085900,“protocol”:-1,“bits”:50,“hex”:“0x82BC3CC”,“protocol_name”:“UNKNOWN”,“raw”:}
{“value”:1208885263,“protocol”:-1,“bits”:41,“hex”:“0x480E200F”,“protocol_name”:“UNKNOWN”,“raw”:}
// OFF
{“value”:4197902752,“protocol”:-1,“bits”:50,“hex”:“0xFA36E9A0”,“protocol_name”:“UNKNOWN”,“raw”:}
{“value”:1245531107,“protocol”:-1,“bits”:41,“hex”:“0x4A3D4BE3”,“protocol_name”:“UNKNOWN”,“raw”:}

So we can see here, they always send the same value, and doesn’t seem to have a rolling code like the remote code.
So I made this little script sh (tried with CARRIER_AC and MIDEA protocol) :

#! /bin/bash
mosquitto_pub -t home/OpenMQTTGateway_AVATTO_IR/commands/MQTTtoIR -m ‘{“hex”:“0x82BC3CC”,“protocol_name”:“MIDEA”,“bits”:50}’
mosquitto_pub -t home/OpenMQTTGateway_AVATTO_IR/commands/MQTTtoIR -m ‘{“hex”:“0x480E200F”,“protocol_name”:“MIDEA”,“bits”:41}’

here a screenshot to show the quote :

And it doesn’t work too.
I know with google search, my riello AC Unit is a rebranded Midea or Carrier AC.

And I start to think, why the raw data i always empty (with Smart life and my real AC remote but it’s not empty with my TV remote) ? Maybe the value I tried to received are too big for the buffer so I have the wrong Hexa value?
So I need to find where I can change this buffer size in the code to check this assumption.

In User_config.h

#if defined(ESP8266) || defined(ESP32)
#  define JSON_MSG_BUFFER    512 // Json message max buffer size, don't put 1024 or higher it is causing unexpected behaviour on ESP8266
#  define SIGNAL_SIZE_UL_ULL uint64_t

Does this change anything for you when setting it higher?

Ok I setted to 1024 (Yes i saw the comment :slight_smile: ) and know I can see the raw value :
// ON
{“value”:137085900,“protocol”:-1,“bits”:50,“hex”:“0x82BC3CC”,“protocol_name”:“UNKNOWN”,“raw”:“4462,4420,476,1650,480,556,478,1650,478,1648,480,582,452,558,478,1674,454,556,478,560,478,1650,478,558,478,556,478,1674,454,1652,478,582,454,1650,476,560,476,582,454,1650,478,1652,478,1648,480,1648,478,1652,476,1650,478,1650,478,1652,476,560,478,558,476,584,454,558,478,558,478,582,454,1650,478,1650,478,582,452,584,454,1650,478,1648,480,558,478,558,478,582,454,556,478,1650,478,1674,454,558,478,558,480,1648,478,1674,454”}
{“value”:3010650481,“protocol”:-1,“bits”:42,“hex”:“0xB372E171”,“protocol_name”:“UNKNOWN”,“raw”:“478,584,454,556,478,1676,454,560,476,582,454,1674,454,1650,478,582,454,1650,478,582,452,560,478,1652,476,1652,478,1650,476,1650,478,1650,478,1650,478,1650,478,1650,478,560,478,558,476,584,454,560,476,560,478,560,476,1650,480,1646,478,582,454,560,476,1650,476,1674,454,562,476,582,452,560,478,560,476,1650,478,1650,478,558,478,558,476,1652,478,1650,478”}

I tried to send back the raw value with {“raw”:“RAW_VALUE”, “protocol_name”:“Raw”}
But nothing :frowning:

Just tried with tasmota :
Tasmota send me this {“Protocol”:“COOLIX”,“Bits”:24,“Data”:“0xB2BF6C”,“DataLSB”:“0x4DFD36”,“Repeat”:0,“IRHVAC”:{“Vendor”:“COOLIX”,“Model”:-1,“Power”:“On”,“Mode”:“Heat”,“Celsius”:“On”,“Temp”:21,“FanSpeed”:“Auto”,“SwingV”:“Off”,“SwingH”:“Off”,“Quiet”:“Off”,“Turbo”:“Off”,“Econo”:“Off”,“Light”:“Off”,“Filter”:“Off”,“Clean”:“Off”,“Beep”:“Off”,“Sleep”:-1}}
When I send it back, it works, I think I will stay on Tasmota.

So it is working by giving explicitly the type of the command if I understand well (Temp, Power…)?

Yes,
You send it back with the configuration you wantv(swingH for example and temperature) and tasmota send it to the acunit.

We need to dig into the IRRemoteESP8266 API, it could be nice to implement this type of commands added to the hexadecimal or raw ones.