Victron mit Modbus TCP auslesen

Begonnen von Michael Schmidt, 31 Januar 2021, 12:14:22

Vorheriges Thema - Nächstes Thema

rasti

Zitat von: Wzut am 17 Dezember 2022, 15:14:39
Drei defines auf die ID100 - den Sinn und Zweck verstehe ich nicht, warum das nicht auf einmal erledigen ?
Ist durch viel Rumprobieren historisch so gewachsen  ;D
Zitat
Deine 30 Sekunden Intervalle sind IMHO OK, aber alle 3 Sekunden ... finde ich etwas heftig
Ist das ein Problem ? Mein FHEM läuft noch auf einem Raspi1 und anscheinend geht es doch ?!?

Zitat
BTW : mach dich mal schlau zum Thema userReadings , deine sind alle ohne Trigger definiert - siehe mein Bsp unter #10

Verstehe ich das richtig, da werden keine Events ausgelöst und
du meinst da gehört noch ein event-on-change-reading .* dazu ?

Wzut

ZitatMein FHEM läuft noch auf einem Raspi1 und anscheinend geht es doch ?
dein FHEM sehe ich auch nicht als Problem sondern die Gegenseite

ZitatVerstehe ich das richtig, da werden keine Events ausgelöst
Nein verstehst du nicht richtig, wenn kein Trigger gesetzt ist wird das userReading jedesmal erzeugt
in meinem Bsp :
attr EM24 userReadings Total_Power:L._Power.* {return (ReadingsNum($name, 'L1_Power', 0) + ReadingsNum($name, 'L2_Power', 0) + ReadingsNum($name, 'L3_Power', 0));;}
wird das Reading Total_Power nur erzeugt wenn es einen Event für L1_Power , L2_Power oder L3_Power gab.

Zitatdu meinst da gehört noch ein event-on-change-reading .* dazu ?
event-on-change-reading .* verwende ich fast immer und bei jedem Device
Maintainer der Module: MAX, MPD, UbiquitiMP, UbiquitiOut, SIP, BEOK, readingsWatcher

rasti

Zitat von: Wzut am 17 Dezember 2022, 15:54:05
dein FHEM sehe ich auch nicht als Problem sondern die Gegenseite
OK ?!?....Wie kann man denn die Grenze der "Abfragefrequenz" abschätzen ?

Zitat
Nein verstehst du nicht richtig, wenn kein Trigger gesetzt ist wird das userReading jedesmal erzeugt
in meinem Bsp :
attr EM24 userReadings Total_Power:L._Power.* {return (ReadingsNum($name, 'L1_Power', 0) + ReadingsNum($name, 'L2_Power', 0) + ReadingsNum($name, 'L3_Power', 0));;}
wird das Reading Total_Power nur erzeugt wenn es einen Event für L1_Power , L2_Power oder L3_Power gab.
event-on-change-reading .* verwende ich fast immer und bei jedem Device

Was mit "userreading wird erzeugt" und "event wird erzeugt" ist  gemeint ist verstehe ich nicht wirklich, dafür fehlen mir wohl wesentliche FHEM Grundlagen.Aber zumindest die übertragenen Leistungswerte ändern sich doch sowieso ständig und sorgen für Events ? Sorry falls ich gerade Mist erzähle  ::)

rasti

#18
etwas verbesserter Code, habe u.a. mit dem event-on.change reading etwas gespielt so dass das log file nicht zugemüllt wird

#######################
# Victron Photovoltaik
#######################

