lambda-heatpump-modbus-tcp-HA icon indicating copy to clipboard operation
lambda-heatpump-modbus-tcp-HA copied to clipboard

Send PV surplus

Open RalphDiesinger opened this issue 1 year ago • 28 comments

Hello I became aware of the project here through a note in the HomeAssistant community. My Lambda is still coming, but I'm already interested in the possibilities and have the following question. Is it also possible to send the PV surplus to the heat pump with this project? There is something about this in the OpenWB forum. https://www.openwb.de/forum/viewtopic.php?t=5380

RalphDiesinger avatar May 16 '23 12:05 RalphDiesinger

You could do this without integration:

In configuration.yaml add a modbus hub:

modbus:
  - name: EU08L
    type: tcp
    host: 192.168.1.198 ## EU08L.fritz.box
    port: 502

Add a automation:

alias: Kostal -> EU08L
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.ksem_ac_meter_watts
  - platform: time_pattern
    seconds: /5
condition: []
action:
  - service: modbus.write_register
    data:
      address: 102
      hub: EU08L
      value:
        - "{{states('sensor.ksem_ac_meter_watts') | int | bitwise_and(65535)}}"
mode: single

Replace "ksem_ac_meter_watts" with your grid connection meter (value: negativ for export, positiv for import). "hub:" is case sensitiv

  • I Changed the configuraion to a working one ;-)

thecem avatar May 16 '23 15:05 thecem

Thank you for your quick support. What does mean (value: negativ for export, positiv for import) ? I would like to send this to the heat pump in case of PV surplus. Is it possible to set other settings via Modbus? I would also like to link the launch of the Legio program to the weather. In other words, if, for example, 10 a.m. is set and, according to PV forcast, the sun does not come until 2 p.m., the start should be postponed to 2 p.m. Is that possible?

RalphDiesinger avatar May 16 '23 19:05 RalphDiesinger

It would be possible via ha, but there is no value in the Lambda Modbus registers to set the legio program only RO.

thecem avatar May 17 '23 10:05 thecem

I would also like to link the launch of the Legio program to the weather. In other words, if, for example, 10 a.m. is set and, according to PV forcast, the sun does not come until 2 p.m., the start should be postponed to 2 p.m. Is that possible?

If you build a new WP heating, think about a "fresh water module" which is a heat exchanger which heats up your domestic hot water right at the time when you need it. No legio issues. I have it on my Lambda and I am happy with it.

Another comment re. PV surplus: the Lambda system has an so called "E-Manager" which manages the PV-usage. In my Lambda it seems the E-Manager is not active, I can't change any value so I think you need to talk to Lambda support to get it activated. grafik

Cheers....Ralf

RalfWinter avatar Oct 25 '23 12:10 RalfWinter

Hello, since this week I have a Lambda EU13L Heatpump. And I am trying to send my PV Grid out to the lambda. When generating the automation with the automation tool I get an error 500. I changed the sensor name for my measured Grid input by my sonnenbattery. And the values look valid in HA. But can't get rid of this error. To test i have set the E-Manager to auto. I can't change the communication mode. It is fixed Modbus client. Perhaps this might be the problem. I would very much appreciate your help!

doncuco avatar Nov 09 '23 23:11 doncuco

@doncuco Try the changed config above, this should work. If not pls post your config in configuration.yaml and the automation as yaml.

thecem avatar Nov 10 '23 06:11 thecem

Hello, this seems to work right now. Have to verify, once I have a PV output. Thanks a lot! Right now I am sending the measured Grid Output to the HP, because I have a battery as well. But I am not sure if that is working correct. Because at the point where the HP starts using the energy the output value will drop to 0. And then it would stop working. Or am I understanding this wrong? Wouldnt it be better to send a grid inout value, where negative is for example the input and positive is the output. When the value then stays 0. everything is fine and the heat pump uses the maximum available power. But once the value gets negative it should stop.

doncuco avatar Nov 10 '23 08:11 doncuco

To configure it in the right way:

