Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device inverter instead of pvinverter possible? #42

Closed
TheGrumpyBadger opened this issue Mar 5, 2023 · 73 comments · Fixed by #62 or #77
Closed

Device inverter instead of pvinverter possible? #42

TheGrumpyBadger opened this issue Mar 5, 2023 · 73 comments · Fixed by #62 or #77
Labels
enhancement New feature or request

Comments

@TheGrumpyBadger
Copy link

My HM-350 is connected to a LFP battery, which is charged by a Victron MPPT.
Is it possible to show the HM-350 as an inverter, as it is using DC power instead of PV ?

@henne49
Copy link
Owner

henne49 commented Mar 6, 2023

as long as you have a DTU like ahoy or opendtu, that we can read data from, it can be displayed in venus OS

@ude6
Copy link

ude6 commented Mar 9, 2023

Hi,
I agree. I am currently using your code to display the inverter (connected to the battery) as
a PV-Inverter. It runs very well. BUT it assumes the energy comes from PV where in reality it comes from the battery.

So when the inverter runs I see for example:

Battery (via dbus-serialbattery) -600w
PV-Inverter ( via your dbus-opendtu) +600w
DC-Power (calculated by victron) +600w

The problem is that the cerbo is not netting the DC-Power (which is the input to the inverter)
with the PV-Inverter.

So the question is: Can the Opendtu (or Ahoy) be used as an inverter that is powered by DC load?
image

Thanks

Andreas

@henne49
Copy link
Owner

henne49 commented Mar 9, 2023

We create a PV inverter in DBUS https://github.com/victronenergy/venus/wiki/dbus#pv-inverters

I guess you would need another service to make that correct

@ude6
Copy link

ude6 commented Mar 9, 2023

Yes, I would assume that something like this would be through the com.victronenergy.vebus.
It would need to look like a Multiplus to the Cerbo (I guess)....

Maybe also com.victronenergy.multi would work..

@henne49
Copy link
Owner

henne49 commented Mar 9, 2023

I planned something for shelly #32, but it was not working. This requires some rework, give it a try and you can submit a PR to include into the code. But wait until we Merged #43

@ude6
Copy link

ude6 commented Mar 9, 2023

Sounds great!

@ude6
Copy link

ude6 commented Mar 9, 2023

This looks close: https://github.com/Telekatz/venus.dbus-hoymiles

@henne49
Copy link
Owner

henne49 commented Mar 10, 2023

we did a merge, your link is a different use case. Maybe that project is a better bit for your use case

@ude6
Copy link

ude6 commented Mar 10, 2023

I will try to ask the autor there for a possible update to disble the steering of the HM input.

@Head
Copy link

Head commented Mar 14, 2023

Was just reading the code and then found this issue.
This project simulates the opendtu as a pvinverter: https://github.com/victronenergy/venus/wiki/dbus#pv-inverters
We would need an inverter: https://github.com/victronenergy/venus/wiki/dbus#inverter

It shouldn't be that hard to take this code and change com.victronenergy.pvinverter to com.victronenergy.inverter and also change the paths in the update funtion https://github.com/henne49/dbus-opendtu/blob/main/dbus-opendtu.py#L423 to match the ones required by the inverter interface. But maybe that should ne another project/fork of this one... Or maybe a config flag?

@henne49
Copy link
Owner

henne49 commented Mar 15, 2023

I think it needs to be a config flag, which allows for different mode. If you are interested, please create a fork and test, we can help with the code and Pull Request. We would include this into code for sure, just have no time yet to do it myself.

@henne49 henne49 added the enhancement New feature or request label Mar 15, 2023
@dsteinkopf
Copy link
Collaborator

Maybe, the change #53 (based on feature request #52) will also help in this case. I will be able to configure servicename com.victronenergy.inverter.

@dsteinkopf
Copy link
Collaborator

dsteinkopf commented Mar 25, 2023

Closing this because of #53. Please reopen or create a new issue if necessary.

@henne49
Copy link
Owner

henne49 commented Mar 26, 2023

Reopening, as we need to also implement it for ahoy and opendtu and not just template

@henne49 henne49 reopened this Mar 26, 2023
@henne49
Copy link
Owner

henne49 commented Mar 28, 2023

Hi,

I have added the customization of servicename for dtu now as well.
grafik

As I do not have any of these devices, what would you want to see and how to display?
https://github.com/victronenergy/venus/wiki/dbus#dcsystem

#62

@henne49 henne49 linked a pull request Mar 28, 2023 that will close this issue
@TheGrumpyBadger
Copy link
Author

TheGrumpyBadger commented Mar 28, 2023