define Victron ModbusAttr 239 30 192.168.178.19:502 TCP
attr Victron userattr dev-h-combine dev-h-defPoll obj-h00031-map obj-h00031-reading obj-h00032-map obj-h00032-reading obj-h00033-map obj-h00033-reading obj-h00033-set stateFormat
attr Victron dev-h-combine 5
attr Victron dev-h-defPoll 1
attr Victron obj-h00031-map 0:Off,1:Low Power,2:Fault,3:Bulk,4:Absorption,5:Float,6:Storage,7:Equalize,8:Passthru,9:Inverting,10:Power assist,11:Power supply,252:Bulk protection
attr Victron obj-h00031-reading Status
attr Victron obj-h00032-map 0:No error,1:VE.Bus Error 1: Device is switched off because one of the other phases in the system has switched off,2:VE.Bus Error 2: New and old types MK2 are mixed in the system,3:VE.Bus Error 3: Not all- or more than- the expected devices were found in the system,4:VE.Bus Error 4: No other device whatsoever detected,5:VE.Bus Error 5: Overvoltage on AC-out,6:VE.Bus Error 6: Error in DDC Program,7:VE.Bus BMS connected- which requires an Assistant- but no assistant found,10:VE.Bus Error 10: System time synchronisation problem occurred,14:VE.Bus Error 14: Device cannot transmit data,16:VE.Bus Error 16: Dongle missing,17:VE.Bus Error 17: One of the devices assumed master status because the original master failed,18:VE.Bus Error 18: AC Overvoltage on the output of a slave has occurred while already switched off,22:VE.Bus Error 22: This device cannot function as slave,24:VE.Bus Error 24: Switch-over system protection initiated,25:VE.Bus Error 25: Firmware incompatibility. The firmware of one of the connected device is not sufficiently up to date to operate in conjunction with this device,26:VE.Bus Error 26: Internal error
attr Victron obj-h00032-reading Error
attr Victron obj-h00033-map 1:Charger Only,2:Inverter Only,3:On,4:Off
attr Victron obj-h00033-reading WR-Mode
attr Victron obj-h00033-set 1
attr Victron room Photovoltaik
attr Victron stateFormat WR-Mode - Error

define Victron_Ess ModbusAttr 100 30 192.168.178.19:502 TCP
attr Victron_Ess userattr dev-h-defPoll event-on-change-reading obj-h00843-reading obj-h00844-map obj-h00844-reading obj-h02900-map obj-h02900-reading stateFormat
attr Victron_Ess dev-h-defPoll 1
attr Victron_Ess event-on-change-reading .*
attr Victron_Ess obj-h00843-reading Battery_State
attr Victron_Ess obj-h00844-map 0:idle,1:charging,2:discharging
attr Victron_Ess obj-h00844-reading Battery_Status
attr Victron_Ess obj-h02900-map 0:Unused (BL disabled), 1:Restarting, 2:Self-consumption, 3:Self-consumption, 4:Self-consumption, 5:Discharge_disabled, 6:Force charge, 7:Sustain, 9:Keep batteries charged, 10:BL Disabled, 11:BL Disabled (Low SoC)
attr Victron_Ess obj-h02900-reading ESS_Battery_State
attr Victron_Ess room Photovoltaik
attr Victron_Ess stateFormat SOC: Battery_State% - ESS-State: ESS_Battery_State

define Victron_AC_Consumption ModbusAttr 100 5 192.168.178.19:502 TCP
attr Victron_AC_Consumption userattr dev-h-defPoll event-on-change-reading obj-h00817-reading obj-h00818-reading obj-h00819-reading stateFormat userReadings
attr Victron_AC_Consumption dev-h-defPoll 1
attr Victron_AC_Consumption event-on-change-reading .*:10
attr Victron_AC_Consumption obj-h00817-reading Consumption_L1
attr Victron_AC_Consumption obj-h00818-reading Consumption_L2
attr Victron_AC_Consumption obj-h00819-reading Consumption_L3
attr Victron_AC_Consumption room Photovoltaik
attr Victron_AC_Consumption stateFormat Total:Consumption_Total W - L1: Consumption_L1 W - L2:Consumption_L2 W - L3:Consumption_L3: W
attr Victron_AC_Consumption userReadings Consumption_Total { ReadingsVal("Victron_AC_Consumption","Consumption_L1",0) + ReadingsVal("Victron_AC_Consumption","Consumption_L2",0) + ReadingsVal("Victron_AC_Consumption","Consumption_L3",0);;}

