Connecting Home Ass...
 
Notifications
Clear all

Connecting Home Assistant to a Midea Heat Pump

207 Posts
15 Users
54 Reactions
12.3 K Views
cathodeRay
(@cathoderay)
Famed Member Moderator
6905 kWhs
Joined: 2 years ago
Posts: 1391
Topic starter  

@derek-m - reading up on Russell's paradox (I am by nature a reader rather than a viewer), I came across this:

Russell's paradox becomes: let y = {x: x is not in x}, is y in y?

y = {x: x is not in x} is clearly pure python.

I'm glad you concur with the decision to deep six HA and midea_ac_lan. As I said before, I don't think we wasted our time, we had to try it to establish that is didn't work, or to put it more formally, HA = {HA: HA is not in HA}.

@transparent - thanks again for all your help and explanations. I think I have read elsewhere that some people have got away with just using two wires for the RS-485 A/B connections, no twisting, no earth, no shielding, no resistors, but I would rather over-spec than under-spec. Cat 5e cable isn't too expensive, is widely available, and is relatively easy to work with, and if it meets/exceeds requirements, that is good enough for me. I'm also conscious of the fact that all this will end up in the Beginner's Guide thread, once I have got it working, and I want that guide to be as clear and robust as possible.

I did wonder about using RJ45 plugs and sockets but shied away for the very reasons you give, the complexities of knowing which pin/cable is which. With simple wires, you can see which is which.     

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


   
ReplyQuote
Transparent
(@transparent)
Famed Member Moderator
8379 kWhs
Veteran Expert
Joined: 2 years ago
Posts: 1390
 

Posted by: @william1066

I am getting significant noise from my 10k thermistors.

Yes of course I'll share what results I get.
But as I said, I've only just imported these modules. They're still sat on the workbench, not connected to anything!

You'll need to be a tad more explicit about how you're connecting thermistors to such a module.
There are just too many unknowns for anyone else here to comment yet.

  • what wire is used to make the connection?
  • over what distance?
  • is it just a raw thermistor, or incorporated in a bridge circuit?
  • how is 1v being applied, and how noise-free is that source?

The spec for this module states that each analogue input requires a minimum 1mA current in order to allow accurate sampling.
1 volt across a 10k resistance is 10x too low.
How is this being overcome?

A photo of your set-up would help,
or perhaps a literal drawing on the back of an envelope showing the circuit diagram, and then photograph that. 🙂 

 

Once we know the answers to the hardware approach, I'm sure others here will comment about the use of digital filtering in your code.

I doubt that temperature is changing particularly fast.
So there's plenty of time to adjust the incoming readings and create an output which shows a smooth transition.

Save energy... recycle electrons!


   
ReplyQuote
Transparent
(@transparent)
Famed Member Moderator
8379 kWhs
Veteran Expert
Joined: 2 years ago
Posts: 1390
 

Posted by: @cathoderay

some people have got away with just using two wires for the RS-485 A/B connections, no twisting, no earth, no shielding, no resistors, but I would rather over-spec than under-spec.

Yes. If you've only got one RS485 port on the end of the cable, then you won't need a terminating resistor.

I'm currently experimenting using a screened twisted triple cable: Alpha Wire 78133
It's only 3.5mm diameter, using 22AWG conductors.
But it provides all the required flexibility to have 'earth connection or not', and 'screening or not'.

image

Save energy... recycle electrons!


   
ReplyQuote
cathodeRay
(@cathoderay)
Famed Member Moderator
6905 kWhs
Joined: 2 years ago
Posts: 1391
Topic starter  

