Thank you for the answer. I’m still not very familiar with the esphome project.
Does enabling web_server automatically generates also web interface with required controls ?
is the item mentioned in below links, trying to solve the same issue?
note: i could not read the language in of the text in the urls, but could translate it to dutch with the translate funtion of Edge.
Integratie van de GREE-airconditioner met Wirenboard + Home Assistant - Sprut.AI
Hey interesting find @SuperElma! At first I thought ‘huh why doesnt it have a voltage cable connected to the AC’ but then I saw they actually connect the unit both via the regular wifi connection cable AND via a modbus cable, where it gets its voltage: https://youtu.be/pdmc6pi0H38?t=412
Not sure what the advantage is here, maybe they found it easier to manipulate the AC via modbus? Or are there more variables exposed via modbus? Not sure. Either way, interesting stuff.
Also from the translated data sheet "The gateway is designed for controlling and dispatching Gree air conditioning systems via the Modbus RTU protocol"
So yeah they do seem to control the AC via the modbus connection. But why then also connect the wifi cable? Not sure I understand that part. Could be that not all info is attainable over modbus?
EDIT Here it shows all modbus registers that can be manipulated, going to see if there’s something there that we can’t do over wifi: https://onokom.ru/img/ustroistva/gr-1-mb-b/v2-tekhnicheskii-pasport-gr-1-mb-b.pdf
EDIT2 I translated all modbus registers and it seems there’s nothing there that we can’t attain over the wifi connection. Well there’s a hardware and software version of the AC, it’s currently not implemented in my project but I think it’s possible from what I’ve seen. But other than that, nothing that we can’t do.
So this module definitely is less easy to install, since you need to open up the whole AC and doesn’t seem to add something that we can’t do with this project. Either way, still interesting find this module. I think this offers hope for people with older Gree AC’s that don’t even have a wifi connection, they can try to manage the AC via modbus
Issue: Wrong mode restore (defaults to HEAT instead of last mode)
Description
When turning OFF the AC while in COOL mode, then sending an ON command from Home Assistant without specifying a mode, the integration incorrectly powers back on in HEAT mode.
This is problematic because my unit does not support HEAT mode at all.
Expected behavior
- AC should restore the last active mode (COOL in this case).
- If HEAT is requested but not supported, it should be mapped to COOL (or ignored).
Observed behavior (logs)
[22:14:05][D][climate:011]: 'Gree AC' - Setting
[22:14:05][D][climate:015]: Mode: HEAT
[22:14:05][V][sinclair_ac.serial:128]: Requested mode change
...
[22:14:06][D][climate:396]: 'Gree AC' - Sending state:
[22:14:06][D][climate:399]: Mode: OFF
Steps:
- Set AC to COOL.
- Turn OFF.
- Power ON again from HA (no explicit mode).
- Result → HA injects HEAT, and AC fails to start.
Proposed Fix (patch)
void SinclairACCNT::control(const climate::ClimateCall &call)
{
static climate::ClimateMode __last_active_mode = climate::CLIMATE_MODE_COOL;
if (this->state_ != ACState::Ready)
return;
bool has_req_mode = call.get_mode().has_value();
climate::ClimateMode req_mode = has_req_mode ? *call.get_mode() : climate::CLIMATE_MODE_OFF;
#if !SUPPORT_HEAT
// Guard against invalid HEAT mode
if (req_mode == climate::CLIMATE_MODE_HEAT) {
ESP_LOGD(TAG, "HEAT requested but not supported → mapping to COOL");
req_mode = climate::CLIMATE_MODE_COOL;
}
#endif
// If OFF and no mode explicitly requested → restore last active
if (this->mode == climate::CLIMATE_MODE_OFF && !has_req_mode) {
this->mode = __last_active_mode;
this->update_ = ACUpdate::UpdateStart;
reqmodechange = true;
ESP_LOGD(TAG, "Power-on restore → forcing last mode");
return;
}
// Apply explicit mode
if (has_req_mode) {
this->mode = req_mode;
if (this->mode != climate::CLIMATE_MODE_OFF)
__last_active_mode = this->mode;
this->update_ = ACUpdate::UpdateStart;
reqmodechange = true;
}
// ... rest of existing temperature/fan/swing handling ...
}
Notes
- This issue only affects devices without HEAT support.
- With this guard in place, the unit restores correctly to COOL (or last active mode).
Hey @najjadas I haven’t seen this behaviour on my AC’s. Which model do you have? It does seem that the Gree protocol isn’t exactly a ‘one fits all’ unfortunately with some differences between some models.
Just to understand what you our doing, how do you power on the ac exactly? Because in the HA dashboard you can only power it on by choosing a mode, if I remember correctly. I assume via an automation?
And about the indoor temp, not all ACs come with such sensor so not all won’t support it
@gekkehenkie11, I’d like to thank you for the firmware update instructions you posted on June 4th!
I have the same GRJWB04-J wifi module in my air conditioner. It came with firmware version 1.23. I recently updated it to 1.31 (via the app) since that version finally makes it possible to silence the beeper (older version have a bug that silences the beeper only every other command). Unfortunately I did not realize in advance that firmware 1.31 comes with a different cloud protocol that requires Internet access. Without Internet access, local access (Home Assistant) stops working after just a few minutes.
This is not new. The old firmware had that as well, but it’s fairly easy to circumvent that by setting up a dummy server, and that’s exactly what I had been using. This workaround no longer works with the new cloud protocol (more info).
It’s not possible to downgrade via the app or forged firmware update requests. However, I was able to downgrade via the debug UART. The ATWO command by itself was not sufficient. It works fine for upgrading to a newer version, but downgrading always returns to the same version after the reboot. However, executing the ATSC (Clear OTA signature) command did the trick. After that the downgrade with command ATWO went just fine.
So, I’m back on firmware 1.23, with Internet access blocked. I’m happy. Sure, the beeping is back, but for now I’ll live with that. I had been thinking about removing the beeper from the PCB, but I think I’ll go with your ESP replacement in the future.
In my case I used Amazon alexa to turn on the AC >> climate.turn_on
the indoor temp is supported it works with your esp code… that why I need to update the original wifi module but I think the server is blocked in my side
Hahaaa use this project, my friend! It’s actually the main reason I’m now replacing my original modules that I have with the ESP ones. I’ve bought an external temp sensor that’s about 0.2C precise (actually I bought 3 types, but I like this one currently most: https://www.amazon.com/dp/B0C27TLFV1 ) and am now using that as input to my custom AC temp regulation algo, LOL.
It’s actually still super simple, what I do is I us an HA automation to switch the AC to “fan only” once the temp is too low and then switch to ‘cool’ when it’s too high (with a target temp slightly below my real target temp), but I’m still experimenting with the exact values that I like best. But you can also for example make custom cooling strategies, if you want certain parts of your night rest cooler than the others for example. It’s frikking awesome LOL. And of course the beeper needs to be off. Actually I only just started experimenting with this and it already works very well, but I’m going to experiment with ever narrower ranges etc the coming days. But this was last night for example:
as you can see I kept the temp within an 0.5C degrees range, but of course you can even narrow it down, which I’m going to experiment with. You can also see that the target temp changed abit around 2:50AM, it’s when I woke up and felt I needed to lower the temp even a bit in the algo. Since it’s now way more precise than before, I’ll need to find the perfect target temp for me that I like best of course.
The internal AC cooling algo is WAY less precise, the AC I have cools down like 30 minutes, then switches to fan only for about 30 minutes etc (well, in practice ‘fan only’ but of course it’s still within the ‘cooling’ mode), but in the beginning/end of those time frames I always felt that the temp was too high/low. So that’s why I’m now making may custom cooling algos with HA.
Hmmm, it’s interesting. Not sure what’s going wrong here, would need to look into it. But it’s going wrong somewhere between Alexa/HA or within HA, since the ESP module is in your case receiving the wrong cooling mode when turned on. If I have some time I will look into this and see if I can find out what’s going wrong in your case and why HA doesn’t remember the correct cooling mode for you. Your ‘work around’ of course works fine in your case but it would be much nicer to really fix it within the code, it should be possible of course!
Other than that everything works fine for you? Since you have a different wifi module, it’s actually encouraging that this code works well for you.
I think though what needs to be done is have the code get the AC version and then incorporate any chances that different models need, in order to make this module really work fine out of the box for all models.
What features are added to gree ac’s using a esp module, compared to using the gree hacs integration?
I noticed that in the gree integration i cant start a self clean. Neither do i see kwh consumption (but those that show in app may be estimations only?)
Maybe some more fun stats available using a esphome? My daikin showed info about the temperature of the liquid gas, which is fun and interesting.
Well this is what it currently looks like:
Where I’d say that the beeper off mode is the most interesting difference.
And then there are smaller differences. Like with the gree hacs automation you need to assign a fixed IP to the modules MAC address, which can be difficult if your router doesnt support that, or if you have an extender that might spoof the MAC address. With this implementation none of that is needed, all goes automatically correct. And there’s of course no communication with China.
But if your current hacs version is working correctly and you don’t need the silent mode, I’d say there’s not much reason to migrate.
BTW, ran a new test with my custom cooling algo, the temp range is now even a bit smaller and I lowered the temp range a bit. Tonight I’m going to experiment with even a thighter range, cause I can still feel the difference between the AC cooling and not cooling, although it’s already WAY better than before (compared with the old situation, using the AC’s own cooling algo)
So if anyone would like to do what i’m doing above (custom cooling strategy) then don’t buy that damn sonoff temp sensor LOL. Last night it just got stuck at a certain temp. It did report to the zigbee network but somehow with a stuck value. So I’m now switching to the other sensor that I bought: Amazon.com: THIRDREALITY Zigbee Temperature and Humidity Sensor 2 Pack, Digital LCD Display, ZigBee Hub Required, App Records, Remote Monitoring and Smart Home Automation, AAA Batteries Included : Appliances which hasn’t been stuck (yet LOL) and seems equally accurate as the Sonoff. Going to see how that works. Either way, with an external temp sensor driving the AC via HA, I guess one should implement a watchdog automation to check, say every 20 minutes, and take over in case something doesn’t look right and then switch to have the AC take over the regulation again.
Anyway as a result I woke up thinking ‘hmm my room is cold’ LOL when it was actually 3 degrees C lower than what I wanted. The damn AC had been cooling really the whole night.
I had a 2nd unit installed last week and it has onboard wifi instead of a port to connect a wifi module. So I am unable to replace the wifi module.
Therefore a possibility of connecting a custom wifi module to the COM-MANUAL port (which my new unit also has) would also be very useful for me.
I am using the hacs gree integration now, together with a docker container that acts as a fake gree server. These two together allow full local control of the gree airy i have. This is however confirmed not to work with most if not all gree wifi modules. My wifi is internal build in.
For more info see the gree dummy server project on codeberg.
It works really well, i dont have a need for a wifi module now for gree. Perhaps this will work with all models that gree releases for a while. The airy is a 2025 released model.