define Victron_Gridpower ModbusAttr 100 5 192.168.178.19:502 TCP
attr Victron_Gridpower userattr dev-h-defPoll event-on-change-reading obj-h00820-reading obj-h00821-reading obj-h00822-reading stateFormat userReadings
attr Victron_Gridpower dev-h-defPoll 1
attr Victron_Gridpower event-on-change-reading .*:10
attr Victron_Gridpower obj-h00820-reading Gridpower_L1
attr Victron_Gridpower obj-h00821-reading Gridpower_L2
attr Victron_Gridpower obj-h00822-reading Gridpower_L3
attr Victron_Gridpower room Photovoltaik
attr Victron_Gridpower stateFormat Total:Gridpower_Total W - L1: Gridpower_L1 W - L2:Gridpower_L2 W - L3:Gridpower_L3: W
attr Victron_Gridpower userReadings Gridpower_Total { ReadingsVal("Victron_Gridpower","Gridpower_L1",0) + ReadingsVal("Victron_Gridpower","Gridpower_L2",0) + ReadingsVal("Victron_Gridpower","Gridpower_L3",0);;}

define Victron_Battery ModbusAttr 225 5 192.168.178.19:502 TCP
attr Victron_Battery userattr dev-h-defPoll event-on-change-reading obj-h00259-reading obj-h00261-reading obj-h00266-reading stateFormat userReadings
attr Victron_Battery dev-h-defPoll 1
attr Victron_Battery event-on-change-reading .*
attr Victron_Battery obj-h00259-reading Bat_voltage
attr Victron_Battery obj-h00261-reading Bat_current
attr Victron_Battery obj-h00266-reading Bat_SOC
attr Victron_Battery room Photovoltaik
attr Victron_Battery stateFormat Battery_Power W / Battery_voltage V /  Battery_current  A / SOC:Battery_SOC%  / Temp. Battery_temperature °C
attr Victron_Battery userReadings Battery_Power { round((ReadingsVal("Victron_Battery","Battery_current",0)*ReadingsVal("Victron_Battery","Bat_voltage",0) *0.01),0) ;;}, Battery_temperature { round(ReadingsNum("Temperatur_Keller","temperature",-1),1) ;;}, Battery_SOC { ReadingsVal("Victron_Battery","Bat_SOC",0) *0.1 ;;}, Battery_voltage { ReadingsVal("Victron_Battery","Bat_voltage",0) *0.01 ;;}, Battery_current { ReadingsVal("Victron_Battery","Bat_current",0) *0.1 ;;}

define Victron_Solarpower ModbusAttr 100 5 192.168.178.19:502 TCP
attr Victron_Solarpower userattr dev-h-defPoll event-on-change-reading obj-h00811-reading obj-h00812-reading obj-h00813-reading obj-h00850-reading stateFormat userReadings
attr Victron_Solarpower dev-h-defPoll 1
attr Victron_Solarpower event-on-change-reading .*:10
attr Victron_Solarpower obj-h00811-reading Fronius_L1
attr Victron_Solarpower obj-h00812-reading Fronius_L2
attr Victron_Solarpower obj-h00813-reading Fronius_L3
attr Victron_Solarpower obj-h00850-reading DC_PV_Power
attr Victron_Solarpower room Photovoltaik
attr Victron_Solarpower stateFormat Total:  Total_Solar_Power W Fronius: AC_PV_Power W MPPT-DC:  DC_PV_Power W
attr Victron_Solarpower userReadings AC_PV_Power { ReadingsVal("Victron_Solarpower","Fronius_L1",0) + ReadingsVal("Victron_Solarpower","Fronius_L2",0) + ReadingsVal("Victron_Solarpower","Fronius_L3",0);;}, Total_Solar_Power {ReadingsVal("Victron_Solarpower","DC_PV_Power",0) + ReadingsVal("Victron_Solarpower","Fronius_L1",0) + ReadingsVal("Victron_Solarpower","Fronius_L2",0) + ReadingsVal("Victron_Solarpower","Fronius_L3",0);;}

jostmario

Hallo,

