Connecting Home Ass...
 
Notifications
Clear all

Connecting Home Assistant to a Midea Heat Pump

207 Posts
15 Users
54 Reactions
25.8 K Views
(@cashback)
Trusted Member Member
187 kWhs
Joined: 2 years ago
Posts: 27
 

Posted by: @leichat

Posted by: @cathoderay

Don't get me wrong, I am not for a moment suggesting that Nabu Casa can't make and sell something called a HAG. Al I am saying is that I don't think it is the right product for me. Horses for courses, forever.       

I think I need to read the entire thread to understand the context of the recent comments.
Are those that are enthusiastic about HA hoping to collaborate with you so that the ASHP data extraction work you have already accomplished is compiled into a library that's suitable for someone with HA integration authoring skills to reuse?

 

 

Yes, I suggested that many posts back, a client library written in python than can be used either on its own or as part of a HA integration. 

I have my ASHP hooked up to HA via NodeRed, however it is not at all portable, hence the desire to translate learnings in to a client library and a HA integration that uses it.

The work I've done is of limited use to @cathoderay (and anyone else) because it's tightly coupled to NodeRed and HA. It's a proof of concept I'd planned to use as a baseline before starting on a client library and integration. The work that @cathoderay has done is of limited use because it's synchronous and will only work with Modbus RTU, not RTU over TCP. They seem to have an inherent disdain towards anything that touches HA, collaboration seems to be off the cards, much to the detriment of The Community. 

 


   
ReplyQuote
cathodeRay
(@cathoderay)
Famed Member Moderator
9928 kWhs
Joined: 3 years ago
Posts: 1999
Topic starter  

Posted by: @leichat

Are those that are enthusiastic about HA hoping to collaborate with you so that the ASHP data extraction work you have already accomplished is compiled into a library that's suitable for someone with HA integration authoring skills to reuse?

I rather fear not, as it comes across as I see it that the HA aficionados see me as some sort of ill-disposed and delusional HA hater who they could not see a way to work with. The core point is horses for courses, and I am just not a horse for the HA course, and having said that, I have given reason for being of that view, and have put forwards alternatives. I still don't get why one person's view - that's all it is - on HA generates so much defensive and sometimes out-rightly hostile behaviour.

That said, I have no objection to my code being adapted to work with HA, in fact, for historical reasons (I started off with HA, and it is still on my system) I have on occasions done just that myself. HA's History Explorer card/add-on does produce pleasing charts, and here for example is a possibly interesting comparison of midea_ac_lan and modbus data:

image

 

This shows the trailing 24 hour COP over last April, the last month the heating was on, with the top plot based on midea_ac_lan data (ie all done in HA), and the bottom plot based on the minimalmodbus csv data, read into HA using a file sensor. The 'calc' in the plot title after modbus means this is a calculated COP, based not on Midea total kWh values, but on modbus read amps x volts and flow rate x specific heat x delta t, meaning, apart from both coming from the wired controller, the collection and calculation methods are entirely different. They both go up and down at the same time, but mostly the calculated COP is higher than the midea_ac_lan based COP, and and the question is which, if either, is correct? Bear in mind that chart comes from a very early stage in my attempts at monitoring, and the heating hasn't been on since, which is why I want to wait until the heating is back on, to check and double check my code, before I go public with it.

Midea 14kW (for now...) ASHP heating both building and DHW


   
ReplyQuote
cathodeRay
(@cathoderay)
Famed Member Moderator
9928 kWhs
Joined: 3 years ago
Posts: 1999
Topic starter  

@cashback - thank you for a positive contribution. The limitations of the various solutions put forward to date (including mine) are frustrating, but I am hopeful that what I am working on will become a generic solution at least for heat pumps with a modbus RTU connection. At the moment, that includes Midea, Midea cloned and almost certainly Samsung heat pumps.

Put simply, my setup uses a small form factor PC connected to the heat pump via a wired modbus RTU connection, over which relatively short and simple python script collects data and writes them to CSV files, which can then be used to generate charts. If your heat pumps speaks modbus RTU, and you can tap into that, then there is a good chance my set up, after any necessary tweaks eg to address registers etc, will work. Not a solution for everyone, but hopefully it will be for some.

I should also mention that the Midea modbus setup allows the setting as well as getting of values, and in the fullness of time I shall be experimenting with this, in particular the use of an adaptive weather compensation curve, but the detail on that has been and will be covered in other threads.    

Midea 14kW (for now...) ASHP heating both building and DHW


   
👍
2
ReplyQuote



Transparent
(@transparent)
Illustrious Member Moderator
12955 kWhs
Veteran Expert
Joined: 3 years ago
Posts: 2278
 

Posted by: @cathoderay

my setup uses a small form factor PC connected to the heat pump via a wired modbus RTU connection, over which relatively short and simple python script collects data and writes them to CSV files, which can then be used to generate charts.

Excellent.

That's the same approach I'm using, albeit in a different area of energy technology - battery storage.

1: Collecting data like this will greatly add to the pool of knowledge regarding how the technology is actually operating, rather than what we think we've configured it to do!

2: Further sensors can be added to the Modbus wires to enhance the data-set in future

3: The CSV data can be re-visited when a fault manifests itself.

4: Graphical (chart) output is preferable.

I continue to be amazed how little useful information can be picked up from the IHDs we get supplied with our Smart Meters.
A chart could just as easily have been implemented using the same hardware, and would be far more useful to elderly consumers who grew up with analogue watches!

Save energy... recycle electrons!


   
ReplyQuote
(@derek-m)
Illustrious Member Member
15283 kWhs
Veteran Expert
Joined: 4 years ago
Posts: 4429
 

