Mosibi / Midea-heat-pump-ESPHome

Apache License 2.0
53 stars 14 forks source link

Update heatpump controller #42

Closed rysiulg closed 1 month ago

rysiulg commented 1 month ago

Added full support read/write Registers 0, 5, 210, 211 Added COP calculation Added human readable uptime counter of controller Added Some default icons for homeassistant and web interface Change check Heat Pump Running to check internal pump_i rather than external_pump ;) Added Product code decode as text sensor map PWM pump position to percent -York example move 0-480 Little corrections Commeneted some garbage: A) reserved bits -if !secret is removed (I don't understand why... but it's me ;) ) -then is logically to remove garbage not used by most of as B) commented statuses of more than 2 slave unit connected parallely -how many users use more than 1 heat pump ?

It is good to know that when you update some parameters eg in registers 210 and 211 heat pump disables automatically Heat Zones and DHW !!! :) -maybe functionality to be enabled by user and defined by user in www or ha to define time after which heatpump will be started again is good for you -let me know -i publish this update ;)

rysiulg commented 1 month ago

All two commits are the same -I've forget some comment so that is reason for two ;)

rysiulg commented 1 month ago

And add to readme info about YORK in the beggining ;)

Mosibi commented 1 month ago

@rysiulg thank you for this PR, but this PR is to big to handle, even GitHub has problems showing the diff 😝

Please create smaller pull requests that focus on one part or function which you have tested. If the PR includes lambda code, then do not forget to document the “what is happening here” and set the reason for the change in the description of the PR.

About the automations, although handy, I am not going to merge any automation code, even if it can be disabled. My goal is to keep this project as simple as possible (for a lot of people, it is already quite complex) and only “enrich” the information from the heatpump, so that users are able to create automations in home assistant or any other domotica controller.

Again I really appreciate your effort !

rysiulg commented 1 month ago

OK I made decision to uptade and clean my code. So uptafiong by fragment is mean start from beginning... i spend for latst upadate toi make pull request about 6-10 hours -so when i decide to another clean code and start from beggining i will make another pr. in other case you can manually can get from my repo uptade.;)
for now is for me too much effort and time to start from beggining and update. if you make full update you rersolve 0, 5, 210 and 211 registers to be configurable and had cop calculated value. Your repo removing !secret is for me project witch something missing -after copy not working config ;( -so please think about it. No API, No WiFi -stupid game with phone to configure etc....

rysiulg commented 1 month ago

I've reverted all my changes on github to your sync -so last one is the most merged with original with updates below: I've added COP, and decode heatpump type Updated Register 0 to be configurable and commented out not used register 0 bits -why make garbage in HA -better is to uncomment if another model will be uses these ;) I've changed names -because these Turn on HeatPOump and Romm control isn't logiocally... I've changed globals -like modbus registers is uint16_t not int -to avoid posiibility of wrong conversion After update -i prepare update for register 5, next 210 and next 211 Previous reg0, 5, 210,211 if you change one bit it disables all other bits ;)

Mosibi commented 1 month ago

I can’t merge this pull request at one (as a whole). Can you make separate pull requests for each piece of functionality. As an example, you have perfect fixes for the registers which are switches, which is perfect as one pull request

An other pull request could change register 5 to switches and also one to change naming. It really helps if you can do it like that!

Mosibi commented 1 month ago

@rysiulg as an extra explanation why I need the smaller pull requests. I need to test all the changes and one very big pull request is very hard to test.