mit deinem:
define Victron_Gridpower ModbusAttr 100 5 192.168.178.19:502 TCP
attr Victron_Gridpower userattr dev-h-defPoll event-on-change-reading obj-h00820-reading obj-h00821-reading obj-h00822-reading stateFormat userReadings
attr Victron_Gridpower dev-h-defPoll 1
attr Victron_Gridpower event-on-change-reading .*:10
attr Victron_Gridpower obj-h00820-reading Gridpower_L1
attr Victron_Gridpower obj-h00821-reading Gridpower_L2
attr Victron_Gridpower obj-h00822-reading Gridpower_L3
attr Victron_Gridpower room Photovoltaik
attr Victron_Gridpower stateFormat Total:Gridpower_Total W - L1: Gridpower_L1 W - L2:Gridpower_L2 W - L3:Gridpower_L3: W
attr Victron_Gridpower userReadings Gridpower_Total { ReadingsVal("Victron_Gridpower","Gridpower_L1",0) + ReadingsVal("Victron_Gridpower","Gridpower_L2",0) + ReadingsVal("Victron_Gridpower","Gridpower_L3",0);;}



wenn ich auf L1 einspeise errechnet er die Werte falsch. Jemand eine Idee:





Raspberry Pi  ---  HM-LAN ---  8X HM_HM_CC_RT_DN --- OWL+USB Strommesser    UVR1611

rasti

Zitat von: jostmario am 19 Dezember 2022, 14:36:53
wenn ich auf L1 einspeise errechnet er die Werte falsch. Jemand eine Idee:

Verhalten bei Einspeisung konnte ich leider wg. zu wenig Sonne noch gar nicht testen !

Ich vermute mal ins blaue hinein, dass eine falsch dargestellte 2K Zahl (Zweierkomplementzahl ) ist.
Als Variablentyp steht int16 in der Excelregistertabelle von Victron drin.
16 Bit sind 4 Hex Zahlen
Die Zahl 65320 im Bild  als 16 Bit Zahl hex dargestellt ist FF28
Wenn ich dieselbe Zahl FF28(hex) nicht als Binärzahl sondern als 2K Zahl interpretiere, dann wäre das -216
Kommt 216 Watt Einspeisung hin ?

Rechne mal den großen Wert bei Einspeisung mit Neuer_Wert  = -(65535-Wert+1) um.
Wenn das funktioniert müsstest du das bei allen Readings machen, die grösser als 32767 sind.

jostmario

Hallo,  ja 216W kommen hin.

wie verarbeite ich das in fhem, muss ich da ein neues Userreading anlegen oder kann man das irgendwie direkt in dem Modbusattr attribut berechnen ?

Gruß Josty
Raspberry Pi  ---  HM-LAN ---  8X HM_HM_CC_RT_DN --- OWL+USB Strommesser    UVR1611

rasti

Zitat von: jostmario am 19 Dezember 2022, 16:40:40
Hallo,  ja 216W kommen hin.

wie verarbeite ich das in fhem, muss ich da ein neues Userreading anlegen oder kann man das irgendwie direkt in dem Modbusattr attribut berechnen ?

Gruß Josty

Gute Frage, keine Ahnung. Ich kann zwar in bestehenden Programmen rumpfuschen aber als Programmierer könnte ich nicht leben....da fehlen mir zu viele FHEM und Perl und sonstige Grundlagen.

Kannst ja mal im Anfängerforum fragen wie das geht und wenn du eine Lösung hast hier posten. Ich brauche den FHEM-Code ja auch  :) . Wenn man da Ahnung hat ist das in 10 Minuten erledigt. Ich brauche da wahrscheinlich 1-2 Abende dazu um das hinzukriegen....und gerade genug anderes zu tun.

rasti

Ich hab es hingekriegt...nun werden bei Gridpower und Batterypower auch negative Werte richtig angezeigt

#######################
# Victron Photovoltaik
#######################

