Closed mhin76 closed 1 day ago
Sounds like a bug in the code, since also others describe a similar behaviour: https://github.com/mr-manuel/venus-os_dbus-mqtt-pv/issues/32
Currently I'm very busy and have no time to look at it. Will take a few weeks/months.
@mr-manuel I am reengineering and debugging your code. Very nicely written!! And wow, complex requirements. I found out so far that AC out is only for critical loads. maybe with my seput also AC in should only be what goes to battery. I will let you know if I find something. Thanks for the link above!
AC out is only for critical loads
That's true. Maybe this is the problem and the output should always be 0
, but it's only for some cases.
@mr-manuel I got it working, I think. In my set-up the AC In should only reflect the power to and from the BMS. Venus OS is then calculating automatically the power from inverter and energy meter. I also set the BMS value (hardcoded) only to that phase where the BMS is connected to. And I set all AC Out to none.
Strange is that the Inveter shows in VRM as off and does not reflect charging/discharging (remote control shows on) and I have not seen yet the charged Wh amount, discharge however shows up. Code looks fine. however I am running the latest Venus OS Beta. Will install latest official release and further test.
@mr-manuel got it working with official venus OS, it shows charging and discharging on the multiplus icon in VRM. only thing not yet working is the capturing of the battery kWh for charge and discharge. It worked yesterday for 1h. have to find out what I changed on the code. In general: for me it makes sense that only the battery should be considered for AC in (and having AC out 0 as no critical load should be simulated), because MultiPlus whole purpose is to get and provide power out of the battery only. I will keep this thread open, until I have solved all issues and will drop you my changes (well indicating what I changed).
Yes, you are right. The battery should be considered only for AC In.
For the capturing of the kWh of the battery, the battery itself needs to fill the energy forward field.
yes, I found that part of the code.
/Energy/InverterToAcOut
...
/Energy/OutToInverter
and I like your approach of aggregating it and based on my testing should also be just fine. Will debug later :) need to work now.
From my tests I did a while back ago, the MultiPlus emulator was not able to provide the kWh from the battery to the VRM portal. You need the battery device/service to do that. How did you connect the battery?
I found it, I got a division by 0 in line 718. apparently battery was loaded but not correctly and current was 0. Means the code never got to the point of sending the kWh to VRM.
self._dbusservice["/Dc/0/Voltage"] = (
self.batteryValues["/Dc/0/Voltage"]
if self.batteryValues["/Dc/0/Voltage"] is not None
else (
round(
self.batteryValues["/Dc/0/Power"]
/ self.batteryValues["/Dc/0/Current"],
2,
)
if self.batteryValues["/Dc/0/Power"] is not None
and self.batteryValues["/Dc/0/Current"] is not None
else None
)
@mr-manuel works like a charm
somehow in my set-up the battery was connected but did not provide any current, therefore I had that division by 0 and the program never submitted any Wh. Now it works. I changed the following area:
just the charging is not showing up. very strange. I see the charging value building up:
2024-07-04 11:28:59.686483500 INFO:root:--> data_watt_hours(): {"time_creation": 1720092539, "dc": {"charging": 827, "discharging": 0}, "count": 1}
2024-07-04 11:28:59.712955500 INFO:root:--> charge/discharge: {"dc": {"charging": 0.418, "discharging": 1.484}}
and the code submitting it to:
self._dbusservice["/Energy/OutToInverter"] = (
json_data["dc"]["charging"]
if "dc" in json_data and "charging" in json_data["dc"]
else 0
)
but nothing in VRM. Will need to check if that is the correct path.
@mr-manuel I got it working!!!!
finally. don't ask me why, but you have to set the charging amount to the following path:
self._dbusservice["/Energy/AcIn2ToInverter"] = (
json_data["dc"]["charging"]
if "dc" in json_data and "charging" in json_data["dc"]
else 0
)
around line 744 in dbus-multiplus-emulator.py.
I will close this item here.
Can you add your script here as attachment so I can compare it?
dbus-multiplus-emulator20240704.2.txt
yes of course. here we go. but I have not changed it for all phases and on the ACOut I tricked it by asking if "skip" is in the selected phases ;-)
Hi Manuel. I have installed your multiplus emulator. I have latest venus OS installed on my RP3 and an energy meter connected via USB to venus OS directly. Set up as Gridmeter on all 3 phases:![image](https://github.com/mr-manuel/venus-os_dbus-multiplus-emulator/assets/49210075/20b099bf-b85f-4d38-8546-0cd0387b292c)
The grid values show correctly.
However when I select any phase on the emulator config I noticed that the AC loads on the selected phase gets way too high. seems that the grid amount is added on top again. here the setting with just L1:![image](https://github.com/mr-manuel/venus-os_dbus-multiplus-emulator/assets/49210075/dd31f44f-f236-43d7-9681-c8204a90503d)
In the log I see that the energy meter is recognized as well by the emulator:![image](https://github.com/mr-manuel/venus-os_dbus-multiplus-emulator/assets/49210075/4230a671-74a6-48c6-8bba-24bc30a101fa)
and it shows under the emulator the power as AC input but also AC output. But there is no output. and exactly that output is added I guess to the AC loads.![image](https://github.com/mr-manuel/venus-os_dbus-multiplus-emulator/assets/49210075/29359891-fcb6-4d13-bf69-71c1d1476bd3)
I just updated the driver. installed it again. set it to three phases and also marked inverter output in use to show the critical load. here it is visible that the AC output is shown up and that output (which is actually the grid meter) is added to ac loads. hiding again the output in use does not change anything on the ac loads, still adding up the grid meter amount:![image](https://github.com/mr-manuel/venus-os_dbus-multiplus-emulator/assets/49210075/cf1523a6-0b6d-43cb-b23f-ef3ef83d9e63)
what do I miss?