### Only needed for OpenDTU and ahoy
# AcPosition 0=AC input 1; 1=AC output; 2=AC output 2
# 1st inverter
[INVERTER0]
Phase=L1
DeviceInstance=34
AcPosition=0
Servicename=com.victronenergy.inverter

# 2nd inverter
[INVERTER1]
Phase=L1
DeviceInstance=35
AcPosition=0
Servicename=com.victronenergy.pvinverter

Inverter0 shows at not connected, Interverter1 works fine.

Screenshot 2023-03-28 181654

@TheGrumpyBadger
Copy link
Author

I think for inverter there are other variables:
https://github.com/victronenergy/venus/wiki/dbus#inverter

Screenshot 2023-03-28 182636

@henne49
Copy link
Owner

henne49 commented Mar 29, 2023

correct, but I would need to know, which one to present to dbus.

@henne49 henne49 reopened this Mar 29, 2023
@TheGrumpyBadger
Copy link
Author

TheGrumpyBadger commented Apr 2, 2023

I think we will need:

/Dc/0/Voltage <- Battery voltage
/Ac/Out/L1/V <- AC Output voltage
/Ac/Out/L1/I <- AC Output current
/Ac/Out/L1/P <- Not used on vedirect inverters
/State <- 0=Off; 1=Low Power; 2=Fault; 9=Inverting

with Servicename=com.victronenergy.inverter

@Tom051276
Copy link

Tom051276 commented Apr 27, 2023

Dear all, was this feature request from @TheGrumpyBadger already built in ? I tried to use the Servicename=com.victronenergy.inverter for Inverter0, but without luck. Seems it is not yet implemented...

@dsteinkopf
Copy link
Collaborator

Yes, setting the servicename was implemented in #53. But it seems there are devices (servicenames) where it is not sufficient to only set the servicename and some more attributes need to be set. This is why THIS ticket ist still open.

@0x7878
Copy link
Collaborator

0x7878 commented Apr 27, 2023

Hey @Tom051276 would you mind to post the debug log?

Logging=DEBUG

Right now it looks correct for me.

if dtuvariant != constants.DTUVARIANT_TEMPLATE:
            logging.info("Registering dtu devices")
            servicename=get_config_value(config, "Servicename", "INVERTER", 0, "com.victronenergy.pvinverter")
            service = DbusService(
                servicename=servicename,
                paths=paths,
                actual_inverter=0,
            )

Maybe there's something wrong with the getter. I'm not able to debug that right now.

@TheGrumpyBadger
Copy link
Author