define Victron ModbusAttr 239 30 192.168.178.19:502 TCP
attr Victron userattr dev-h-combine dev-h-defPoll obj-h00031-map obj-h00031-reading obj-h00032-map obj-h00032-reading obj-h00033-map obj-h00033-reading obj-h00033-set stateFormat
attr Victron dev-h-combine 5
attr Victron dev-h-defPoll 1
attr Victron obj-h00031-map 0:Off,1:Low Power,2:Fault,3:Bulk,4:Absorption,5:Float,6:Storage,7:Equalize,8:Passthru,9:Inverting,10:Power assist,11:Power supply,252:Bulk protection
attr Victron obj-h00031-reading Status
attr Victron obj-h00032-map 0:No error,1:VE.Bus Error 1: Device is switched off because one of the other phases in the system has switched off,2:VE.Bus Error 2: New and old types MK2 are mixed in the system,3:VE.Bus Error 3: Not all- or more than- the expected devices were found in the system,4:VE.Bus Error 4: No other device whatsoever detected,5:VE.Bus Error 5: Overvoltage on AC-out,6:VE.Bus Error 6: Error in DDC Program,7:VE.Bus BMS connected- which requires an Assistant- but no assistant found,10:VE.Bus Error 10: System time synchronisation problem occurred,14:VE.Bus Error 14: Device cannot transmit data,16:VE.Bus Error 16: Dongle missing,17:VE.Bus Error 17: One of the devices assumed master status because the original master failed,18:VE.Bus Error 18: AC Overvoltage on the output of a slave has occurred while already switched off,22:VE.Bus Error 22: This device cannot function as slave,24:VE.Bus Error 24: Switch-over system protection initiated,25:VE.Bus Error 25: Firmware incompatibility. The firmware of one of the connected device is not sufficiently up to date to operate in conjunction with this device,26:VE.Bus Error 26: Internal error
attr Victron obj-h00032-reading Error
attr Victron obj-h00033-map 1:Charger Only,2:Inverter Only,3:On,4:Off
attr Victron obj-h00033-reading WR-Mode
attr Victron obj-h00033-set 1
attr Victron room Photovoltaik
attr Victron stateFormat WR-Mode - Error

define Victron_Ess ModbusAttr 100 30 192.168.178.19:502 TCP
attr Victron_Ess userattr dev-h-defPoll event-on-change-reading obj-h00843-reading obj-h00844-map obj-h00844-reading obj-h02900-map obj-h02900-reading stateFormat
attr Victron_Ess dev-h-defPoll 1
attr Victron_Ess event-on-change-reading .*
attr Victron_Ess obj-h00843-reading Battery_State
attr Victron_Ess obj-h00844-map 0:idle,1:charging,2:discharging
attr Victron_Ess obj-h00844-reading Battery_Status
attr Victron_Ess obj-h02900-map 0:Unused (BL disabled), 1:Restarting, 2:Self-consumption, 3:Self-consumption, 4:Self-consumption, 5:Discharge_disabled, 6:Force charge, 7:Sustain, 9:Keep batteries charged, 10:BL Disabled, 11:BL Disabled (Low SoC)
attr Victron_Ess obj-h02900-reading ESS_Battery_State
attr Victron_Ess room Photovoltaik
attr Victron_Ess stateFormat SOC: Battery_State% - ESS-State: ESS_Battery_State

define Victron_AC_Consumption ModbusAttr 100 5 192.168.178.19:502 TCP
attr Victron_AC_Consumption userattr dev-h-defPoll event-on-change-reading obj-h00817-reading obj-h00818-reading obj-h00819-reading stateFormat userReadings
attr Victron_AC_Consumption dev-h-defPoll 1
attr Victron_AC_Consumption event-on-change-reading .*:10
attr Victron_AC_Consumption obj-h00817-reading Consumption_L1
attr Victron_AC_Consumption obj-h00818-reading Consumption_L2
attr Victron_AC_Consumption obj-h00819-reading Consumption_L3
attr Victron_AC_Consumption room Photovoltaik
attr Victron_AC_Consumption stateFormat Total:Consumption_Total W - L1: Consumption_L1 W - L2:Consumption_L2 W - L3:Consumption_L3: W
attr Victron_AC_Consumption userReadings Consumption_Total { ReadingsVal("Victron_AC_Consumption","Consumption_L1",0) + ReadingsVal("Victron_AC_Consumption","Consumption_L2",0) + ReadingsVal("Victron_AC_Consumption","Consumption_L3",0);;}

