Connecting to Midea...
 
Notifications
Clear all

Connecting to Midea MSmartHome using a PC

364 Posts
13 Users
23 Reactions
21.6 K Views
(@iancalderbank)
Noble Member Contributor
3640 kWhs
Joined: 2 years ago
Posts: 644
 

@derek-m open source based software systems like HA and its add-ones need to be upgraded for all manner of reasons. the better mitigation is to have a fallback. you could go for dev, pre-prod and prod replications of the same thing, which is common in enterprise IT. but maybe overkill for home! in my case for now, it is that the old-school boiler on/off relay takes over.

My octopus signup link https://share.octopus.energy/ebony-deer-230
210m2 house, Samsung 16kw Gen6 ASHP Self installed: Single circulation loop , PWM modulating pump.
My public ASHP stats: https://heatpumpmonitor.org/system/view?id=45
11.9kWp of PV
41kWh of Battery storage (3x Powerwall 2)
2x BEVs


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

Posted by: @iancalderbank

anything new that I build, I use an ESP32

That makes sense, the extra capabilities and connections at very little extra costs are worth having.

Posted by: @iancalderbank

if you are electrically competent, take a spur off the supply and wire up a 13A socket using one of these

I think I can manage that without burning the house down, and given one of those 13 Amp sockets with USB charging points, it does seem by far the simplest and cheapest way to get USB power where I need it.  

Posted by: @marekk

I may add from practise is that ESP32 is very sensitive about 5V/3.3V power quality, especially during booting time when there is huge demand for current in very short time and many power supplies fail to provide, despite they are labelled 1, 2 or even 5 Amps.

Point noted, will check the spec carefully. From what I have seen so far, most single and double USB outlets are less than three amps. There are some four socket outlets with 5.1A max across all four sockets, something less on an individual socket. Maybe this is built into USB, the plug/socket can only carry so many amps before it starts cooking itself, in which case it may be better to have a separate dedicated power supply unit.  

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


   
ReplyQuote
(@iancalderbank)
Noble Member Contributor
3640 kWhs
Joined: 2 years ago
Posts: 644
 

@cathoderay cost-wise it makes far more difference to the price, if you buy the devices from someone in the uk (you can have it tomorrow), versus direct from Shenzen on aliexpress (wait 3-4 weeks) , than its does to which one you use.

the amps thing I've never had the issue @marekk refers to . I have used standard screwfix 2.1A USB outlet 230V sockets with no issues for multiple ESP's 32's and 8266's.

My octopus signup link https://share.octopus.energy/ebony-deer-230
210m2 house, Samsung 16kw Gen6 ASHP Self installed: Single circulation loop , PWM modulating pump.
My public ASHP stats: https://heatpumpmonitor.org/system/view?id=45
11.9kWp of PV
41kWh of Battery storage (3x Powerwall 2)
2x BEVs


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

Posted by: @derek-m

If you are using a system for control purposes, I would suggest not carrying out any form of upgrading unless it is absolutely necessary.

I couldn't agree more. That said, if HA does get broken, which I think will happen sooner or later (it's in its DNA...), then I think my proposed set up will just default back to Midea settings and control. In essence, I am not planning to replace the Midea controls, but rather to add an extra layer on top. If HA packs up, that top layer disappears, but the underlying Midea layers are still there, and carry controlling the heat pump as they normally would.

Posted by: @derek-m

A quick question. Is the ambient air temperature reading available in the Midea Cloud? What other variables are available in the cloud that are not being picked up by HA?

Ambient appears in the app, so by inference it is also in the cloud. It is visible on the front page of the wired controller, but not in the Operational Parameter pages. It also has an address in the modbus register.

On the assumption that if something appears on the app, it must also be in the cloud, the set (not actual) LWT is there. Apart from that, the app is very scrawny, hardly any meat on it at all, which is one of the main reasons for wanting to be rid of it. The other main reason is you can't download anything to another device, it can only be done manually. 

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


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

Posted by: @iancalderbank

cost-wise it makes far more difference to the price, if you buy the devices from someone in the uk (you can have it tomorrow), versus direct from Shenzen on aliexpress (wait 3-4 weeks) , than its does to which one you use.