Your grid metering point should present in & out, where negativ value is producing energy (excess power, sending to grid, E-Überschuss) and positiv value is consuming energy (input power, consuming from grid, E-Verbrauch).

actual excess power [INT16 (min = -32768W; max = 32767W)] (depends on settings in Module)

And you have to set in the heat pump following:

grafik

Other configuration should work, but I haven´t tested a other config.

thecem avatar Nov 10 '23 09:11 thecem

Ok. That worked. But for me positive is sending to grid. So works fine. I can't change the Value for "E-Meter Messpunkt". Do you have higher permissions? And do you know what the "Batteriespeicher vorhanden" setting changes? Couldnt find anything in the Documentation about it.

doncuco avatar Nov 10 '23 10:11 doncuco

You have to write an E-Mail to Lambda, they will change it.

If you have positive values for sending to grid:

value:
        - "{{(states('sensor.ksem_ac_meter_watts') * -1) | int | bitwise_and(65535)}}"

May you could even ask for an explanantion for "Batteriespeicher vorhanden". I don´t now, but assume there will be no activation of E-Manger when both excess power and night is true. To prevent a discharging where is no PV production. Or there will be no activation of the E-Heater until there is only power consume from grid.

thecem avatar Nov 10 '23 11:11 thecem

Hi, thank you very much! This helped all. On the weekend I installed a TASMOTA reader for my energy meter and now I am sending the PV surplus to my Lambda. Great! Next Task is to Load my Battery based on dynamic market prices.

doncuco avatar Nov 13 '23 14:11 doncuco

Hi, thank you very much! This helped all. On the weekend I installed a TASMOTA reader for my energy meter and now I am sending the PV surplus to my Lambda. Great! Next Task is to Load my Battery based on dynamic market prices.

Hi @doncuco: I also have an Lambda and PV and want to use PV surplus with Home Assistant (I'm a Newbie). Could you please describe, what to do to use this? (in English or German)

Eisbaer2 avatar Jan 03 '24 06:01 Eisbaer2

@Eisbaer2 what do you have in place? Grid meter? Home Assistant? @doncuco do you writing the values directly out of tasmota to the heatpump?

thecem avatar Jan 03 '24 07:01 thecem

@Eisbaer2 what do you have in place? Grid meter? Home Assistant?

I have a PowerOpti which shows the current power value (positive or negative). I see this value in my Home Assistant energy dash board. I use Home Assistent 11.2 installed on a Raspi 4.

Eisbaer2 avatar Jan 03 '24 07:01 Eisbaer2

Did you try my description? Should also work for you.

thecem avatar Jan 03 '24 08:01 thecem

Hi, Yes of course. I have documented everything. I can post it here as soon as I am home again.

Am 03.01.2024 um 09:26 schrieb thecem @.***>:



Did you try my description? Should also work for you.

— Reply to this email directly, view it on GitHubhttps://github.com/RalfWinter/lambda-heatpump-modbus-tcp-HA/issues/1#issuecomment-1874999314, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A5F3PZ63EOH63PAS7JL2GMLYMUI4JAVCNFSM6AAAAAAYDSIJYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZUHE4TSMZRGQ. You are receiving this because you were mentioned.Message ID: @.***>

doncuco avatar Jan 03 '24 09:01 doncuco

@Eisbaer2 what do you have in place? Grid meter? Home Assistant? @doncuco do you writing the values directly out of tasmota to the heatpump?

Hi, no I was reading the values with tasmota and send them to the lambda heat pump via modbus. But since this year I am using tibber and the pulse. As the timber integration is not showing one value for Grid In/Out it has separate values for consumption and production. So right now I am using Grid In/out from my sonnenbattery to send it to my heat pump. Perhaps power value of tibber might show both. But as it is winter I can not confirm that. I am using a helper to make it easier for me to change the entity that provides the value. more about that in my next post.

doncuco avatar Jan 03 '24 22:01 doncuco

@Eisbaer2 what do you have in place? Grid meter? Home Assistant?

I have a PowerOpti which shows the current power value (positive or negative). I see this value in my Home Assistant energy dash board. I use Home Assistent 11.2 installed on a Raspi 4.

I had a poweropti as well. But it did not provide reliable values so I switched to the tasiota solution. so here is my documentation. I post it in German. Sorry about that but if anyone wants to have it in English please use chatgpt or so.

  1. step is to add the tasmota Reader: Zum Einbinden des Lesekopfes:

    • Als Stand Alone Lesekopf mit Tasmota einrichten: https://www.simon42.com/home-assistant-sml-stromzaehler-lokal/
    • HA AddOn Mosquito Installation und einrichten
    • HA AddOn Tasmota installieren Video bis hier: SML Stromzähler lokal mit Home Assistant auslesen - PowerFox Alternative https://www.youtube.com/watch?v=nXBaemeKxZg
  2. Step add template entries:

  • Templates anlegen um die Zähler im Energiedashboard und in der Automation zu verwenden: ○ Helfer hinzufügen: Einstellungen => Geräte = > Helfer § Template => einen Senser § Stromerzeugung: □ Maßeinheit kWh □ Zustandvorlage: {{ float(states('sensor.bitshake_smartmeterreader_power_total_out')) | round(3) }} □ Geräteklasse Energie □ Zustandsklasse Insgesamt steigend § Stromverbrauch □ Maßeinheit kWh □ Zustandvorlage: {{ float(states('sensor.bitshake_smartmeterreader_power_total_in')) | round(3) }} □ Geräteklasse Energie □ Zustandsklasse Insgesamt steigend § Momentanverbrauch □ Maßeinheit W □ Anzeeigegenauigkeit => ohne Nachkommastelle => Wichtig für Wärmepumpe zum Daten senden □ Zustandvorlage: {{ float(states('sensor.bitshake_smartmeterreader_power_power_curr'))*(-1) }} ® Wichtig: Wir drehen den Stromfluss um damit die Wärmepumpe den richtigen Wert bekommt ◊ Positiv ist daher Erzeugung ◊ Negativ ist Bezug □ Geräteklasse Leistung □ Zustandsklasse Messung

Home Assistant Template Sensoren von Grund auf erstellen

  1. Step: creating the Lambda integration in home assistant

Wir senden Per Modbus TCP den PV Überschuss an die Wärmepumpe. Gemessen am Stromzähler. Das macht eine Automation:

- Einbindung Lambda Wärmepumpe: https://github.com/RalfWinter/lambda-heatpump-modbus-tcp-HA/tree/main
	○ Configuration.yaml:
		hier die Pumpe anlegen
	○ Sensor.yaml:
		die sensoren einbinden
- Automation.yaml anlegen und in Configuration.yaml einbinden: https://github.com/RalfWinter/lambda-heatpump-modbus-tcp-HA/issues/1
	Code einbinden. alternativ kann man auch die Sonnenbatterie einträge verwenden. Statt des sensor.strommomentanverbrauch  helpers. Ich würde aber eher den Code im Helper anpassen. Das ist der eigentliche Ort um den Wert festzulegen. Hier der Code für die Automation:

alias: SonnenBatterie -> EU13L description: "" trigger:

  • platform: state entity_id: #- sensor.sonnenbatterie_195414_state_grid_inout
    • sensor.strommomentanverbrauch
  • platform: time_pattern seconds: /5 condition: [] action:
  • service: modbus.write_register data: address: 102 hub: EU13L value: #- "{{states('sensor.sonnenbatterie_195414_state_grid_inout') | int | bitwise_and(65535)}}" - "{{(states('sensor.strommomentanverbrauch')) | int | bitwise_and(65535)}}" mode: single

Ich hoffe das hilft dir.

doncuco avatar Jan 03 '24 22:01 doncuco

@RalfWinter: Hallo Ralf, habe in deiner Readme-Grafik gesehen (danke für deine Modbus-Daten), dass du dir bei der Lambda auch die Soll-Daten des HK anzeigen lässt. Ich habe schon alles ausprobiert, aber ich den Soll-Wert finde ich bei den Modbus-Daten einfach nicht. Zur Sicherheit: Mit Soll meine ich den Wert links oben: image

Kriegst du den tatsächlich über Modbus? Wenn ja, welcher Wert ist denn das?

@doncuco : vielen Danke! Gibt es eine Möglichkeit, dich per E-Mail o.Ä. zu erreichen? Bei Github scheint es keine Möglichkeit der direkten 1:1-Kommunikation zu geben.

Eisbaer2 avatar Jan 04 '24 17:01 Eisbaer2

Welche SW hast Du? V0.0.4 da wurde das rausgenommen Ralf hat die Alte SW die Daten liefert.

thecem avatar Jan 04 '24 17:01 thecem

Das der Soll und der PV Überschuss Status nicht ausgelesen werden kann ist echt ärgerlich! So kann man einer Nachfolgeregelung die Werte zur Stuereung nicht übergeben.

thecem avatar Jan 04 '24 17:01 thecem

Laut der Anzeige habe ich 0.0.1: image

Oder wo sehe ich die richtige Version?

Eisbaer2 avatar Jan 04 '24 17:01 Eisbaer2

Genau, die habe ich auch. 0.0.4 ist die SW unter I in dem WP Modul und dann auf den Chip rechts unten. (ARC)

Diese Version gibt die Werte nicht raus, du kannst zwar die Werte beschreiben und dann lesen aber eben nicht was im Display steht lesen. Ich habe dazu drei Anfragen laufen, macht aber Nix wenn du dich auch noch mal bei denen meldest.

thecem avatar Jan 04 '24 17:01 thecem

Habe die 0.0.4-3K Werde auch noch anfragen.

Eisbaer2 avatar Jan 04 '24 17:01 Eisbaer2

Sorry, war ein paar Tage Offline. Inzwischen hat man mir auch die V0.0.1 gepushed, jetzt sehe ich die Sollwerte leider auch nicht mehr. Ein Ticket habe ich geöffnet, allerdings antwortet Lambda aktuell mit 2 Monaten Verzögerung.

RalfWinter avatar Jan 04 '24 18:01 RalfWinter

@RalfWinter: Hallo Ralf, habe in deiner Readme-Grafik gesehen (danke für deine Modbus-Daten), dass du dir bei der Lambda auch die Soll-Daten des HK anzeigen lässt. Ich habe schon alles ausprobiert, aber ich den Soll-Wert finde ich bei den Modbus-Daten einfach nicht. Zur Sicherheit: Mit Soll meine ich den Wert links oben: image

Kriegst du den tatsächlich über Modbus? Wenn ja, welcher Wert ist denn das?

@doncuco : vielen Danke! Gibt es eine Möglichkeit, dich per E-Mail o.Ä. zu erreichen? Bei Github scheint es keine Möglichkeit der direkten 1:1-Kommunikation zu geben.

ja unter klenk85 beim großen G

doncuco avatar Jan 04 '24 19:01 doncuco

Hallo@Tecem:

Am am 10. November 2023 haben Sie geschrieben, dass man [INT16 (min = -32768 W; max = 32767 W)] einfügen muss, um positive und negative Werte zu übertragen. Wo genau muss man das einfügen ?

DanielNiedermayer avatar Feb 16 '24 20:02 DanielNiedermayer

Das bezieht sich auf den Wert der übergeben wird, Datentyp INT16 (Signed int 16Bit) kann Hexadezimal Werte von dezimal -32768 bis 32767 übergeben. Der INT16 Hexwert wird auf register 102 der Lambda geschrieben. Zur Umrechnung des Dezimalwert in der Automatisation aus Home Assistant: - "{{states('sensor._sensor_mit_dem_hausverbrauchs_und_übershusswert') | int | bitwise_and(65535)}}"

thecem avatar Feb 17 '24 06:02 thecem