define Victron_Gridpower ModbusAttr 100 5 192.168.178.19:502 TCP
attr Victron_Gridpower userattr dev-h-defPoll event-on-change-reading obj-h00820-expr obj-h00820-reading obj-h00821-expr obj-h00821-reading obj-h00822-expr obj-h00822-reading stateFormat userReadings
attr Victron_Gridpower dev-h-defPoll 1
attr Victron_Gridpower event-on-change-reading .*:10
attr Victron_Gridpower obj-h00820-expr $val =  unsigned16_signed16($val)
attr Victron_Gridpower obj-h00820-reading Gridpower_L1
attr Victron_Gridpower obj-h00821-expr $val = unsigned16_signed16($val)
attr Victron_Gridpower obj-h00821-reading Gridpower_L2
attr Victron_Gridpower obj-h00822-expr $val = unsigned16_signed16($val)
attr Victron_Gridpower obj-h00822-reading Gridpower_L3
attr Victron_Gridpower room Photovoltaik
attr Victron_Gridpower stateFormat Total: Gridpower_Total W / L1: Gridpower_L1 W / L2: Gridpower_L2 W / L3: Gridpower_L3 W
attr Victron_Gridpower userReadings Gridpower_Total { ReadingsVal("Victron_Gridpower","Gridpower_L1",0) + ReadingsVal("Victron_Gridpower","Gridpower_L2",0) + ReadingsVal("Victron_Gridpower","Gridpower_L3",0);;}



define Victron_Battery ModbusAttr 225 5 192.168.178.19:502 TCP
attr Victron_Battery userattr dev-h-defPoll event-on-change-reading obj-h00259-reading obj-h00261-reading obj-h00266-reading stateFormat userReadings
attr Victron_Battery dev-h-defPoll 1
attr Victron_Battery event-on-change-reading .*
attr Victron_Battery obj-h00259-reading Bat_voltage
attr Victron_Battery obj-h00261-reading Bat_current
attr Victron_Battery obj-h00266-reading Bat_SOC
attr Victron_Battery room Photovoltaik
attr Victron_Battery stateFormat Battery_Power W / Battery_voltage V /  Battery_current  A / SOC:Battery_SOC%  / Temp. Battery_temperature °C
attr Victron_Battery userReadings Battery_Power { round((ReadingsVal("Victron_Battery","Battery_current",0)*ReadingsVal("Victron_Battery","Bat_voltage",0) *0.01),0) ;;}, Battery_temperature { round(ReadingsNum("Temperatur_Keller","temperature",-1),1) ;;}, Battery_SOC { ReadingsVal("Victron_Battery","Bat_SOC",0) *0.1 ;;}, Battery_voltage { ReadingsVal("Victron_Battery","Bat_voltage",0) *0.01 ;;}, Battery_current { unsigned16_signed16(ReadingsVal("Victron_Battery","Bat_current",0)) *0.1;;}

define Victron_Solarpower ModbusAttr 100 5 192.168.178.19:502 TCP
attr Victron_Solarpower userattr dev-h-defPoll event-on-change-reading obj-h00811-reading obj-h00812-reading obj-h00813-reading obj-h00850-reading stateFormat userReadings
attr Victron_Solarpower dev-h-defPoll 1
attr Victron_Solarpower event-on-change-reading .*:10
attr Victron_Solarpower obj-h00811-reading Fronius_L1
attr Victron_Solarpower obj-h00812-reading Fronius_L2
attr Victron_Solarpower obj-h00813-reading Fronius_L3
attr Victron_Solarpower obj-h00850-reading DC_PV_Power
attr Victron_Solarpower room Photovoltaik
attr Victron_Solarpower stateFormat Total:  Total_Solar_Power W / Fronius: AC_PV_Power W / MPPT-DC:  DC_PV_Power W
attr Victron_Solarpower userReadings AC_PV_Power { ReadingsVal("Victron_Solarpower","Fronius_L1",0) + ReadingsVal("Victron_Solarpower","Fronius_L2",0) + ReadingsVal("Victron_Solarpower","Fronius_L3",0);;}, Total_Solar_Power {ReadingsVal("Victron_Solarpower","DC_PV_Power",0) + ReadingsVal("Victron_Solarpower","Fronius_L1",0) + ReadingsVal("Victron_Solarpower","Fronius_L2",0) + ReadingsVal("Victron_Solarpower","Fronius_L3",0);;}




Die Funktion unsigned16_signed16 also das hier

sub unsigned16_signed16 {
  my $v = shift;
  return ($v & 0x8000) ? -((~$v & 0xffff) + 1) : $v;
}


muss in die 99_myUtils.pm reinkopiert werden.



Wzut

Zitat von: rasti am 20 Dezember 2022, 10:35:05
muss in die 99_myUtils.pm reinkopiert werden.
ne,ne,ne ob ein Register ein int, uint , flow oder sonst etwas Wert enthält wird im Modul mit dem unpack Attribut abgehandelt.
Die command.ref zum Modul enthält sogar die Lösung für int16 :
Zitatobj-[cdih][1-9][0-9]*-unpack
defines the pack / unpack code to convert data types.
-- snipp ---
For an unsigned integer in big endian format this would be "n",
for a signed 16 bit integer in big endian format this would be "s>", in little endian format it would be "s<"
-- snipp ---
d.h. attr Victron_Gridpower obj-h820-unpack s> usw. wäre hier dein Freund
Maintainer der Module: MAX, MPD, UbiquitiMP, UbiquitiOut, SIP, BEOK, readingsWatcher

jostmario

Hallo,

ja dakne das unpack funktioniert.

Gruß Josty
Raspberry Pi  ---  HM-LAN ---  8X HM_HM_CC_RT_DN --- OWL+USB Strommesser    UVR1611

rasti

Zitat von: jostmario am 22 Dezember 2022, 16:52:14
Hallo,

ja dakne das unpack funktioniert.

Gruß Josty
Mein gepfuschter Code funktioniert auch  ;D

jostmario

Raspberry Pi  ---  HM-LAN ---  8X HM_HM_CC_RT_DN --- OWL+USB Strommesser    UVR1611

lynckmeister

Servus zusammen, also ich habe mich an diesem Thread entlanggehangelt und kann nun ohne Probleme alle Register lesen und wohl auch schreiben.
Ich habe einen MP2 den ich mit dem VenusOSRasp über Modbus anspreche. Da ich kein Smartmeter extra einbauen will, steurere ich den Mp2 über die in FHEM bereits ausgelesenen Smartmeter Werte:
Wenn ich also die Batterie laden will muss ich Register 37 mit dem Wert (Watt) den ich Laden will schreiben. Anschliessend muss ich noch Register 38 auf Enabled setzen, damit das ganze losgeht. Der MP2 lädt dann für ca 60 Sekunden. Dann braucht er wohl ein Update. Setze ich das (Reg 37) dann sprint 38 wieder auf disbaled um und ich muss auch 38 erneut auf enabled setzen. Ist das normal?!
Bei Feed in ist es nicht so , 39 bleibt immer auf enables. Ich muss also nur 37 negatv setzen und schon entlädt der MP2 für ca. 60 Sekunden die Batterie . Damit kann ich umgehen.

Es gibt aber noch beim Victron Hub ( Id100) den Register 2700 , der genau das gleiche laut Beschreibung macht Setpoint in Watt für laden und entladen sezten. Wofür ist dann aber der, wenn ich doch 37 schon habe?!

Ich mache mir auch Sorgen , ob die Grundeinstellungen meines MP2 noch greifen, wenn ich ihm explizit alle 60 Sekunden sage, was er zu tun hat. Hält er sich dann trotzdem an die Grenzen meiner LifePo4 Batterie für Über und Unterladung ?

Hier die List meiner Attribute:


Attributes:
   dev-h-defPoll 1
   obj-h00031-map 0:Off,1:Low Power,2:Fault,3:Bulk,4:Absorption,5:Float,6:Storage,7:Equalize,8:Passthru,9:Inverting,10:Power assist,11:Power supply,252:Bulk protection
   obj-h00031-reading Status
   obj-h00031-showGet 1
   obj-h00032-map 0:No error,1:VE.Bus Error 1: Device is switched off because one of the other phases in the system has switched off,2:VE.Bus Error 2: New and old types MK2 are mixed in the system,3:VE.Bus Error 3: Not all- or more than- the expected devices were found in the system,4:VE.Bus Error 4: No other device whatsoever detected,5:VE.Bus Error 5: Overvoltage on AC-out,6:VE.Bus Error 6: Error in DDC Program,7:VE.Bus BMS connected- which requires an Assistant- but no assistant found,10:VE.Bus Error 10: System time synchronisation problem occurred,14:VE.Bus Error 14: Device cannot transmit data,16:VE.Bus Error 16: Dongle missing,17:VE.Bus Error 17: One of the devices assumed master status because the original master failed,18:VE.Bus Error 18: AC Overvoltage on the output of a slave has occurred while already switched off,22:VE.Bus Error 22: This device cannot function as slave,24:VE.Bus Error 24: Switch-over system protection initiated,25:VE.Bus Error 25: Firmware incompatibility. The firmware of one of the connected device is not sufficiently up to date to operate in conjunction with this device,26:VE.Bus Error 26: Internal error
   obj-h00032-reading Error
   obj-h00032-showGet 1
   obj-h00033-map 1:Charger Only,2:Inverter Only,3:On,4:Off
   obj-h00033-reading WR-Mode
   obj-h00033-set 1
   obj-h00037-expr $val / 1
   obj-h00037-len 2
   obj-h00037-reading BatteryLoad
   obj-h00037-set 1
   obj-h00037-showGet 1
   obj-h00038-map 0:Allowed,1:Disabled
   obj-h00038-reading BatteryCharge
   obj-h00038-set 1
   obj-h00038-showGet 1
   obj-h00039-map 0:Allowed,1:Disabled
   obj-h00039-reading BatteryFeedIn
   obj-h00039-set 1
   obj-h00039-showGet 1
   room       aussen,power




rasti

Zitat von: lynckmeister am 31 Dezember 2022, 00:05:52
Servus zusammen, also ich habe mich an diesem Thread entlanggehangelt und kann nun ohne Probleme alle Register lesen und wohl auch schreiben.
Ich habe einen MP2 den ich mit dem VenusOSRasp über Modbus anspreche. Da ich kein Smartmeter extra einbauen will, steurere ich den Mp2 über die in FHEM bereits ausgelesenen Smartmeter Werte:

Das ist mutig. Aber irgend ein Smartmeter (also sowas wie der Victron EM24) braucht es schon. Hast du anscheinend ja auch nur ein anderes, nehme ich an. Dann solltest du besser dessen Werte an die Victron Steuerung übermitteln anstatt eine völlig neue eigene Steuerung mit FHEM zu basteln. Hab ich auch irgendwo schon gesehen, wo man z.B. ein SDM 630 anstatt des Victron EM24 nimmt...

Zitat
Ich mache mir auch Sorgen , ob die Grundeinstellungen meines MP2 noch greifen, wenn ich ihm explizit alle 60 Sekunden sage, was er zu tun hat. Hält er sich dann trotzdem an die Grenzen meiner LifePo4 Batterie für Über und Unterladung ?

Ob er das tut weiss ich nicht aber im Notfall sollte ein funktionierendes BMS bei drohender Unter- oder Überladung einfach trennen. Das ist jetzt zwar keine Lösung, aber ich würde mir bei einem funktionierenden BMS keine Gedanken um die Zerstörung der Batterie machen.