Connecting to Midea...
 
Notifications
Clear all

Connecting to Midea MSmartHome using a PC

364 Posts
13 Users
23 Likes
20.6 K Views
cathodeRay
(@cathoderay)
Famed Member Moderator
6848 kWhs
Joined: 2 years ago
Posts: 1387
Topic starter  

Posted by: @william1066

Sorry for being so direct

No need to apologise, I never mind people being direct ie speaking plain (rudeness and worse is another matter). I'm still thinking this through. The problem is within a short time of setting it up, HA had a pretty catastrophic failure. I need to be persuaded either it was a one off (unlikely) or I can set up a manageable way of dealing with these predictable failures. At the same time, I find myself asking: why would I want to use software that has predictable failures? It's like driving a car in which you know the wheels are going to come off, and spending ages working out how to get out of the ditch. Maybe best to get another car... 

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


   
Mars reacted
ReplyQuote
(@william1066)
Reputable Member Member
1333 kWhs
Joined: 1 year ago
Posts: 206
 

Posted by: @cathoderay

I will certainly look into the PLC options.

I suspect a number of them probably also use sqlite internally.  Not that should worry you, there are apparently over 1 trillion deployments of sqlite.  Which I can believe.  And it was originally built for use on guided missile destroyers. 


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

@cathoderay I found this forum yesterday and have enjoyed reading of the attempts to get more information about the performance of Midea ASHPs. I can’t pretend that I have taken everything in. 

A few observations first. 

1. I have been monitoring energy consumption, and certainly, back in the summer, I had zero confidence in the figures reported by the App. I was disappointed my installer did not fit an energy meter as I understood both input and output energy was reported. Alas the App did not deliver. My solution was to estimate usage by only running the DHW at times when other usage was minimal and monitor everything else with the SmartThings and Meross outlets I had. I reduced everything else to a pretty steady 200W base load. This was also good preparation for cutting out waste and replacing old inefficient things like the tumble drier with a heat pump model.

2. I believe there are inaccuracies in the Midea input consumption figures. The method they use is to add integer kWhs units to the hourly period every time the meter rolls over. I would not be confident that the allocation to CH or DHW was based on each having a virtual meter. 

3. My installer has little interest in fixing problems such as the reporting of Tank Buffer Heater consumption, which is perverse as there apparently isn’t one means by at least checking that DIP is correctly set. I refuse to fiddle as it is under guarantee.

4. I run my CH with the pump producing water at 39c which gives about 33c in the new oversized radiator (22 in all) required for the HMG BUS scheme. Just under 3 weeks ago my 6.3kWp Solar and 20kWh batteries went live, and combined with the GO tariff I am very happy. I mostly use off peak electric. But 42c gives a quicker warm up. The 12kW pump just about copes and doesn’t cycle when I heat the whole house. Each of the three zones raises the peak hourly consumption up one kWh approximately depending on outside temperature. The heat loss calculations suggested 12kW met the MCS requirements for the BUS scheme.

5. I think I have used 1850kWh over the last 9 months against about 2050kWh reported by the Midea. My consumption model would be significantly wrong if I had underestimated the consumption of the various appliances and devices. 4000kWhs is the annual gas equivalent (3:1) consumption with an overall COP of 3 based on a milder winter. I have cut back though, and ran the wood burner 12 hours a day until the Solar started. The logs ran out then also.

6. My last remaining desire is to know the output energy so I can calculate the COP.

7. DHW will not have a high COP because the COP reduces the higher the target DHW temperature is. I find 48c adequate. If you look at the smart meter IHD the power increases with the achieved temperature in the cylinder. It will reach over 3kW from the low 40s and the temperature rise significantly slows.

8. I can understand wanting to be reassured that the heat pump is working efficiently, but an energy meter is enough along with comparison with gas consumption and an average COP.

9. I don’t bother with heat curves. I just use the water temperature as a thermostat. 

10. There are lots of bugs in the MSmartHome App/Modbus control interface: The time refuses to switch from BST/GMT (the change happens but reverts later); It no longer gives DHW priority possibly because I prefer to use a schedule to do the DHW overnight or to do it manually. I’m sure there are more.

11. It was really fascinating to read the detective work done to understand the Modbus interface. I’m not surprised there are bugs with such a primitive interface.

12. I would like to be able to obtain the cumulative output energy figure once a day. So being pointed in that direction would be appreciated. I am also hoping to automate my daily monitoring of my SolarEdge system, my weather station and Octopus account. 