@transparent - that Alpha Wire also appears to be alpha priced, £293.41 for a 100ft (30m) spool. The cat 5e FTP cable I got on ebay cost £7.98 for 20 metres. Again, with the Beginner Guide thread in mind, I want to (a) controls costs as far as possible (while avoiding false economies) and (b) use items that are easily available. Having said that, I note on the cable is says it is AWG28 (it wasn't stated in the ad), making it thin and flexible, and easy to install, but also on the thin side. Hopefully a short run (around 15m) plus fixed installation once in place so no flexing should mean it will be OK. Another learning point.

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


   
ReplyQuote
Transparent
(@transparent)
Famed Member Moderator
8379 kWhs
Veteran Expert
Joined: 2 years ago
Posts: 1390
 

Posted by: @cathoderay

that Alpha Wire also appears to be alpha priced, £293.41 for a 100ft (30m) spool

It depends in which clearance-sale you trawl for bargains. 😉 

I paid £11 because the wholesaler was going to be stocking a rival to Alpha-wire in future.

Save energy... recycle electrons!


   
ReplyQuote
Transparent
(@transparent)
Famed Member Moderator
8379 kWhs
Veteran Expert
Joined: 2 years ago
Posts: 1390
 

On a related note, I'm currently installing several BMS units from different manufacturers.

The Chinese ones have optional colour LCD touch screens, which use an RS485 interface for power and data.

LCDscreens

Adding the touch-screen to a BMS bundle can cost around £30-£45 (retail)

That suggests to me that there's at least one Chinese manufacturer who's recently developed a range of suitable Modbus screens.

It provides interesting possibilities for the development of a Heat Pump monitor which gives live readings of energy-consumption, COP and outside temperature, for example.
Once a controller has an RS485 interface, there's so many things you can do with it.

This post was modified 1 year ago 4 times by Transparent

Save energy... recycle electrons!


   
ReplyQuote



cathodeRay
(@cathoderay)
Famed Member Moderator
6905 kWhs
Joined: 2 years ago
Posts: 1391
Topic starter  

Bingo! The Eagle has Landed! 

I finally connected up the RS-485 wiring this morning, fiddly but only took a couple of hours if that from start to finish, and I now have a trial version of mbpoll polling the wired controller every second and logging the results every minute to a csv file. For proof of concept, I have set it to poll the holding register address 104 plus the following nine addresses where (according to the manual) 104 is the RWT, 105 is the LWT and 107 is the ambient outdoor temperature. Here is a brief extract from the log file:

2023-03-19T10:48:47.418,<00104>,36,41,4,9,55,4,41,25,39,50
2023-03-19T10:49:47.256,<00104>,37,41,4,9,55,4,41,25,39,50
2023-03-19T10:50:47.209,<00104>,37,41,4,9,56,4,41,25,40,51
2023-03-19T10:51:47.196,<00104>,37,41,4,9,56,4,41,25,40,51
2023-03-19T10:52:47.003,<00104>,37,42,4,9,57,4,42,25,40,52
2023-03-19T10:53:48.970,<00104>,38,42,4,9,57,4,42,25,41,52
2023-03-19T10:54:48.847,<00104>,38,42,4,10,58,4,42,25,41,52
2023-03-19T10:55:48.763,<00104>,38,42,4,10,58,4,42,25,41,53
2023-03-19T10:56:48.768,<00104>,38,43,3,9,58,4,43,25,41,53
2023-03-19T10:57:48.587,<00104>,39,43,3,9,58,3,43,25,41,53
2023-03-19T10:58:48.409,<00104>,39,43,4,9,58,4,43,25,42,53
2023-03-19T10:59:48.226,<00104>,39,43,4,9,58,4,43,25,42,53
2023-03-19T11:00:48.042,<00104>,39,43,4,9,59,4,43,25,42,54
2023-03-19T11:01:49.993,<00104>,39,44,4,9,59,4,44,25,42,54
2023-03-19T11:02:49.808,<00104>,39,44,4,10,59,4,44,25,42,54
2023-03-19T11:03:49.626,<00104>,39,44,4,10,59,4,44,25,42,54
2023-03-19T11:04:49.436,<00104>,39,44,4,10,59,4,44,25,42,54
2023-03-19T11:05:49.255,<00104>,39,44,4,10,60,4,44,25,43,54
2023-03-19T11:06:49.060,<00104>,39,44,4,10,60,4,44,25,43,55
2023-03-19T11:07:51.016,<00104>,40,44,4,10,60,4,44,25,43,55
2023-03-19T11:08:52.968,<00104>,40,44,4,10,60,4,44,25,43,55
2023-03-19T11:09:52.781,<00104>,40,45,4,10,61,4,45,25,43,55
2023-03-19T11:10:52.595,<00104>,40,45,4,10,61,4,45,25,44,56

The numbers after the <00104> (which indicates the first address being read) are the values, with the first one being the RWT, the second the LWT, and the fourth the ambient temp. The values are credible, the heat pump was off at the mains while I made the wiring connections, and so had cooled down by the time I turned it back on, so we expect to see the RWT/LWT rising, as we do. The values also correspond exactly to the RWT LWT and ambient displayed on the wired controller itself.

This is genuinely useful data, for example:

(1) I can see at a glance for example that a sensible delta t for the RWT/LWT is being maintained

(2) when combined with the flow rate (available but not yet being read) will allow calculation of the energy output

(3) energy output combined with whether the unit is doing space heating or hot water heating, I can allocate kWhs to space or hot water use

(3) I can see how well the weather comp curve controls the actual LWT in response to changes in the ambient temp.

Here's another sequence from a bit later, showing, I think, it reaching the set/target LWT, and then cooling down before restarting heating again. In effect, it is cycling. You can even see the ambient going up by one degree during the off period, and then going down by a degree once the compressor starts up again and exhausts cooler air into the surroundings:

2023-03-19T11:08:52.968,<00104>,40,44,4,10,60,4,44,25,43,55
2023-03-19T11:09:52.781,<00104>,40,45,4,10,61,4,45,25,43,55
2023-03-19T11:10:52.595,<00104>,40,45,4,10,61,4,45,25,44,56
2023-03-19T11:11:52.429,<00104>,40,45,4,10,61,4,45,25,44,56
2023-03-19T11:12:52.246,<00104>,40,46,4,10,62,4,46,25,44,56
2023-03-19T11:13:52.063,<00104>,41,46,4,10,63,4,46,25,44,57
2023-03-19T11:14:54.016,<00104>,41,46,4,10,63,4,46,25,44,58
2023-03-19T11:15:55.970,<00104>,41,46,4,10,63,4,46,25,44,58
2023-03-19T11:16:55.789,<00104>,41,46,4,10,63,4,46,25,44,58
2023-03-19T11:17:55.608,<00104>,41,46,4,10,64,4,46,25,44,58
2023-03-19T11:18:55.426,<00104>,41,46,4,10,64,4,46,25,45,58
2023-03-19T11:19:55.241,<00104>,41,46,4,10,64,4,46,25,45,58
2023-03-19T11:20:55.060,<00104>,41,46,4,10,64,4,46,25,45,58
2023-03-19T11:21:57.016,<00104>,42,46,5,10,63,5,46,25,43,58
2023-03-19T11:22:58.970,<00104>,40,41,8,10,51,8,41,25,35,48
2023-03-19T11:23:58.785,<00104>,39,39,9,10,48,9,39,25,33,43
2023-03-19T11:24:58.604,<00104>,38,38,9,10,46,9,38,25,31,38
2023-03-19T11:25:58.418,<00104>,37,37,9,11,44,10,37,25,30,35
2023-03-19T11:26:58.240,<00104>,36,36,9,11,42,10,36,25,28,32
2023-03-19T11:27:58.054,<00104>,35,35,10,11,40,11,35,25,27,30
2023-03-19T11:29:00.014,<00104>,34,35,10,11,38,11,35,25,27,27
2023-03-19T11:30:01.969,<00104>,34,34,8,11,49,9,34,25,31,32
2023-03-19T11:31:01.786,<00104>,34,37,6,11,54,6,37,25,35,50
2023-03-19T11:32:01.604,<00104>,34,36,7,11,51,7,36,25,35,48
2023-03-19T11:33:01.423,<00104>,34,37,6,10,49,6,37,25,36,46
2023-03-19T11:34:01.239,<00104>,35,39,5,10,49,5,39,25,38,47
2023-03-19T11:35:01.071,<00104>,36,40,5,10,50,5,40,25,39,47
2023-03-19T11:36:03.026,<00104>,37,41,4,10,50,4,41,25,40,47
2023-03-19T11:37:04.986,<00104>,37,41,5,10,51,5,41,25,40,48
2023-03-19T11:38:04.803,<00104>,38,41,5,10,51,5,41,25,40,48
2023-03-19T11:39:04.619,<00104>,38,42,5,10,52,5,42,25,41,48
2023-03-19T11:40:04.426,<00104>,38,42,5,10,52,5,42,25,41,49
2023-03-19T11:41:04.241,<00104>,38,42,5,10,52,5,42,25,41,49
2023-03-19T11:42:04.057,<00104>,38,42,5,10,53,5,42,25,41,49

Everything has been documented, I will write it up and post it in due course.

Phew!  

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


   
Mars, Kev M and Transparent reacted
ReplyQuote
Mars
 Mars
(@editor)
Illustrious Member Admin
17001 kWhs
Veteran
Joined: 3 years ago
Posts: 2339
 

@cathoderay, Well done!

Buy Bodge Buster – Homeowner Air Source Heat Pump Installation Guide: https://amzn.to/3NVndlU

Follow our sustainability journey at My Home Farm: https://myhomefarm.co.uk


   
ReplyQuote
cathodeRay
(@cathoderay)
Famed Member Moderator
6905 kWhs
Joined: 2 years ago
Posts: 1391
Topic starter  

Posted by: @editor

Well done!

Thank you!

After an hour's coding in python at my very basic level I can get this on screen (writing it to a file is not a problem):

datetime,RWT,LWT,ambient,flowrate
2023/03/19T19:16:46,41,46,8,1.33
2023/03/19T19:16:52,41,46,8,1.33
2023/03/19T19:16:58,41,46,8,1.34
2023/03/19T19:17:04,41,46,8,1.34
2023/03/19T19:17:10,41,46,8,1.34
2023/03/19T19:17:16,41,46,8,1.34
2023/03/19T19:17:22,41,46,8,1.34
2023/03/19T19:17:28,41,46,8,1.34
2023/03/19T19:17:34,41,46,8,1.34
2023/03/19T19:17:40,41,46,8,1.34
2023/03/19T19:17:46,41,46,8,1.34
2023/03/19T19:17:52,41,46,8,1.34
2023/03/19T19:17:58,41,46,8,1.34
2023/03/19T19:18:04,41,46,8,1.33
2023/03/19T19:18:10,41,46,8,1.33
2023/03/19T19:18:16,41,47,8,1.33
2023/03/19T19:18:22,41,47,8,1.35
2023/03/19T19:18:28,42,47,8,1.35
2023/03/19T19:18:34,42,47,8,1.34
2023/03/19T19:18:40,42,47,8,1.34
2023/03/19T19:18:46,42,47,8,1.34
2023/03/19T19:18:52,42,47,8,1.35
2023/03/19T19:18:58,42,47,8,1.35
2023/03/19T19:19:04,42,47,8,1.35
2023/03/19T19:19:10,42,47,8,1.33
2023/03/19T19:19:16,42,47,8,1.33
2023/03/19T19:19:22,42,47,8,1.33
2023/03/19T19:19:28,42,47,8,1.33
2023/03/19T19:19:34,42,47,8,1.33 

This output needs only ~20 lines of simple code, currently set up the read values every 6 seconds (changing interval just needs one number changed). The last value, flowrate is flow rate in m^3/h. 

I have already managed to get in the space of an hour or so three variables that remained elusive for weeks using HA/midea_ac_lan.

I will write this up properly and post it in the Beginner's Guide thread. May take a day or three to put it all together. 

 

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


   
Mars, Transparent and Derek M reacted
ReplyQuote
Mars
 Mars
(@editor)
Illustrious Member Admin
17001 kWhs
Veteran
Joined: 3 years ago
Posts: 2339
 

@cathoderay, maybe you could arrange and condense it into an article (word count is up to you) and it could be posted on the main site as a reference article. Let me know.

Buy Bodge Buster – Homeowner Air Source Heat Pump Installation Guide: https://amzn.to/3NVndlU

Follow our sustainability journey at My Home Farm: https://myhomefarm.co.uk


   
ReplyQuote
(@filipe)
Estimable Member Member
466 kWhs
Joined: 1 year ago
Posts: 62
 

@cathoderay Well done! I guess if you create HA sensors using this data you are home and dry with nice graphs. If you want the input power there are electric meters with Modbus interface. 

Phil


   
ReplyQuote
 MPHB
(@mphb)
Trusted Member Member
360 kWhs
Joined: 1 year ago
Posts: 23
 

@cathoderay First of all, I need to pay you (and Derek-M) my respect for your persistence. I have been waiting every day to see if there was any update.

Secondly, now that you are on the Modbus track, I wanted to point you at this (link) discussion on Home Assistant that starts with RS485 adaptors and currently (Post 723) ends with a user that has written code (in Github here) in recent days that might give you a jump-start.

There is a big chance that you have already seen it, but it would have been a pity if you hadn't.

Keep going, I am waiting for your next post. 


   
Mars reacted
ReplyQuote



Page 3 / 18
Share:

Join Us!

Latest Posts

Heat Pump Humour

Members Online

 No online members at the moment

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