Enable Modbus Climate / HVAC on/off to use the coil instead of the register(s)#135657
Enable Modbus Climate / HVAC on/off to use the coil instead of the register(s)#135657bdraco merged 12 commits intohome-assistant:devfrom
Conversation
|
Now I haven't written tests and documentation yet, because I want more experienced people to tell me if the code I wrote will work in this form. It has already been working for half a year in my production. |
crug80
left a comment
There was a problem hiding this comment.
Preliminary review.
If I have correctly understood the need, this code is not able to check possible conflicts among the actual configuration (using the registers) and the new one (with coils).
As it is, an user can set a register value for both of the parameters, causing 2 simultaneous writes. the first one will use the function code 0x06 or 0x10 and in case coil is enable, it will fail. The second one will use the function code 0x1.
You have the same behaviour for a reading.
I think that the old configurations will not be broken because I have not changed anything in the existing code for the registers. I used vol.Exclusive to make it impossible to specify a register and a coil at the same time. |
My bad, I didn't see Exclusive. |
Added tests |
|
crug80
left a comment
There was a problem hiding this comment.
It seems missing a test to validate the climate update using on/off by coil.
Done |
|
Thanks @illia-piskurov |



Proposed change
The changes are necessary to add support for a range of devices such as the Haier range of air conditioners. For example, the Modbus Haier YCJ-A002 uses coil to turn on and off:
Also, there has already been an attempt and need for another person to add this functionality at this point: #121680
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: