Scripts to drive an Ecodan heatpump via MELCloud

According to wxforum Ecowitt is an (or the) official reseller for Fine Offset, the manufacturer.

You might try to look there for reliable information about weather stations.
https://www.wxforum.net/index.php?PHPSESSID=tkhn2hci4quqdbbu4blbjp4la8&board=111.0

1 Like

@johncantor You may (or may not!) find this interesting.

I like using software to drive my systems because I can write tests like this:

I can very well see that this would be an anathema to someone who is happier looking after the hardware.

Of course the distractions in setting up the test and the rigmarole of caring for them and trying to run them is an annoyance to me. Even if I automated the running of them in a good environment, I still need to run that somehow. Even if I automated the running of that on every push and made it block the release of the software (as I do in my day job) then I still have to manage all that stuff.

The saving grace for me is that it’s protecting me from my own stupidity. For example it’s ensuring the startup temp can’t be higher than the maximum flow temp so at least I’m not going to break things. Even that is flawed of course because I could easily have mixed up the names of things.

Anyway, maybe that was interesting.

PS Here’s how the software chatters to me if I set it up in an IDE:

Have you published your MELCloud scraping scripts anywhere? I’ve written my own script based on information I gleaned from your posts, but others may appreciate something they can download.

While I’m here, and it’s vaguely on-topic, how frequently can you pull data from MELCloud servers? I’ve been able to get data every minute from them, but every now and then their servers will send stale data until I back off.

For instance, today I switched from every 2 minutes to every 1 minute, and the flow/return and energy values stayed the same until I went back to every 2 minutes. It’s as if there’s some over-eager caching engine on the server or something.

Here, I’ve switched the yellow ‘Solar’ feed to show grid import, which is more-or-less what the EcoDan is drawing. You can see there’s 3 cycles of the HP, yet the energy and temps have flatlined. Looking at the Hourly Temperatures report on the official website shows what’s really happening (from 16:00):

What is peculiar, though, some of the fields from MELCloud, like OperationMode, OutdoorTemperature and TargetHCTemperatureZone1 (Desired in 1st chart above) will continue to show real-time values.

This tends to happen for a few days, and then sorts itself out so that I can request data on a per-minute basis, until happens again some weeks later. Anyone else had this issue?

Similar? I get values which change only every 5 minutes ever since I started collecting back in January.

I may lengthen the interval in my collection script (based on the one by @TrystanLea ) to 2 minutes to see if that gets more frequent updates.

Yes, I’m seeing these problems @Timbones and @mjr since 2021-11. Until the firmware upgrade I was reliably getting per-minute data for all the fields.

I’m polling once a minute.

I’ve now altered my script to use ListDevices for what I can glean, but then also scrape GetHourlyTemperature. That’s quite ugly because the correct slot in GetHourlyTemperature keeps moving. I often get an incorrect reading exactly on the hour as the structure rotates. It’s very boring.

I merge them together into something like what I used to get from ListDevices but without the pump information which I can manage without. You can see in my algorithm that I was never using the pump state to guide things, just the OperationMode.

So far I haven’t been brave enough to publish fetch.py (320 SLoC) because I don’t want to upset Mitsubishi. I know it’s our data, but it is their servers. As a sysadmin I do try to be nice to other sysadmins. It does feel crazy that it’s taking me 320 lines of code to read a JSON body.

I’ve been able to poll ListDevices every minute, quite reliably, for most of this year. That is until it suddenly gets stuck dishing out the same values. When I notice this happening, I throttle it to 2 minute intervals (hello crontab), and I instantly get good data again. Just less frequently. After a couple days I go back to every minute, and it seems okay for a few more weeks.

It feels like the server is penalising me personally because I’ve used up my monthly quota or something (I haven’t noted when this happens). But it’s more likely to be some unintended glitch or incompetence than it is malice.

I could do with some way to detect when this happens and throttle back automatically, but I’ve not found a field that changes often enough. Maybe I’ll just poll less often overnight, or when I know it’s off.

Yeah, I’m using the heat pump frequency over three readings to see if it’s working again. It isn’t. Sigh

I’ve picked one of my feeds and counted how many null values appear for each day, which will be low for when I could poll every minute and high when I could only poll every other minute. Here’s how it looks:

It’s perhaps too early to draw any conclusion, but it looks like it tends to break towards the end of the month. Maybe that means we can return to minute polling next week?

I had assumed that this was just affecting me personally, but there’s a chance that it affects everyone at the same time. Like maybe they run out of processing quota on their AWS instance or something…

Ouch.

Unfortunately that’s an even more compelling reason to not invite more people to start polling every minute using our dodgy scripts.

Let’s see if it magically fixes itself on the 1st.

1 Like

Aren’t cloud services great :rofl:

Try 90s polling for a month?

Yep, it’s horrible.

In the UK we have a Renewable Heat Incentive scheme that’s essentially paying for your systems for us. We have to be sensible for seven years and that’s why I’m not even considering tinkering with the hardware.

Even if I could do all the monitoring by bolting things on, I’d still need to interfere to send it commands and that’s likely to look exciting to the assessors.

Actually, the government introduced the Metering and Monitoring Service Package (MMSP) program specifically to encourage owners to monitor their systems. It’s an extra thing on top and they paid for that too. Arguably our experience is showing that it’s not playing out as they might have hoped.

1 Like

Is it looking healthy now it’s a new month @Timbones ?

Nope. :frowning:
Will test again tomorrow. Back in March, I didn’t switch to the high rate until the 4th, possibly because I forgot about it.

I have worked out that when idle, CurrentEnergyConsumed shows a 60 W pulse every 3 minutes or so (averages out to about 20 W continuous consumption). This can be used as a “heartbeat” - if it sticks at the same value for several readings, then I’ll know to poll less often.

I also have a plan to poll less often when previous readings show the unit as idle (OperationMode = 0, water pumps off, etc). However, then I won’t be able to read the heatbeat to know if I can read at the higher rate when the pump is running. Needs more thought…

There may be a better way, which is to intercept the messages that the unit is sending to the cloud every minute (I’ve integrated my solar inverter this way, works very nicely). There’s this GitHub project that does exactly that, with 3 different methods. I tried this out before, without success - maybe I’ll give it another go…
Unfortunately, I think Mitsubishi have since added encryption to their messages, which make it significantly harder.

2 Likes

I’d forgotten about this for a few days, but yesterday (May 8th) I was able to switch back to polling every minute.

1 Like

@Timbones did that hold for you? I’ve been getting intermittent stale data ever since the firmware update (most recently with a five minute polling interval).

I’ve been able to poll every minute throughout all of May and June, though I’d set it to do every 2 minutes overnight. However, since July 5th, I’ve not been able to poll as often, which is peculiar.

Mine stopped updating at around 17:30 on 04/07 until around 20:30 on 06/07, then was fine until around 17:30 on 11/07 and has been stale since.

I know this isn’t terribly useful, but here’s what I’ve been seeing.

Could you possibly be having upload problems where it can’t send new data via your Wifi @Dan_Nichols ?

This is what I’ve got for the past week and a half. I don’t think it’s likely to be an upload issue as the hourly reports on MELcloud are always updated (thats what I use to manually check the hot water temperature when this sensor fails). I won’t 100% rule anything out at this stage though.

There’s an option somewhere in MELCloud to say “send me an email if the uploads are failing”. I can’t remember if it’s enabled by default. It would alert you if that was what was happening.

You can also see the last few weeks in MELCloud itself to see if the flat lines correlate with the flat lines in your downloaded data.