the amps thing I've never had the issue @marekk refers to . I have used standard screwfix 2.1A USB outlet 230V sockets with no issues for multiple ESP's 32's and 8266's.

I prefer UK sellers because if something does go wrong, far from unknown, the chances of redress are better. I also know something is wrong, if it is, in days rather than weeks.

I'll give the Screwfix socket a go, I can do it most simply as a replacement for the current fused spur, as I understand it a plug and socket and fused spur are interchangeable (both provide a remote way of isolating whatever is being supplied, and arguably an unplugged socket is better, you can see it is disconnected) unless the current draw is very high eg a cooker. I wonder if the USB 2.1A supply is per socket, in which case maybe there is potentially 4.2A if you use both of them in parallel.  

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


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

I am having a serious rethink about Home Assistant. When I first came across it, it looked to me like enthusiasts software written for enthusiasts (that's the polite way of putting it). Despite my misgivings, I was nonetheless prepared to give it a try. It proved every bit as difficult and awkward to use as I feared, but after far too many wasted hours, it began to look as if it has some usable functions.

Last night, at 0412, it self destructed its database. I was asleep at the time, and so I claim no hand whatsoever in this event. All previous data got lost, and the database was started afresh. The logs as ever are useless - all the say is the database is dead:

2023-02-11 04:12:00.459 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (sqlite3.DatabaseError) database disk image is malformed

2023-02-11 04:12:00.470 ERROR (Recorder) [homeassistant.components.recorder.core] Unrecoverable sqlite3 database corruption detected: (sqlite3.DatabaseError) database disk image is malformed

followed by reams of garbage.

There is a corrupt database file, but it is, unsurprisingly, corrupt. It has some of the lost data, but it is impossible to recover most of it. The data, so far as I can tell, is lost forever.

This is not acceptable.

Even if I had backups, they would only cover up until the moment the backup was taken, any data after the backup until the moment of self destruction would have been lost.

I have to conclude that HA is indeed 'enthusiasts software written for enthusiasts' and that it is not ready for prime time.

 
      

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


   
ReplyQuote



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

@cathoderay

Have you considered a micro Programmable Logic Controller (PLC), Rockwell Automation have been producing quite a selection for a number of years.

I am more familiar with their range of larger PLC's, that are used extensively throughout virtual all industries where any form of automation is utilised.

I have not looked in detail at the available software, but I suspect it may have many of the capabilities of the larger systems, and I may be able to help with any programming requirements.

I have attached a link to some information below.

https://www.rockwellautomation.com/en-gb/products/hardware/allen-bradley/programmable-controllers/micro-controllers/micro800-family/micro800-plug-in-modules.html

Please let me know if you are still persevering with HA and decoding the Midea data, or that I am wasting my time in deciphering the data messages.


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

@derek-m - it is just I don't take kindly to software that destroys my data. The mini PC is new, there is no reason to suspect the hardware is at fault, I was in bed asleep when it happened, meaning the only culprit is HA/HA OS, they are the only thing on the mini PC. I don't mind software crashing, that happens, but when it destroys data, then I take great exception. Yes I know all about backups etc, but the point is a backup is only as good as the most recent backup, and frankly I don't think I trust HA to restore backups correctly. I haven't searched the HA forums for failed backup restores, but I bet there will be plenty of tales of woe. [couldn't resist doing it: searched for "home assistant backup restore failed" => About 5,450,000 results - the best one can hope for is they are not all about failed HA restores]

Working on the Midea data hasn't been wasted effort at all, we have definitely learnt something, and we may even have delayed the dread touch of Count Dementia for a few hours with all that brain work. Going back to original concepts, the primary purpose of all this is reliable heat pump monitoring (and possibly very light controlling), and I am wondering if the python midea_ac_lan code can be modified/set up to collect the data and append it to a csv or xls file.

The other thing that is in the background that might make cracking the wifi data redundant is getting modbus data from the wired controller. I still think that data will be more accessible, as in you query the register address that holds say the ambient temp and you get back the ambient temp in decimal rather than hex degrees C (or possibly in hex, but you know it is the ambient, and only the ambient, so it is an easy hex2dec conversion), but if I am going to ditch HA, I have to find an alternative that isn't even worse. That said, I am not one to bear grudges, I may find before long I am prepared to give HA another go. My recent post said I was having a serious rethink about HA, because it is not ready for prime time, but what if the others are even less ready?      

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


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

@cathoderay

I have been working with PLC based system for probably over 40 years, the few slight problems have been due to poor programming, since the hardware and software has been designed to be robust and resilient, and has normally been thoroughly tested before coming to market.

Communication is normally by some variant of Modbus or Ethernet, which may be dependent upon the model selected. If my memory serves me well, the data is normally displayed in decimal on the receiving PC, and graphs can be created to display the results.


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

@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.

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


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

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.

PLC's were originally designed to replace relay logic, so the developed programming technique was ladder logic, which in many ways is like 'electronic lego', the program being developed, rung by rung, hence the name. A Boolean input is represented as a contact, either normally open (NO) or normally closed (NC), with a Boolean output shown as a relay coil.

Over the years PLC's were developed to also accept analogue inputs, from numerous different types of sensors, and perform a wide range of mathematical calculations, again using the appropriate 'building block'. They now have building blocks for PID Controllers, where the programmer merely has to specify the inputs and outputs, and the Commissioning Engineer has full access to the optimisation parameters.

For those not familiar with ladder logic, programming can also be done using 'structured text'.

 


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

Posted by: @cathoderay

I have to conclude that HA is indeed 'enthusiasts software written for enthusiasts' and that it is not ready for prime time.

I don't want to diminish the pain of loosing stuff, I have been there before caused by a massive pulse of static that jumped from my finger onto the metal on/off switch of my HA machine and killed the motherboard and somewhat corrupted the SSD as well (I was wearing a fleece).  

But I do think that you are fundamentally wrong with the second part of your statement. 

No piece of software can cope with unreliable hardware.  I have not had a single issue with HA that was not caused by me (though this is a small statistical sample, of course).

If you are using the original disk that came with the machine you bought, use smartctl to check the disk for issues, even new disks can have manufacturing flaws.

Posted by: @cathoderay

frankly I don't think I trust HA to restore backups correctly.

I have backed up and restored many times, moved from pi to x86 and x86 to pi, never had issues not caused by me

Some metrics ... Home Assistant

  • is the second most contributed open source product on GitHub, behind VSCode (VSCode is a Microsoft "sponsored/curated" product)
  • is written mostly in the second most used language in the world, Python
  • has been going for 9 years. 
  • has over 225,000 active installs where the users have opted into analytics, so the installed base is likely somewhat bigger than this
  • sqlite is 22+ years mature
  • can use other more industrial strength databases as a back end if you so wish

In my experience, it has been extremely robust and I have been using HA for about 5+ years, including a period with Frigate real time image recognition of CCTV footage, so really hitting my disks hard and keeping CCTV footage.  (the disks were running on ZFS ZRAID2 across 4 discs - so not a simple install, but with a high level of reliability and performance).  The system was also controlling an 8 zone system (each room individually controlled) fed by my oil boiler as well as controlling the hot water and an alarm system using Shelly motion detectors.

Backups on home assistant are very easy to do. Restoring a home assistant system is a very quick and easy process, especially for the critical stuff.  Of course, when I got to the point of having hundreds of gigabytes of CCTV footage @1920x1080, backups started to get very slow (of course) hence my  change of architecture. 

But backing up is not about backing up, it is about being able to restore, and you are advised to test your backups on the hardware you have with the modules you have installed and the data those modules are collecting.

Posted by: @cathoderay

My recent post said I was having a serious rethink about HA, because it is not ready for prime time, but what if the others are even less ready?      

If you install HA on a reliable disk and backup regularly I don't think you will have any catastrophic issues.  Sorry for being so direct, but that is the truth.  You have the option to switch the underlying database to something more industrial, I have run both the sqlite3 and mariaDB, the latter provided more performance but neither caused me any issues.

I also push my metrics into InfluxDB with no retention period (keep forever).

 


   
marekk and Mars reacted
ReplyQuote



Page 10 / 31



Share:

Join Us!

Latest Posts

Heat Pump Humour

Members Online

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