Sorry for such a long post. I hope some of it helps others.

Phil

 


   
ReplyQuote



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

Posted by: @william1066

use smartctl to check the disk

I really do appreciate your input, and will reply to the rest of your post in a moment, but I want to give a typical example of a bottomless HA rabbit hole. By bottomless, I mean you never actually arrive anywhere, you just keep on falling through the HA void, an eternal descent into darkness. I know this is going to sound like I am whining, and perhaps I am. But I am not computer illiterate, and I should be able to do this (run a SMART tool) almost in my sleep. What happens next is a classic example of why HA such a PITA.

1. HA runs headless (a rather dumb use of a word that suggests it runs brainless, it actually means it runs faceless ie no monitor: you can't interact with it directly without faffing about with spare monitors and keyboards etc). Instead, you have to install as HA adddon that provides a terminal via SSH to the HA OS command line. There are enough warnings about doing this to mean any sane person will want to hide under the duvet for the rest of the day.

2. Having got to the HA OS command line, I type smartctl, hoping the HA goons have had the good sense to include some utilities. Get back 'command not found'. No surprises there.

3. Now, if this was Windows, I would just download and run the smartctl executable. But it is not Windows, so I have to do some sort of sudo dance to get the frigging thing. There are more options available online for the specific command required to install smartctl than there are hairstyles on Brighton beach, so I pick one that looks plausible. I go with sudo apt-get update && sudo apt-get install smartmontools. Result: command not found. I can't even run sudo... 

4. The case for going back to bed and forgetting all about HA gets stronger. However I persevere. I google 'home assistant sudo not found'. Even before I hit return, I know what the search results will be: yet another infinite library of threads of despair, thread after thread of frustrated HA users never getting a sensible let alone useful response from the HA goons that act as moderators and 'experts'.

5. Sure enough that is what I get. As is usually the case, most of the threads are full of illiterate HA smart arses and wise guys cracking off against each other, as if someone had dropped a match into a box of fireworks. Reading between the lines, it turns out (I sort of already knew this) that HA OS is crippleware. The HA goons have decided in their infinite wisdom that we mere users need to be protected from ourselves. Far from feeling cosily protected from myself, I start to feel a profound pain about 12 inches below and behind my navel.

6. A bit later, I find a literate sentence, but it is not good news: 'You cannot install extra software into hassos'. Brilliant, bit also, I suspect rubbish. Aren't the official HA addons software, and they can be installed. As usual, nothing about HA makes any sense. Later on, the advice gets to the usual but useless wipe your disk and reinstall. Sorry guys, life's too short.

7. I try a different google search: 'home assistant run smart disk check'. Apparently what I need to do is install 'smartmontools v7.0 or above (because v7 and above has json output)' which of course I can't do, plus do a whole load of other crap I can't do, and then do the following:

#!/bin/bash
for arg in sd{a..m}; do /usr/sbin/smartctl --info --all --json --nocheck standby /dev/$arg > /home/mike/.docker/config/homeassistant/smartctl/$arg.json; done

FFS, what planet are these guys on!?!

My point put simply is this: why can't I just do something as basic and as simple as check my hard disk using S.M.A.R.T?    

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


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

@william1066 - I am comfortable with sqlite, have used it on a number of occasions, and by used I include using it at a command line/sql level. I know the basics of what a database is, how to run queries etc. Yesterday, for example, I tried dumping (and recovering) the corrupt database to to an sql file and then importing the sql file both into a new database and HA's current database but the bottom line in all cases is there is about ten days of data that has apparently got lost for ever. Today I might see whether I can get it out as a csv file and see what's there in a spreadsheet.

From what I know of databases, sqlite is pitched at about the right level for something like HA, which hardly makes great demands on a database. The bulk and core of the database is the states table, which could just as easily be a csv file, that logs the various sensor states. Something like HA doesn't need, and probably shouldn't have, an overly complicated database back end. As you say, sqlite gas been around for decades, its lightweight and mature, it's the obvious choice.

Given what happened (sudden and fatal database corruption), and when it happened (4am), I do strongly suspect HA is the culprit, but I do appreciate even new hardware can have problems and so I will run a check on the 60GB SSD HA OS is installed on. I can do this not thanks to HA (see previous post), but because I am nerdy enough to have a bootable Win PE USB stick with some useful utilities on it.

Deep down, I do know losing that data is partly my fault, because I hadn't set up a backup system (all my other critical stuff, PC, blogs etc, all gets backed up regularly, ie I know backups matter) (and i agree, backups are useless if they can't be restored), I just didn't expect HA to fail so early on.      

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


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