As far as I see the paths are only implemented for pv inverter:
paths = { "/Ac/Energy/Forward": { "initial": None, "textformat": _kwh, }, # energy produced by pv inverter "/Ac/Power": {"initial": None, "textformat": _w}, "/Ac/L1/Voltage": {"initial": None, "textformat": _v}, "/Ac/L2/Voltage": {"initial": None, "textformat": _v}, "/Ac/L3/Voltage": {"initial": None, "textformat": _v}, "/Ac/L1/Current": {"initial": None, "textformat": _a}, "/Ac/L2/Current": {"initial": None, "textformat": _a}, "/Ac/L3/Current": {"initial": None, "textformat": _a}, "/Ac/L1/Power": {"initial": None, "textformat": _w}, "/Ac/L2/Power": {"initial": None, "textformat": _w}, "/Ac/L3/Power": {"initial": None, "textformat": _w}, "/Ac/L1/Energy/Forward": {"initial": None, "textformat": _kwh}, "/Ac/L2/Energy/Forward": {"initial": None, "textformat": _kwh}, "/Ac/L3/Energy/Forward": {"initial": None, "textformat": _kwh}, }

The paths for a "non-pv"-inverter I posted above.

@0x7878
Copy link
Collaborator

0x7878 commented Apr 27, 2023

Got you. I created a new branch feature-non-pv-inverter. I'm not able to test it yet but maybe it's a start

@0x7878
Copy link
Collaborator

0x7878 commented May 4, 2023

Good to know. If so, such information belongs to the readme. I also figured out that (at least in my installation) it takes up to 10 minutes before the VRM-Portal starts showing the live values of an e.g. (PV-)inverter.

@henne49
Copy link
Owner

henne49 commented May 4, 2023

The 10 minutes can be configured in vrm or Venus, as the graphs you see are historical, that is why you have a delay.

I would at least use a delay of 10 minutes, as too short delays, you can have historical errors in case of unreachable or reboot of opendtu when opendtu shows 0

@dsteinkopf
Copy link
Collaborator

@henne49 ah yes, that's probably the rease for the delay. I am "happily" using 1 Minute.

I found some miscalculations in VRM with AcPosition=1. Doing some more testing, but AcPosition=0 seems to be better for the inverter.

It's in the config.ini: # 0=AC input 1; 1=AC output; 2=AC output 2. Yes, it should also be in the readme. But it's no "soft decision", it's a fact that must be configured correctly (where is the inverter connected), isn't it?

@TheGrumpyBadger
Copy link
Author

looks good so far:
image

image

@dsteinkopf
Copy link
Collaborator

dsteinkopf commented May 4, 2023

@TheGrumpyBadger : Where do we have to look in your images? I was expecting an "inverter" instead of pvinverter.

@0x7878
Copy link
Collaborator

0x7878 commented May 4, 2023

In general: If a device becomes an inverter, the device in the middle (with the Victron logo) represents that device. This is why there is a label "Inverting, Off, etc.".

Furthermore, it works like that: The inverter takes Energy from the Battery and pushes it to AC-Loads. which then shows up in "consumption".

Feel free to correct me if something that I said isn't right.

@TheGrumpyBadger
Copy link
Author

You are right. On the screenshot are two HM-350 on a single openDTU-onbattery.
The first one ist an L1 and the inverter, it is feeded by an 24V LFP battery,
second one is on L3 and is a normal pvinverter on L3.
Both are now on AcPosition=0 and the numbers seems to be right.

@TheGrumpyBadger
Copy link
Author

The (now correct) numbers are showing that I got 0.2 kWh from the grid and feeded 0.
From solar I got 0.9 kWh so far. Alltogether I used 0.5 kWh, 0.6 kWh were loaded to the battery.

@TheGrumpyBadger
Copy link
Author

TheGrumpyBadger commented May 4, 2023

It's in the config.ini: # 0=AC input 1; 1=AC output; 2=AC output 2. Yes, it should also be in the readme. But it's no "soft decision", it's a fact that must be configured correctly (where is the inverter connected), isn't it?

for the inverter config it's indeed a soft decision. An inverter has no "AC input", so I thought "AC output" must be right, but perhaps not. That's why I'm in testing.
The positions are normaly from the view of a MultiPlus/Quadro which here is not exisiting.

@dsteinkopf
Copy link
Collaborator

My mistake in thinking was to assume you had a Multiplus (then, it is clear where your inverter is connected).

If you have none, I understand that you have to experiment. And your result "AcPosition=0" (->"AC input 1") seems plausible, as "AC input 1" is the one that is connected to the grid. And your inverter is also connected to the grid, if I understood correctly.

@DrknMonkey
Copy link

Hello,

first thanks for this Project!
I have installed it too and my HM-300 is connected to with a Lifepo Battery and with the AC-IN from a Multiplus.
So far ir works good but the Remote Console from the Cerbo shows me the HM-300 as a PV Inverter on the AC-Out.
Is it possible that it shows the HM-300 correct on the AC-IN?

I have these Settings in the config.ini:

### Only needed for OpenDTU and ahoy
# AcPosition 0=AC input 1; 1=AC output; 2=AC output 2
# 1st inverter
[INVERTER0]
Phase=L1
DeviceInstance=34
AcPosition=0
#Servicename=com.victronenergy.inverter (i have change it to .inverter, standart was it a .charger)

Here a Screenshoot from this:
cerbo

Thank you!

@0x7878
Copy link
Collaborator

0x7878 commented May 16, 2023

Hey 👋
Please remove the hash sign "#" otherwise it will work as default (in this case PV inverter). After that check the values on your cerbo or via the terminal. See the readme for useful commands

@DrknMonkey
Copy link

Thank you... you mean it so or:

config

Unfortunately in the Cerbo is the HM-300 Status then unknown:
Cerbo

@0x7878
Copy link
Collaborator

0x7878 commented May 17, 2023

That's right. I'll try your setup with a test device the next days. It could be that an Inverter does not have ac in which lead to your problem. Could you try ac out?

@DrknMonkey
Copy link

Not so easy... but i have activate the AC-IN from the Multiplus, unfortunately still the same.

@0x7878
Copy link
Collaborator

0x7878 commented May 17, 2023

Ok I see. First of all this setup was implemented without a Multiplus in place. But still... I'm wondering why there are no values at all in your setup. I'll try to figure it out but because of "Vatertag" it has to wait ;-)

@DrknMonkey
Copy link

Thank you... it would be nice if it works with a Multiplus too :). But first i wish you a great "Vatertag" ;).

@WilliDerTiger
Copy link

