hendrikmuhs / lambda-heatpump-modbus-tcp

Simple script to connect energy meter with a lambda heatpump over modbus tcp
Apache License 2.0
11 stars 1 forks source link

Lambda Modbus Smart Meter required? #2

Closed anbie closed 1 year ago

anbie commented 1 year ago

Hi @hendrikmuhs, thanks for sharing your script. You are covering exactly my future setup. I currently have a SolarEdge SE8K RWS with SolarEdge Electricity Meter installed and I am in the process of ordering a Lambda EU08L. What I'm not clear yet if I need to include the Lambda Smart Meter as well into my configuration. Does the script in your setup require the presence of the Lambda smart meeting? Any insight would be highly welcome.

Thanks!

hendrikmuhs commented 1 year ago

You don't need the lambda smart meter if you already have one as part of your SE setup.

You should be able to check upfront if the script works for you if you comment line 122, 123, 132-137 and start the script with --log debug. Your SE inverter must have modbus TCP enabled. If that's not the case ask SE support to enable it.

When the Lambda heat pump gets installed ask for enabling modbus tcp energy metering. This requires elevated privileges and can therefore only be done by the plumber or lamda support.

anbie commented 1 year ago

Thanks for your quick response. Modbus TCP is enabled in my setup - I was able to do it even without the help from SE support (it seems like securing the privileged access is not their particular strength ;) With your suggested changes, the script runs. I need to spend a little more time crawling through the ton of debug data it spits out (especially after setting the --source-unit to the correct number it does not complain about connection issues anymore). Could you let me know if you are running the script in your setup for an extended time? What's your long-term experience?

hendrikmuhs commented 1 year ago

I run it since I created it (august 2022) on a raspberry pi. I can't remember any issues, neither with the SE inverter[*] nor with the lambda heatpump.

[*] I don't connect directly to the SE inverter, because it doesn't support multiple simultaneous connections. In order to monitor SE and use this script I put a modbus tcp proxy in front of it. That's a know limitation of SE inverters.

especially after setting the --source-unit to the correct number

same here, I don't know why, but I have to use unit 4, although i have only 1 inverter

anbie commented 1 year ago

Awesome.

BTW, found a minor issue in the code: In the Lambda class, the init method, there is a typo in self.transform = self.__postive_transform. It should be self.transform = self.__positive_transform. (line 127)

hendrikmuhs commented 1 year ago

Thanks, will fix it. As you can imagine I use negative surplus. The other one is just for completeness.

(This is a setting in the lambda heatpump which you can set with "expert" level. Enabling modbus tcp requires the "software" level)

anbie commented 1 year ago

For the past week, I have successfully deployed your script as a Systemd service on my Raspberry Pi. Everything is functioning smoothly. Thank you again for sharing.

Based on your longer-term experience, do you have any recommendations for a reasonable reading/writing interval? I'm trying to find a good setting that provides sufficiently current data for the Lambda control algorithm but avoids overwhelming those SolarEdge and Lambda embedded controllers. Currently, I'm running my setup with 30s intervals.

thecem commented 1 year ago

The questions are:

  1. How often the SolarEdge will update the readed registers.
  2. How long take a calculation time in the Lambda.

1.: go down to 1 Sec with the reading in the SolarEdge and searching how often the register will update. 2.: we have to ask Lambda what there calculations loop time is

If there is only one reading/write to the Unit 5 Sec is a save Value.

I will try on mine Lambda 1 Sec, but with a TQS430 Meter which provides under one seconds actual values.

hendrikmuhs commented 1 year ago

I am using 5s which works fine. I also tried it with 1s without problems. I guess writing and reading in the heatpump is decoupled. So it doesn't hurt if you push values with a higher frequency. The lambda software smooths the values and generates a moving average. Practically speaking, I think pushing values on a higher frequency doesn't bring any additional benefit, but only create more load on the devices. I think 5s is decent value.

On the other side there is a update requirement on the lambda side, it expects that new values are pushed at a minimum frequency, otherwise it produces a warning. I haven't tried to find this limit. (With other words: you can't only send values if they change, the heatpump internally resets the received value after some TTL)

thecem commented 1 year ago

I guess the expected time out limit is 5 min for register 00-49 and unlimited for registers above 50 (value will be stored).