@cathoderay I've just had a Midea heat pump installed and I was struggling to even get the M-thermal controller to connect to my WiFi, although I've made a little bit of progress.
The only Android app that seemed to want to connect was the Midea "NetHome Plus" one - MSmartHome didn't find it - and even then, NetHome Plus won't let me see anything after adding, saying the "network is not very good" although I know I've got reasonable WiFi signal where the unit is.
The msmart Python module finds it but, like you, I can only see device type, IP etc. The type is "C3".
This "midea_ac_lan" integration for Home Assistant works ( https://github.com/georgezhao2010/midea_ac_lan) so I can now at least see flow and DHW temperatures in HA and modify it if I want to, but there are only basic controls and temperature sensors available and not KWh.
I've had a quick look at the Python code for the midea_ac_lan module and it's way over my head, but it's possible someone might be able to work out how to query extra parameters.
@fishboy25uk - only just spotted your post. It seems we have had similar frustrating experiences using the Midea app (defo shiteware in my humble opinion), but I hadn't come across the python code you managed to find, that does look promising, and it even explicitly mentions heat pumps (which is unusual, it's normally just air conditioning units). I'll have a look and see what I can come up with.
Midea 14kW (for now...) ASHP heating both building and DHW
@fishboy25uk - we are definitely onto something. I'm running a weirdo Windows version of HA, but I managed to install midea_ac_lan manually, following the instructions on the github page you linked to, and it found my Midea controller automatically (a good sign), all the setting made sense, and I can now see my DHW tank temp in HA, and it is correct, ie it is the same as the temp showing on the wired controller. All done in about 15 minutes. I'll have a poke around in the python code and see if we can get to see other data.
Midea 14kW (for now...) ASHP heating both building and DHW
@fishboy25uk - a bit of progress. I have managed to add an entity called Outdoor Temperature and can get it to collect some data. The key bit of code for getting the data is in \c3\message.py eg this gets the DHW tank temp:
self.tank_actual_temperature = body[data_offset + 21]
Various offsets get different values (as you can see in the code) and I have tried various offsets but none make credible outdoor temps, especially this one!
But you can see the added entity. I think with time we might crack this. The Zone 1 Water-Temp by the way uses a binary sensor, it's either running or it is not, it doesn't give the actual LWT, at least on my setup.
Midea 14kW (for now...) ASHP heating both building and DHW
A little bit more info gathered by turning on debugging (instructions on the github page, log is in \config\home-assistant.log):
midea_ac_lan requests data and then gets a 50 character string back that looks like this:
010d77910303231e323041231905371919053c223c14310080
this then gets decoded/parsed into something like this:
Status update: {'zone1_power': True, 'zone2_power': False, 'dhw_power': True, 'disinfect': False, 'fast_dhw': False, 'zone_temp_type': [True, True], 'mode': 3, 'mode_auto': 3, 'zone_target_temp': [35, 30], 'dhw_target_temp': 50, 'room_target_temp': 24.0, 'zone_heating_temp_max': [65, 55], 'zone_heating_temp_min': [35, 25], 'zone_cooling_temp_max': [25, 25], 'zone_cooling_temp_min': [5, 5], 'room_temp_max': 30.0, 'room_temp_min': 17.0, 'dhw_temp_max': 60, 'dhw_temp_min': 20, 'tank_actual_temperature': 50, 'outdoor_temperature': 25, 'zone1_water_temp_mode': True, 'zone2_water_temp_mode': False, 'zone1_room_temp_mode': False, 'zone2_room_temp_mode': False}
which just happens to have 25 name:value pairs in it, making me think the 50 character string has two characters for each name:value pair (note the above examples are with my added 'outdoor_temperature' entity, which retrieves something that isn't outdoor temperature). Then there is that data_offset, +21, for tank_actual_temperature, but the tank_actual_temperature name:value pair is the 20th, not 21st, name:value pair. Perhaps it is using zero based counting? This might mean '14' represents 50?
The midea v3 protocol (which is in use here) also has encode/decode 8370 but I can't make any sense of the code that does this.
Any thoughts anybody? The code is available here:
Midea 14kW (for now...) ASHP heating both building and DHW
@batalto - I've gone one further, started a new thread on his github ishoos page.
Midea 14kW (for now...) ASHP heating both building and DHW
@derek-m - thanks, a bit pricey though, I think there may be open source alternatives.
Home Assistant is continuing to be the great time thief it always is. Yesterday I added the midea_ac_lan integration and managed to get DHW actual temp on the HA dashboard and available in History showing tank_actual_temp over time. Yesterday I had a DIY go at adding a new sensor entity for outdoor temperature and while I could get the option to show up, and could add the entity, it got the wrong data (see posts passim).
I then found some code buried in the midea_ac_lan git-hub pull pages which allowed me to add total_energy consumption and it worked! For a brief moment of glory, HA's dashboard showed the same total energy consumption as that shown in the wired controller. Proof of concept! It is possible to get custom data via wifi from the Midea controller! The necessary code was mostly just about understandable apart from the bit that actually gets and parses the data. Somehow you have to know the 'address' of the data, and then how to parse it, and I can't any references on how to do that anywhere. The actual relevant code that extracts and parses the data from the 'message. that comes back from the Midea controller is:
class C3Notify1MessageBody(MessageBody):
def __init__(self, body, data_offset=0):
super().__init__(body)
self.total_energy_consumption = (
body[data_offset + 4] +
(body[data_offset + 3] << 8) +
(body[data_offset + 2] << 16))
The key questions are how to know what data_offset to use, and where did the bitwise operators (<<) come from???
Now all that is history. The HA dashboard reports the Midea entities are unavailable. Nothing will resurrect them. I've no idea what terminated them but they are sure as hell terminated. Unfortunately I didn't take a screen grab, so you will have to take my word for the fact it did briefly work yesterday evening.
Nonetheless, I do have a History chart for the DHW, and it is rather revealing (this is why I persist in trying to get these things to work: they give you insights no manufacturer will ever tell you about). Basic parameters ate DHW set to 50 degrees, reheat kicks in at 40 degrees, timed to only happen between 1300 and 1400 daily. Here's the chart for yesterday:
On the left hand side, we see what we would expect, the water temp low and falling until 1300 when the reheat hicks in, as by then the water temp was 39 degrees. It took about 20 minutes to do the reheat, and by 1330 the tank was at 50 degrees, as it should be. The rest of the chart is the interesting bit. The tank is a standard Telford Tempest large coil 200L ASHP tank. These are blagged as having negligible heat loss. I don't think so. Look at the right hand side of the chart, from 1330 onwards. The temperature drop is far from negligible. Two hours after the reheat it had dropped two degrees, over the next two hours it dropped another degree, and so on, until I turned my PC (and so HA) off. The only time I took off any hot water was around 1800, when I drew off enough to wash my hands. All the other heat loss is passive loss from the tank.
Midea 14kW (for now...) ASHP heating both building and DHW
I have now got the two Midea sensors back, by deleting the device and then re-adding it in Home Assistant. It looks like the token and key used to connect to the Midea wifi changed overnight... which could be an infernal nuisance if it happens all the time. Anyhow, for now, here is the proof of concept, a so-called card from my dashboard in Home Assistant, showing DHW tank actual temp (available out of the box) and total energy consumption (a custom addition, if it can be added, then hopefully others can as well):
Midea 14kW (for now...) ASHP heating both building and DHW
I have now added something called History Explorer (<=link) to Home Assistant and things are looking up. You download a ~300kb javascipt file, add it as a dashboard resource (need to run HA in Advanced mode to have that option) and then add the card to a new dashboard (so there is no clutter). Here's the chart for the last few hours showing DHW tank temp and energy use:
The DHW is fine (and the temp does not appear to be dropping as fast today) but the energy consumption is a little ambiguous. It is based on the total energy consumption sensor, so somewhere some maths is being done. But its credible, and broadly agrees with what the Midea app shows.
History Explorer has two very useful features. Firstly, it is very interactive eg I can change intervals, slide the charts left and right etc. I can change from looking at what happened in the last hour to all last month in a few clicks. Secondly, it allows you to download the data in csv format - extremely useful.
Midea 14kW (for now...) ASHP heating both building and DHW
- 22 Forums
- 2,090 Topics
- 46.1 K Posts
- 46 Online
- 3,383 Members
Join Us!
Trusted Installers
Struggling to find a reliable heat pump installer? A poor installation can lead to inefficiencies and high running costs. We now connect homeowners with top-rated installers who deliver quality work and excellent service.
✅ Verified, trusted & experienced installers
✅ Nationwide coverage expanding
✅ Special offers available
Latest Posts
-
RE: Adding battery storage to SolarEdge PV system
Sadly I fear that they may well be right to do so. ...
By JamesPa , 1 hour ago
-
RE: Commencing on an ASHP Installation Process
Anitfreeze valves, or at least the ends of antifreeze v...
By JamesPa , 4 hours ago
-
@hughf, I think we’ll organise an RHH session at Instal...
By Mars , 17 hours ago
-
@el3b Hi, sorry to hear that, it is advisable to instal...
By ASHP-BOBBA , 19 hours ago
-
RE: Difficult positioning of air source heat pump
@rikiarn Out of intrigue, the thread reads as though Ai...
By Sheriff Fatman , 1 day ago
-
RE: Mitsubishi Ecodan Fails to Heat Water despite temperature drop
@m1kegibson If you are able to access the service me...
By HarriUp , 1 day ago
-
RE: When will heat pumps and install prices come down?
... which of course is impossible because the world mov...
By JamesPa , 1 day ago
-
RE: Surface mount or bury primaries for heat pump installation?
What you run the cable through will affect its current ...
By Transparent , 2 days ago
-
I don't know how to enable cooling on Daikin and @major...
By JamesPa , 2 days ago
-
My advice is reject unless they will delete the buffer ...
By JamesPa , 2 days ago
-
RE: Battery storage to run Heat Pump.
I would be surprised if the battery chemistry is going ...
By Transparent , 2 days ago
-
RE: Air source heat pump roll call – what heat pump brand and model do you have?
@dowallydrifter OK. I would recommend you read t...
By JamesPa , 3 days ago
-
RE: Solar to power Heat Pump for DHW
Wow, how big is your heat pump that it is pulling 6kW d...
By Old_Scientist , 3 days ago
-
There are DHW tanks with a built in heat pump that take...
By JamesPa , 4 days ago
-
RE: Vaillant AroTherm Plus 7kW
If the thermostat is connected to the call for heat ter...
By JamesPa , 4 days ago
-
RE: Renewables & Heat Pumps in the News
Yes I realise I'm picking this up a week late...... but...
By Transparent , 5 days ago
-
RE: Getting the best out of a heat pump - is Homely a possible answer?
@cathoderay how did you get a script to run for that- d...
By benson , 6 days ago