Hello,
Thanks for the good integration into the Victron world ( Cerbo GX ).
I have a Shelly 3EM working on the grid, which I have successfully connected via https://github.com/fabian-lauer/dbus-shelly-3em-smartmeter.
I have a Victron 150/35 MPPT pv-charger for my battery 48V.
From the battery, I feed a Hoymiles HM-800 into the L3 grid.
A second Hoymiles HM-600 (PV inverter) feeds PV directly to L3 in the grid ( 1st inverter ).
This has all been integrated correctly,
except that the HM-800 (inverter) feeds into L1 according to the display.

I have set it to L3 in config.ini ( 2nd inverter ).
Bildschirmfoto 2023-05-21 um 12 14 46

How can I change it to L3?

Bildschirmfoto 2023-05-21 um 12 16 44 Bildschirmfoto 2023-05-21 um 12 12 55 Bildschirmfoto 2023-05-21 um 12 12 15 Bildschirmfoto 2023-05-21 um 12 12 33

Thanks

@0x7878
Copy link
Collaborator

0x7878 commented May 21, 2023

Victron doesn't support it.
Screenshot_20230521-130644
They have no other endpoint than L1 and I didn't test a different one because it would then be an undocumented endpoint.

@WilliDerTiger
Copy link

OK, then I have to live with it.
Thanks

@dsteinkopf
Copy link
Collaborator

We are currently (atm) doing several experiments, but yes, it seems Victron does not support it... At least not this way, maybe there is another one...

@TheGrumpyBadger
Copy link
Author

TheGrumpyBadger commented May 21, 2023

Please keep in mind Victron never intended to use an inverter on a system conncted with the grid.
Perhaps it better to mimic a Multiplus.

@WilliDerTiger
Copy link

Yes, will certainly be better,
to imitate Multiplus.

@dsteinkopf
Copy link
Collaborator

What do you mean by mimic/imitate a Multiplus?

@DrknMonkey
Copy link

Ok I see. First of all this setup was implemented without a Multiplus in place. But still... I'm wondering why there are no values at all in your setup. I'll try to figure it out but because of "Vatertag" it has to wait ;-)

Hello,

gives it already a Solution or is it not possible :)

@0x7878
Copy link
Collaborator

0x7878 commented May 27, 2023

We're still experimenting but it seems that it does not work as a an Inverter. I'll rebuild the code base to support more device's. I cannot tell when I start because I'm also busy right now. :-(

@muellcy
Copy link

muellcy commented Aug 2, 2024

I have expanded my PV system and included a Cerbo-SGX. So fare everything is working fine . There is just one thing that is not shown correctly! The “total solar (2379 W)" value” always adds the power that the Hoymiles HM 1500 feeds in (367 W) to the PV power that comes from the MPPT trackers (2011 W). The inverter load should not be addd as it is unloading the battery. I tried all possible combinations of (AC-position from 0-2 and Servicename = pvinverter, charger and inverter). The attached config is currently running on my cerbo and is displaying at least the "AC-Loads" correctly.
My PV-System consists of 2 Victron mppt trackers, a Daly BMS with LifePo4 cells.
Furthermore, a "Hoymiles HM1500 inverter with opdendtu" and a "Shelly Pro 3EM" and as well as mentioned the Cerbo-sgx.

Does anyone have an idea how to solve the problem?
I think it has to do with the "servicename" but I am not sure. As said I tried all 3 to me known servicenames. No one made a difference, nor was solving the issue. The "AC-Position" must set to "0" otherwise the "AC-Load" values are incorrect.
2024-08-02 15_26_20-192 168 1 110 - PuTTY

2024-08-02 15_40_17-CMO-Solar-Keller - VRM Portal

@0x7878
Copy link
Collaborator

0x7878 commented Aug 2, 2024

If I got you right, you want to tell victron that your hoymiles is actually an ac-inverter rather than an pv-inverter. If I remember right there is currently no solution for this use case. I'd like to emulate a Multiplus for this situation but I think there is much more that has to be implemented.

Just a note: In your config you did not comment out the service name. So it won't work like this. Feel free to try some other variations but I'm not sure if it works.

@muellcy
Copy link

muellcy commented Aug 4, 2024

Yes, that is exactly what I try to achive. I do not have an victron inverter in my installation. Only the Hoymiles HM1500 which is running as an ac-inverter. I found an emulation for victron multiplus inverters. But this implementaion was also not solving the problem. It is a shame that there is not solution available. Anyhow thanks for your clarification on this issue :-(

Yes I am aware the in the attached file the servicename was comment out. On my cerbo it is not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
10 participants