EmonHub support for Samsung Heatpump Monitoring via Modbus

Where does the pump flow rate come from? Are you getting it directly from the Sika sensor?

If you can post what you have actually done, it may well help others (even if that has modified the interfacer).

I have two flow rate sensors, one in the pump pump about ±10% accuracy and the Sika sensor ±2% accurate. Both read via modbus.

I have the Grundfos Magna3 - as I wanted to be able to control and monitor the pump via modbus - have since decided, it is an extravagance I could have avoided. In any case it has the useful feature of being able to estimate the pump flow rate using the pressure sensors and [I assume] other data from the pump … I read this [estimated flow rate] via modbus.

I then decided to follow the path Glyn took, and added a modbus module to the samsung heat pump as well.

** disclaimer ** messing with modbus may be unsafe, proceed at your own risk

Please read pages 17 and 18 in the manual “Modbus Interface Module MIM-B19N/MIM-B19NT”.

The two commands that I used were (please double check the Message Set IDs and their order before you execute these commands)
mbpoll -m rtu -0 -r 6000 -b 9600 -d 8 -t 4:hex /dev/ttyUSB0 0x8238 0x8204
mbpoll -m rtu -0 -r 7000 -b 9600 -d 8 -t 4:hex /dev/ttyUSB0 0x411E 0x42D7 0x42D6 0x4087 0x406C 0x42E9 0x42F1 0x4067

The version of mbpoll I used is is as follows.
mbpoll/jammy,now 1.4.11+dfsg-2 amd64 [installed]
command line utility to communicate with ModBus slave (RTU or TCP)

I am using the “Waveshare Industrial USB to RS485 Converter with original FT232RL”

One final note: I am not sure if this is permanent or needs to be run after each power cycle of the heat pump. Will test this on the weekend.

1 Like

I have a fancy [and expensive] pump - Magna 3, with an ethernet modbus module installed, which estimates flow rate, but it is not as accurate as the Sika. When I setup the system I was not aware I would be able to get the Sika data without some [potentially risky] interventions such as “sharing” the cable out the Sika with the controller. Thanks to Glyns work, I was able to get there reasonably safely and quickly.

Ah thanks for reminding me, I had fixed this issue locally on my system but forgot to update the remote git repository, I’ve now pushed up my changes which do exactly as you describe to set all the registers at the same time. I now get real-time flow rate updates:

The data is coming from the Samsung outdoor unit via modbus which is in turn reading the flow rate from the Sika.

Same here, I’ve also got a heat meter which has a flow sensor. The readings from the Sika via Samsung modbus match the Sontex heat meter readings very closely:

Wow, I didn’t know such a pump existed. That’s very fancy :partying_face:


Once issue with Samsung modbus that i’ve not yet been able to solve is the fact that it cannot report negative temperature readings. When the outdoor temp drops below zero the Samsung outdootT reports a very large number 6552. This sounds like some sort of variable overflow, but I can’t see any issue with the modbus reading code. Anyone got any ideas?

1 Like

Two’s complement?

The minimal modbus documentation does mention two’s complement which aligns with what Brian suggested. But that would not be 6552 - probably a typo on your part.

1 Like

Thanks, yes I think you’re right.

I’ve enabled the two’s complement conversion as per MinimnalModbus docs which is the modbus library emonhub is using: Internal documentation for MinimalModbus — MinimalModbus 2.1.1 documentation

This should now be fixed, but I just need a cold night to test it!

I’m definitely seeing 6551.5 on the Emoncms graph, but there’s a 10x scale factor applied, so the actual figure will be 65515, but possibly something else in Emoncms is limiting the value

1 Like

does the devices Modbus docs say anything about the encoding?

I’ve thought for a while we should have ‘dev’ branches on all the Repos so changes that we are no 100% sure about go into dev for testing, moved to ‘master/main’ once OK and the Stable once part of a release.

Bit more work but stops relatively untested changes being commited directly to a branch, quite a few folk use.

Not really, it just says Celsius value x10 (-41℃ to 100℃).

I added the integer reading section of MinimalModbus emonhub interfacer specifically for this Samsung interfacer, so I don’t think it will be used by many others. The only negative effect I can think of this change will limit the maximum positive integer from 65535 to 32767 which I can’t see being an issue. Thanks for your help.

Modbus details — MinimalModbus 2.0.1 documentation

If 65535 = -1, then 65515 = -20 = -2.0°C

That looks about right.

1 Like

I can confirm the fix had worked, a couple of nights ago the temperature dropped below freezing and emonhub Samsung modbus correctly returned a negative reading :grinning:

Great.

I do think this needs the option for an integer and a signed int as you cannot assume everything will always be within the signed int range.

1 Like

Hi guys, I’ve seen you were able to get realtime flow reports. That’s great actually. I assume that power data are not possible to extract right? So the only way is power meter?

I have two questions though:

  1. With real time flow monitoring it is possible to accurately calculate the COP so I don’t need heat meter? Or let’s say in some +/- 5% difference? Would be good for me.

  2. @glyn.hudson Glyn, how were you able to extract those mod bus data so you know what is what? Is there some guide or I need to read the whole register and guess what is what? I would need to read and write, respectively need to modify weather compensation curve realtime time based on outer temperature. It’s available in some registers ?

Also one more question, in your python code you have this at the beginning ?

instrument.write_registers(7005,[0x42E9, 0x42F1, 0x4067, 0x8204])

What is this doing? It’s writing something into registers? I’d like not to mess with writing command at the beginning :slight_smile:

  1. it is possible to somehow backup registers before I screw up something? Or it is possible to screw up something and make the pump paperweight ?

Thanks!

Hi Michael

This is configuring the modbus adapter with additional commands to query the heatpump. Some have called these “hidden registers” infact they are documented in the manual [that I have] at the end,but just not enabled by default.

In terms of the question as to whether you need a heat meter, that will depend on what accuracy you need. I don’t have one [yet], as soon as budget allows I will install one.

I did not have any issues with configuring my modbus interface. Just be very very careful :slight_smile:

I am also now adjusting the flow temperature and dhw target temp as well as on/off of my Samsung Gen6 via HA. No issue so far and about 14 months in.

William

1 Like

Unlike some heatpumps where the control registers have been hacked/ reverse engineered, this is an official documented modbus protocol by Samsung themselves, therefore it’s designed to be used this way.

Thanks, it’s the document Glyn refers to ? What monitoring solution are you going to install ? I was looking at EmonHP Level 3 but it’s pretty expensive and not sure if it would give me some additional value. Not sure if Samsung inbuild monitoring is very precise, sometime it gives strange numbers and efficiency shows from 3 to 3.5 in 0 - 10C. Seems above 10 COP is displaying pretty same so not sure if it can be trusted.

Thanks, I’ve thought it some manual for airconditioners since there are parameters which makes no sense. For me I guess the only value I need to control is water outlet temperature. Not sure if it is possible to set directly, do you know ? Or Maybe I need to modify heating curve ? What I want to achieve is to set water outlet temperature at specific outside temperature. I need that up to 3C and above the water temperature is constant 45C. And below 3C I need it to follow weather curve. I guess this is possible with modbus and your python script ? Thx.

Yes it is. Here’s an example

Hi Glyn, great thanks. But if you change the flow temperature what about weather compensation curve ? Do I need to disable this or how it works because I guess it would fight each other. Do you know if there are register to write weather curve values ? Maybe I could use this instead of setting flow temp.