Posted by: @filipe

2. I believe there are inaccuracies in the Midea input consumption figures. The method they use is to add integer kWhs units to the hourly period every time the meter rolls over. I would not be confident that the allocation to CH or DHW was based on each having a virtual meter. 

3. My installer has little interest in fixing problems such as the reporting of Tank Buffer Heater consumption, which is perverse as there apparently isn’t one means by at least checking that DIP is correctly set. I refuse to fiddle as it is under guarantee.

Welcome to the forum. Yes, agree, both I and @batalto have long suspected these figures may not be as accurate as they appear eg how can the app report usage for a heater that doesn't exist? In fact, I know they are not accurate, insofar as I do have an external kWh meter on the dedicated supply to my heat pump, and it shows, rather bizarrely, because you would imagine Midea wouldn't want to do this, that the app over reports kWh usage, by about 12%. Which gets us to where all this started, if you will forgive my language, the app is crap.

Posted by: @filipe

10. There are lots of bugs in the MSmartHome App/Modbus control interface: The time refuses to switch from BST/GMT (the change happens but reverts later); It no longer gives DHW priority possibly because I prefer to use a schedule to do the DHW overnight or to do it manually. I’m sure there are more.

Yes, agree again, more bugs than under a paving stone. One particularly annoying one is that if you go into and exit the 'For Serviceman' pages on the wired controller, it turns everything off. The front page sometimes shows the phantom Tank Booster Heater is running. I also have the DHW on a timer (but middle of the day, as it's usually warmer then) but every now and then the heat pump decides to heat the hot water when it should not, or vice versa, not heat it when it should.  

Posted by: @filipe

12. I would like to be able to obtain the cumulative output energy figure once a day.

This is indeed the intermediate goal, accurate energy output, as it means COP can be calculated. COP does matter, it really is at the heart of everything about a heat pump. In order of increasing complexity, the ways to get that energy output figure appear to be:

1. manual transcription on a weekly basis from the app into a spreadsheet. Tedious and boring to do, subject to app reporting errors

2. collecting data wirelessly from the Midea wired controller over a local network (what this thread has mostly been about) or from the Midea cloud (over the internet). Both of these suffer from the impenetrability of the Midea handshaking and data transmission routines. The modified python midea_ac_lan module has partly solved this problem as a way to get the data locally, as it can report both total energy consumed and total energy produced. What we don't know is how reliable the figures it produces are. Might they have the same inaccuracies as the app figures (seems very possible)? I was hoping to have a provisional answer to this tomorrow, when I will do my weekly external meter reading, which I would then use to compare usage recorded by that meter with that recorded by HA, but HA self destruction of last weeks data means that won't happen, I'll have to wait for another week.

3. a wired connection to the Midea wired controller that gets the data via modbus/RS-485 (these are protocols). There are sporadic but credible reports on the internet that this can be done, and I think it bypasses all the Midea encoding nonsense, you just read a modbus register address and get back a human readable result. It does involve writing some code, but the main headache is getting the practicalities of the hardware needed right. I'm still working on it, with some great and very helpful input from others on this forum.

4. all external monitoring using external sensors. This can definitely be done, and gets the gold standard results, but it is expensive (all in not less than £200, and if you wanted to you could easily double treble or even quadruple that figure), and again the practicalities of the system are not straightforward. 

As others have said before, and I have repeated elsewhere on the forum, it's a long long road, with many a winding turn, that leads to who knows where... 

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


   
Filipe reacted
ReplyQuote
(@mookyfoo)
Trusted Member Member
327 kWhs
Joined: 2 years ago
Posts: 27
 

Posted by: @cathoderay

Yes, agree again, more bugs than under a paving stone. One particularly annoying one is that if you go into and exit the 'For Serviceman' pages on the wired controller, it turns everything off. The front page sometimes shows the phantom Tank Booster Heater is running. I also have the DHW on a timer (but middle of the day, as it's usually warmer then) but every now and then the heat pump decides to heat the hot water when it should not, or vice versa, not heat it when it should.  

I flicked the DIP switch inside the unit to stop the TBH showing in the app, I told my installer and he was happy for me to do that and a few other changes. I too as the other poster said do our DHW over night on a schedule because I found the automated DHW stopped working and it was cheaper being on economy 7 to do it over night on the schedule.

The app is just a guide as far as I'm concerned.

I was meant to get the FreedomHP cloud app that tells all and sends FreedomHP messages when theres problems with your system but it can only be bought via your installer. Mine says he ordered it but FreedomHP say they have no order. 

Has anyone contacted FreedomHP to see if they can supply the protocol for the RS485?


   
Filipe reacted
ReplyQuote
cathodeRay
(@cathoderay)
Famed Member Moderator
6848 kWhs
Joined: 2 years ago
Posts: 1387
Topic starter  

Posted by: @mookyfoo

Has anyone contacted FreedomHP to see if they can supply the protocol for the RS485?

I think it is generally well known on here that I am no fan of Headroom Heat Pumps because they refuse to talk to us mere punters. We put the food on their table, but remain beneath their contempt.

The Freedom cloud app should be a standard offering. I don't know how accurate the data it reports is, but I suspect it uses RS-485/modbus-RTU as it is done "all through an incredibly simple to install piece of hardware" ie most probably a RS-485 converter which is a two wire connection, so it may bypass the Midea app entirely. What we don't yet know is how accurate the modbus data is.

That said, Midea do publish their modbus address registers, in their wired controller Operational Manual and elsewhere, and I may be wrong, but I think that amounts to 'the protocol', the RS-485 (a serial bus) is just how the requests/data get transmitted to/from the wired controller.

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


   
Filipe reacted
ReplyQuote
cathodeRay
(@cathoderay)
Famed Member Moderator
6848 kWhs
Joined: 2 years ago
Posts: 1387
Topic starter  

This very quick and dirty chart shows the data is still present in the corrupt database. Procedure: open corrupt database in sqlite database browser, run the query "select * from states where entity_id like '%total_energy_cons%'", export the result set as csv, open in spreadsheet and plot total_energy_consumed against time stamp:

states by time

 

It is quick and dirty, but a clear day on day progression can be seen (total_energy_consumed is a total lifetime measure). The plot has somehow (and actually rather usefully) clumped all of a days readings into one position on the x axis, and so the verical spread of the clump gives a visual indication of that day's use. The 11th Feb clump is small because the database died at 0412 in the morning.

All this begs the question: why did HA reject this usable data?

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


   
william1066 reacted
ReplyQuote



(@derek-m)
Illustrious Member Moderator
13648 kWhs
Veteran Expert
Joined: 3 years ago
Posts: 4158
 

Posted by: @cathoderay

@derek-m - I will certainly look into the PLC options. I think it is entirely possible HA over-complicates things. All I really need is time stamped data in a spreadsheet, even a CSV file would be fine, I can more than look after doing any basic manipulation of the data and making pretty plots. If I've understood things right, ESPhome doesn't have to have HA as it's front end, so all the ESP stuff can still be useful.

Here is some 'bedtime' reading detailing the capabilities of even a micro (very small) PLC.

 


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

Posted by: @derek-m

Here is some 'bedtime' reading

That will certainly cure any insomnia!

I have now run SMART reports using a Win GUI for smartctl on a bootable Win PE USB stick on the HA OS drive and it passed everything. It also reports 316 LifeTime hours, confirming the drive is new (I took delivery just under a fortnight ago).

I notice in the HA logs it corrupted the database again, this time at 10:25 this morning. Interestingly, I just happened to run a backup from inside HA at 10:24 this morning. Happenstance, coincidence or enemy action?   

 

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


   
ReplyQuote
(@derek-m)
Illustrious Member Moderator
13648 kWhs
Veteran Expert
Joined: 3 years ago
Posts: 4158
 

Posted by: @cathoderay

Posted by: @derek-m

Here is some 'bedtime' reading

That will certainly cure any insomnia!

I have now run SMART reports using a Win GUI for smartctl on a bootable Win PE USB stick on the HA OS drive and it passed everything. It also reports 316 LifeTime hours, confirming the drive is new (I took delivery just under a fortnight ago).

I notice in the HA logs it corrupted the database again, this time at 10:25 this morning. Interestingly, I just happened to run a backup from inside HA at 10:24 this morning. Happenstance, coincidence or enemy action?   

 

I presume you have carried out a virus check?

Am I correct in assuming that HA is written in Python, if so which version? It may not be relevant, but I remember reading that V2 cannot accept all the same data types as V3.

If it is not too onerous, it may be necessary to wipe the disc and start again.

 


   
ReplyQuote
Page 11 / 31
Share:

Join Us!

Latest Posts

Members Online

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