Hi Everyone,

For those of you contemplating using Modbus RTU to communicate with your heat pump, you may find the following informative.

https://ipc2u.com/articles/knowledge-base/modbus-rtu-made-simple-with-detailed-descriptions-and-examples/


   
ReplyQuote
(@derek-m)
Illustrious Member Member
15283 kWhs
Veteran Expert
Joined: 4 years ago
Posts: 4429
 

It is a long time since I was actively involved with Modbus, and then it was on an industrial system that probably followed the original Modicon mapping protocol more closely than may be the case with heat pump manufacturers.

Whilst it is possible to read data from a heat pump controller, and in some cases also write data to a heat pump controller, the main problem as I see it is knowing where this data is stored.

Modbus uses 16 bit registers to store data, which can be in the form of binary, integer (signed or unsigned) and floating point (again signed or unsigned).

Whilst the original Modbus Map assigns ranges of addresses to store the different data types, it does not specify where individual variables should be stored.

The Modbus Address for say ambient air temperature will probably vary from manufacturer to manufacturer. The starting point in reading such data must therefore start with obtaining a copy of the relevant Modbus Map, or if one cannot be found then reading each Modbus Address in turn and then trying to identify its contents.


   
ReplyQuote
(@cashback)
Trusted Member Member
187 kWhs
Joined: 2 years ago
Posts: 27
 

Posted by: @derek-m

The starting point in reading such data must therefore start with obtaining a copy of the relevant Modbus Map, or if one cannot be found then reading each Modbus Address in turn and then trying to identify its contents.

These are well known and documented for Midea ASHPs. There's an official PDF linked to further back in this thread if memory serves. 

 


   
ReplyQuote
(@derek-m)
Illustrious Member Member
15283 kWhs
Veteran Expert
Joined: 4 years ago
Posts: 4429
 

Posted by: @cashback

Posted by: @derek-m

The starting point in reading such data must therefore start with obtaining a copy of the relevant Modbus Map, or if one cannot be found then reading each Modbus Address in turn and then trying to identify its contents.

These are well known and documented for Midea ASHPs. There's an official PDF linked to further back in this thread if memory serves. 

 

Yes, I am aware. If my memory serves me well it is for a Chofu heat pump, of which Midea is a clone.

 


   
ReplyQuote
cathodeRay
(@cathoderay)
Famed Member Moderator
9928 kWhs
Joined: 3 years ago
Posts: 1999
Topic starter  

Posted by: @transparent

1: Collecting data like this will greatly add to the pool of knowledge regarding how the technology is actually operating, rather than what we think we've configured it to do!

2: Further sensors can be added to the Modbus wires to enhance the data-set in future

3: The CSV data can be re-visited when a fault manifests itself.

4: Graphical (chart) output is preferable.

I agree on all points. I have already done (2), adding a room temp (IAT) sensor, as the Midea one is in the wired controller, which in my case is in the airing cupboard, meaning it is not a reliable indicator of IAT in the main living rooms. Other advantages of csv data are that it is robust, it is very flexible about how it is used: in a spreadsheet, in a text editor, in python code, in dedicated charting software, whatever, and furthermore backs ups couldn't be easier, just copy the data file on a regular basis. The usefulness of charted output I particularly agree with, analogue representations are far easier for us humans to assimilate than the underlying digital data that the chart represents.

@derek-m - very minor correction, I believe Chofu is the clone (of Midea), not the other way round. I can also confirm my Midea wired controller came with a manual that has tables with the modbus register addresses, complete with typos and, more helpfully, any conversions factors needed eg if a one decimal place number is multiplied by 10 and sent as an integer, then it needs to be divided by 10 on receipt to get the true value. I seem to recall I have also seen images of similar tables for Samsung heat pumps.  

Midea 14kW (for now...) ASHP heating both building and DHW


   
👍
1
ReplyQuote



(@derek-m)
Illustrious Member Member
15283 kWhs
Veteran Expert
Joined: 4 years ago
Posts: 4429
 

@cathoderay

Thanks for correcting my memory loss, one of the pleasures of growing older. 🙄 

If anyone has discovered Modbus Maps for other heat pumps, maybe they should post them, so that we can compare them for differences in layout.


   
ReplyQuote
cathodeRay
(@cathoderay)
Famed Member Moderator
9928 kWhs
Joined: 3 years ago
Posts: 1999
Topic starter  

Posted by: @derek-m

If anyone has discovered Modbus Maps for other heat pumps, maybe they should post them, so that we can compare them for differences in layout.

Excellent idea.

Midea 14kW (for now...) ASHP heating both building and DHW


   
ReplyQuote
(@leichat)
Active Member Member
63 kWhs
Joined: 1 year ago
Posts: 9
 

Posted by: @derek-m

If anyone has discovered Modbus Maps for other heat pumps, maybe they should post them, so that we can compare them for differences in layout.

About an LG heat pump but hopefully of some use:

 


   
ReplyQuote
Page 17 / 18



Share:

Join Us!

Heat Pump Dramas?

Thinking about installing a heat pump but unsure where to start? Already have one but it’s not performing as expected? Or are you locked in a frustrating dispute with an installer or manufacturer? We’re here to help.

Pre-Installation Planning
Post-Installation Troubleshooting
Performance Optimisation
✅ Complaint Support (Manufacturer & Installer)

👉 Book a one-to-one consultation now.

Latest Posts

x  Powerful Protection for WordPress, from Shield Security
This Site Is Protected By
Shield Security