Posted by: @gormMay be, but also be the author know what he down. I dont know so much about this.
We will see, I looked in Visual Studio. There are about 3600 lines.
All he has done is use the modbus register address tables, and then wrapped it in that complex code. For example, he uses this to get the ambient temp:
- platform: modbus_controller id: ${heat_pump_name}_107 # Outdoor ambient temperature name: "hp_T4_outdoor_temperature" state_class: measurement register_type: holding address: 0x6B unit_of_measurement: "°C" value_type: S_WORD
whereas I do the same thing with:
ambient = instrument.read_register(107, 0)
Nor do I need things like Visual Studio, I can edit my code in something like Notepad++.
My entire code for collecting the minute by minute data is less than 100 lines. Complexity and obfuscation are not virtues!
Midea 14kW (for now...) ASHP heating both building and DHW
Posted by: @cathoderaywhereas I do the same thing with:
ambient = instrument.read_register(107, 0)Nor do I need things like Visual Studio, I can edit my code in something like Notepad++.
Watch out, you have a bug: You need to set the fourth argument to `true` in order to read the ambient temperature as a signed value as it is `false` by default (and presumably by virtue of adding the fourth arg, the third argument should be set to `3`, the default, to set the function code to read register). I think this is the only temperature value that needs to deal with signed integers (if any of your others start to read negative, you have bigger real world problems to worry about!)
@cashback - well spotted, thanks! It is also an example of why it is a good idea to post code so others can inspect it!
It looks as though the collected data got set to zero when it should have been negative. Here's the local Met Office weather station data for the night of 3/4 April showing a period below zero:
and here's my data covering the same period (green line is ambient):
Midea 14kW (for now...) ASHP heating both building and DHW
Posted by: @cashbackIf you're using the Home Assistant Node-RED addon, you should be able to download the following configuration, and import to Node-RED to get started:
GIST.GITHUB.COM "https://gist.github.com/benlancaster/3c416d8e0cb9f3c1ea22beb921f4a48a"
Midea ASHP Node-RED.json · GitHubGitHub Gist: instantly share code, notes, and snippets.
If I get a chance, I will go through and update the Description blocks for all the pertinent sections. There's lots to improve still, so it may change, but I'm minded to go down the route of creating a "proper" integration now that I have a working reference integration.
Many caveats:
- The sensor names are not particularly well done (they don't have a common prefix)
- "It works on my machine", it may very well not work on yours
- Zero warranty
- ... probably more
Consider it licensed under WTFPL.
Hello @cashback
I got my Raspberry Pi 3B up and running HA on Friday evening 😎. I’ve spent the last few days getting Node-Red, MQTT-IO, HACS, Midea_ac_lan and other Integrations for stuff I have up and running. HACS was the perhaps the worse, but I eventually found the command needed and got Terminal installed to run it. I then wondered why I didn’t show on the side bar, but eventually spotted it in Integrations and ran the installer. The Midea doesn’t do much, but it’s doesn’t drop out like their App. The only useful thing was the DHW Tank Temperature and the status information for DHW and Heating.
I bought a Modbus RS485 to USB so I guess that is next. What HACS integration did you start with?
Phil
Hi @gorm
So this uses an ESP8266 board? I have bought 3 Wemos 8266 D1 mini boards and 5 DT18B20 to enable monitoring the flow and return temperatures across the input and output of my plate heat exchanger and the DHW tank temperature. It stuck me that ESPHome is so convenient for interfacing to sensors via WiFi (I have BT Mesh Wifi Disks which give good coverage).
Could you explain the kit you use and the steps in a bit more detail.
Many Thanks Phil
Posted by: @filipeI got my Raspberry Pi 3B up and running HA on Friday evening 😎.
Make sure you have a high endurance SD card! I was running on a Pi3B for a time but it was getting through SD cards like nobody's business. They're not very capable boards so you may find you run in to the limitations sooner than later.
Posted by: @filipeWhat HACS integration did you start with?
I didn't! Just the Node-RED Addon and associated Integration.
Posted by: @cashbackMake sure you have a high endurance SD card
I would go a step beyond that recommendation.
The pioneering development of on-chip wear-levelling algorithms was undertaken by the Israeli firm, M-Systems.
In effect, there is an embedded processor which monitors the number of write-cycles to each memory location, and shares the data across the memory cells.
Each memory bank also has in-built redundancy, allowing write-intensive use under critical conditions.
M-Systems designed an system to shield users from handling that operation, and instead present a standard 'disc interface' which could be used by ordinary computers.
This was named True Flash Filing System.
After exchanging patents information in 2004, M-Systems was acquired outright by SanDisk two years later.
Sandisk offer three different strategies for wear-leveling which is still ahead of their major competitors.
The top-most product specification is normally only used for military and satellite development, and is manufactured solely in Western countries.
If you require SD card memory with error rates that are guaranteed, then SanDisk are most likely to be able to deliver that.
Samsung also use some M-systems technology under licence within their NAND-Flash product range.
It's too easy for other manufacturers to claim 'high endurance' without actually being able to guarantee that for each device.
Save energy... recycle electrons!
Posted by: @cathoderayGiven this basic setup, there is no need for modbus to be complex, and that's why I like minimal modbus (the python module) because it truly lives up to its name, a minimal but still human readable modbus interface for python. All you have to do is set the modbus parameters (baud rate, which is how fast the communication is, and various other parameters), name the slave, and then read or write to register addresses. It really is that simple. If you do it over a copper wire connection rather than wifi, it stays simple (two wires) and robust.
I've started writing a Midea Modbus client library. It looks like MinimalModbus is completely synchronous as far as I can tell, is that the case? I'm not sure I'll continue with it to be honest, the lack of TCP is a pretty major limiting factor.
Posted by: @filipeWhat HACS integration did you start with?
I didn't!
Indeed. HACS is a Right Royal PITA, bloated and painful to use. Most HA add-ons (integration is another bit of HA comedy jargon) can be installed manually, and if you do that you know you have added so that when you come to get rid of the add-on, as often you will, you know how to remove it cleanly.
There are two SSH/Terminal add-ons, the 'official' one and the HACS one. The former is crippleware, the latter is specifically designed to remove some but not all of the HA 'we know better than you' crippleware limitations. Once you have installed the latter, you have to disable Protected Mode, and then you can get something approaching root access using 'docker exec -it homeassistant bash' on the command line. You can then use most Linux command line tools, run python scripts and use pip to install modules etc.
You can get a perfectly usable mini PC with more capability, more ports and proper memory for for the same price or less than the price of a Raspberry Pi. A fanless unit is also silent and uses very little power.
Posted by: @cashbackI'm not sure I'll continue with it to be honest, the lack of TCP is a pretty major limiting factor.
This is only a problem if you want to connect over the internet. It is not necessary, a single wire is simpler and more robust. For a beginner, there is absolutely nothing to be gained by adding superfluous layers of complexity. I could use a helicopter to get from the ground floor on my home to the first floor, the winch man lifting me out though a ground floor window and then swinging me in through a first floor window, and while enthusiasts might enjoy the challenge of doing this (what could possibly go wrong?), I'll be sticking to using the stairs for the time being.
Another major plus in minimalmodbus is the simplicity of the code, which is also very well documented by python standards. Ramshackle, chaotic and obfuscated code with cavernous indents meaningless to man is best left to the python sado-masochists.
Midea 14kW (for now...) ASHP heating both building and DHW
Posted by: @cathoderayMost HA add-ons (integration is another bit of HA comedy jargon) ...
Not quite, there's an important distinction between an Addon and an Integration. An addon adds functionality in the form of standalone "appliance", an integration integrates an existing platform/service/device/whatever to Home Assistant functionality.
Node-RED is a great example as there's both an Addon and an Integration. The Addon gives you an instance of Node-RED to play with. The Integration allows you to integrate your Node-RED instance in to Home Assistant.
One Adds functionality, the other Integrates with existing functionality. Not jargon at all.
Posted by: @cathoderayPosted by: @cashbackThe lack of TCP is a pretty major limiting factor.
This is only a problem if you want to connect over the internet. It is not necessary, a single wire is simpler and more robust. For a beginner, there is absolutely nothing to be gained by adding superfluous layers of complexity.
No, that's not right. Modbus over TCP is extremely useful for local control over a local network. For example, my Midea controller is in the garage and currently hooked up to my Home Assistant via USB Modbus device sat right next to it. However, I also have a DIN rail mounted Modbus to power-over-ethernet adapter which I would like to use to develop my client library since it removes the need for physical access to the device (and my desk is 15 metres away and I don't fancy setting it up in the garage). It's still a single wire in and a single wire out.
You can also have multiple computers communicate with a TCP Modbus device, whereas you can only connect one to a USB Modbus device.
Posted by: @transparentIf you require SD card memory with error rates that are guaranteed, then SanDisk are most likely to be able to deliver that.
Interesting. Amazon showed a kit with power supply and SanDisk Ultra microSD card. I had better back it up from time to time to my PC, just in case. So far it seems ok - I’m glad to know it has smart technology to make it last longer.
Phil
More Home Assistant sh!te - why you really need Home Assistant like you need a hole in the head. After being nagged, I manually updated the HA core/OS the day before yesterday. Afterwards, everything seemed fine, only it wasn't. The update destroyed my python setup and reinstalled python 3.10 without retaining the minimalmodbus module I had added (pip install minimalmodbus etc). Of course, no warnings, and the only advice I will now be sure to get is RTFM...
Now, where's my brace and bit, I need to drill another hole in my head to relieve the intracranial pressure caused by HA...
The reason why I haven't written up the Beginner's Guide to Heat Pump Monitoring V2 'how to' posts is because I still have a hybrid system, with HA (not) doing some things in the background. Worst of both worlds, can't recommend it to anyone. I need to ditch HA entirely and set up an alternative system, but I have other calls on my time these days, so it'll have to wait, not that there is any urgency, the heating season is all but over.
Midea 14kW (for now...) ASHP heating both building and DHW
- 21 Forums
- 1,962 Topics
- 42.6 K Posts
- 59 Online
- 2,276 Members
Join Us!
Heat Pump Dramas?
Thinking about installing a heat pump but unsure where to start? Already have one but it’s not performing as expected? Or are you locked in a frustrating dispute with an installer or manufacturer? We’re here to help.
✅ Pre-Installation Planning
✅ Post-Installation Troubleshooting
✅ Performance Optimisation
✅ Complaint Support (Manufacturer & Installer)
Latest Posts
-
RE: Volumisers in Heat Pump Systems: Does Placement Matter?
@jamespa Agreed. I think it’s a case of much over muchn...
By Mars , 10 minutes ago
-
@eliuccio Unfortunately, whilst I agree with a lot of...
By JamesPa , 37 minutes ago
-
RE: Newbie out of her depth – Samsung AE120RXYDEG 12kW heat pump
@bami I think if the heat loss documentation matches a ...
By bontwoody , 60 minutes ago
-
RE: What is the best strategy for operating a very oversized heat pump?
@jamespa I'm afraid that's over my head but if anyon...
By IRMartini , 1 hour ago
-
RE: Setback savings - fact or fiction?
And here in case any one wants it is the code I used in...
By cathodeRay , 2 hours ago
-
RE: Samsung Gen 7 R290 12kW is not behaving how I expected
Definitely its in the 20xx FSVs. Conversely it may be...
By JamesPa , 2 hours ago
-
RE: Towel rails. An unexpected final hurdle
We have both Normal Rad for heating the room and then a...
By IRMartini , 3 hours ago
-
RE: Heat Pump Sizing & Installation Costs
Perhaps useful to have installed date too? To get conte...
By Tim441 , 6 hours ago
-
RE: SolarPV tables / online calculator
I'd be interested what others find whilst using that we...
By Majordennisbloodnok , 8 hours ago
-
RE: F.788 Building circuit pump reports internal fault - Vaillant Arotherm
Guess I have to wait for engineer visit. I really hope ...
By jeegnesh , 20 hours ago
-
RE: Act now to defer the UK road tax increase on EVs
@majordennisbloodnok Damn right sir. my attempt at iron...
By Jancold , 22 hours ago
-
RE: ASHP and heating issues in new build house
That’s good gives you more capacity. It made me think, ...
By Terry1812 , 24 hours ago
-
RE: Seewet manhole cover within r290 exclusion zone
Thanks! I asked Vaillant, and they say I should be fi...
By dbrb2 , 1 day ago
-
Looking for the Grant Aerona 3 setting to turn off completely at 20 OAT
I'm running my Aerona 3 on WC and the 'warm end of that...
By damonc , 1 day ago
-
RE: Do I just go with the lowest quote for my heat pump?
So after signing in Sept in two weeks the install may s...
By Jancold , 1 day ago
-
RE: Victorian Semi Retrofit / Extension ASHP and UFH Advice
When you are renovating is always a good time, as it ma...
By JamesPa , 1 day ago
-
RE: Just one room not reaching desired temperature
Looks like this issue is now resolved. Aira installed a...
By ChandyKris , 1 day ago
-
There have been several people on the OpenEnergyMonitor...
By RobS , 2 days ago
-
RE: Say hello and introduce yourself
Good point @jamespa But that probably strengthens @ch...
By Transparent , 2 days ago
Latest Topics
-
Heat Pump Sizing & Installation Costs
By Mars 8 hours ago
-
Volumisers in Heat Pump Systems: Does Placement Matter?
By Mars 9 hours ago
-
SolarPV tables / online calculator
By MichelleC 16 hours ago
-
By Toodles 2 days ago