Eric M. avatar image
Eric M. asked

GUI Mods SmartShunt Alternator Oddity

Hey @Kevin Windrem, or anyone who may have experienced this...

For my van, I had an Orion Smart 12v *Non-Isolated* DC Charger (charging van lithium batteries off my alternator). I just swapped it with the same but *Isolated* version, and added a SmartShunt as "DC Energy Meter" on the output negative line. Its installed per Victron: input negative going to common chassis ground, output negative going to the Shunt's "System Minus" side, and the "Battery Minus" side going back to my busbar and eventually the common chassis ground (shared with the starter battery).

Works great, VC app showing accurate readings as a dc meter. This method has been mentioned on here, I can say it definitely works!

Anyways, GuiMods acts a lil funky when I set meter type to "Alternator." All the screenshots are taken in quick succession under relatively equal conditions.

For starters, on the Victron stock view, it correctly removes the Shunts power from the overall DC power when the Orion is charging. Previously, it would show a negative "DC System" (assuming the Orion was putting out more than my DC System was consuming).


Here it is as an Alternator with the Orion not charging (van engine off):


And here we see the issue, when the "Alternator" shunt has power through it:


I can't quite explain it... Alternator is showing its proper output, battery is reading its current correctly, but the DC System (renamed "DC Loads" as the system is now only a consumer) jumps to a crazy high negative. Almost like the Alternator is still considered part of the DC System, and the rest of the DC system is also considered a negative (producer) instead of a consumer... So we get a weird "-516 W" when the DC Loads should still read around "227 W" or whatever.

Sanity check, as a "Fuel Cell" or "Wind Generator" it displays as I would expect:


** As an "AC Charger" (that has a GuiMods tile) it just never appeared, but the DC Loads still displayed properly, removing the Orion/Shunt output from its reading. Same with all the other DC Meter types that do not have a GuiMods tile.

The final sanity check was reading the Venus ModBus on my HomeAssistant setup, which reads out the V/A output correctly, both as "Alternator" and "Wind Generator."

So Kevin / community, would you think this is a GuiMods issue, or have I misunderstood the intended use of the "Alternator" DC Meter Type setting?

Thanks in advance, I know this was a long one!

Venus OSSmartShuntorion-tr smartgui mods
1665681838567.png (117.5 KiB)
1665682013103.png (164.9 KiB)
1665682076622.png (165.3 KiB)
1665682339567.png (174.8 KiB)
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

5 Answers
Kevin Windrem avatar image
Kevin Windrem answered ·

Which version of Venus OS are you using?

Venus OS calculates the value displayed in the DC System tile from known sources. There were recent changes in the calculation that Venus OS uses for it's DC System power. Whether to include alternator and some other powers has changed recently. In fact, the stock code for v2.90 and beyond do not subtract alternator power. GuiMods however DOES subtract it.

v2.89 does not subtract these values either. This was an omission on my part. I'll put it in the next version of GuiMods. Let me know if it is urgent. Otherwise, you can upgrade to v2.9x which should fix the issue.

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Eric M. avatar image Eric M. commented ·

Thanks Kevin,

I’m on VenusOS 2.91 and GuiMods 6.15. Over the Modbus, the Venus is sending “DC System Power” with the alternator/wind/fuel cell subtracted out, as those power measures come through in their own distinct variable.

Beyond that, I can only say that Venus 2.91 without GuiMods does subtract the alternator power, although it doesn’t show anything about the alternator on the screen. And your wind/fuel cell tiles do allow DC System to display the accurate values, while Alternator miscalculates SC System. Near as I can tell, with Alternator running, DC System = (roughly)

0 - 2*alternator_power + dc_system_power_besides_alternator

So if Alternator puts out 360w and the rest of the system is pulling 20w, alternator has +360w, the battery has +340w, and DC System has -700w.

As “Fuel Cell”, FC has +360w, the battery has +340w, and DC System has -20w. Which is what I’d expect of both settings, no?

It’s very strange…

0 Likes 0 ·
Kevin Windrem avatar image
Kevin Windrem answered ·

The stock code in v2.90 (and 2.91) is:

newvalues['/Dc/System/Power'] = dc_pv_power + charger_power + fuelcell_power + vebuspower - inverter_power - battery_power

are you saying without GuiMods the local GUI shows the proper DC System power?

There is a line of code commented out that suggested alternator power should be SUBTRACTED:

#newvalues['/Dc/System/Power'] = dc_pv_power + charger_power + fuelcell_power + vebuspower - inverter_power - battery_power - alternator_power

So GuiMods does exactly that but it sounds like this is not correct.

As I understand it, the alternator should be feeding it's power to the load/system side of the shunt, not the battery side. Can you confirm you are wired this way?

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Eric M. avatar image Eric M. commented ·

Interesting. That makes sense, as it’s always seemed like DC System was just a catch all of any power in the system that doesn’t have its own measurement.

The shunt is wired per Victron with the ‘output negative’ of the Orion going to the system side of the shunt, and the battery side goes to my system minus (busbar, on the system side of my main battery shunt).

Yes, it seems that without GuiMods, the DC system effectively removes any power generated by the FuelCell or Alternator.

Perhaps I’m expecting the wrong effect? But I was thinking, same as a fuel cell, PV, or any other generator/charger in the DC system, the alternator would be excluded from the DC System number because it has its own discrete measurement now. And GuiMods handles all of those as I would expect, with the exception of Alternator.

Per that commented code above, I would expect alternator_power to be added, along with the rest of the power generators. But perhaps the designed intent is for the alternator to be taking from the DC System instead of charging it?

0 Likes 0 ·
Kevin Windrem avatar image Kevin Windrem commented ·
Yes, DC system is just a catch all unless you specifically install a shunt for it. That's new in the last couple of releases but I consider it almost essential.

I find it odd that without GuiMods, you are seeing alternator removed from DC System numbers. Since the stock code doesn't include it in the DC System calculations then it should show up under DC System. The stock code DOES include fuel cell so I would expect the behavior to be different (alternator vs fuel cell).

I too would think alternator would be the same as fuel cell, PV charger and AC charger. Since the code is commented out, it could be wrong. I simply used the commented code so alternator is subtracted.

In my initial testing of these numbers used my main battery shunt reconfigured for other things and I got the signs backwards in some cases. I got this sorted out with help from someone with an extensive DC system on his boat. But your experience seems to contradict his. I think his system may have used a smart alternator controller or DC-DC charger (Scotty) which provides alternator data without using a shunt. So maybe there's an issue with the shunt configuration relative to data from Scotty. Yikes, I'm not sure I can sort this out.

One of the issues is the use of shunts for other purposes is not covered in Victron documentation. There is a one-liner for using a shunt for a DC Meter and very little detail other than a picture of the wiring of a shunt for "other circuit". Could be some positives and negatives reversed somewhere in the code.

It would be interesting to see what your alternator shunt is showing in dbus-spy. Can you take a look at that and let me know if that number is positive or negative?

0 Likes 0 ·
Eric M. avatar image
Eric M. answered ·

The shunt is wired exactly as shown here:

Ah, okay, I just re-ran that portion of the test more intentionally. Apologies for screwing up my initial findings. Turns out Alternator is not subtracted from the DC Power, and has the same ridiculous result in the Victron Stock view as well. Perhaps this is a bug in VenusOS instead? @mvader (Victron Energy)

Following pictures have no other inputs or loads (~130w of casual loads)

SmartShunt configured as a `Fuel Cell / Water Generator / DC Charger etc`:

Correct: 381w from alternator (not shown), 249w going to battery, 132w going to loads


SmartShunt configured as `Alternator`:

Correct: 381.w from alternator (not shown), 252w to battery, DC Power should = 129w

Unintelligible: DC Power = -1 * (2* Alternator Output + rest of DC Power)



I'm sorry @Kevin Windrem, turns out this wasn't a GuiMods issue... Apologies for the false conclusion.

To your question though, the dbus-spy reads positive whether configured as a `Fuel Cell` or an `Alternator.` Both settings show identically the same:


So... After days of testing, SmartShunt configured as Alternator does seem to force DC Power to be:

-1 * (2* Alternator Output + rest of DC Power)

So strange...

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Kevin Windrem avatar image Kevin Windrem commented ·
Are these tests with GuiMods completely uninstalled? The reason I ask is that with GuiMods installed and with the stock flow overview selected, the modified systemcalc is still in place.

The modified code SUBTRACTS the alternator power rather than adding it as is done for fuel cell which accounts for the 2x error. If you completely uninstall GuiMods, the original systemcalc is restored and I suspect you'll see 1x the alternator power shown in DC System power.

I can change the alternator to be added to the DC System power like fuel cell but as I mentioned before, I had someone else test this with a smart alternator interface that doesn't use a shunt for providing data an they though it was correct as is. I'd need to dig onto the source of the power to decide whether to add or subtract the alternator power. Getting messy.

0 Likes 0 ·
bathnm avatar image bathnm commented ·

@Eric M.

You are correct it is strange. The system at present does subtract some currents and not others. Victron is well aware of the issue and I am sure will be fixed at some stage, but no idea when. The total today is not true DC Power. It is Power derived from adding and subtracting various measurements, so reflects what is left over and not accounted for in for instance the battery, inverter and solar. The calculation is

dc_pv_power + charger_power + fuelcell_power + vebuspower - inverter_power - battery_power

So am surprised that water generator and dc charger did not give strange results as they are not listed in the calculation and therefore would end up in the bucket once the values are subtracted from the battery power.

If you want to fix it and have shell access to your device then you can edit the relevant python file to remove the alternator current/wats.

The other alternative is to install a shunt in the negative of the true loads. Then configure the shunt as a dc system shunt. That stops the calculation above from being used and the system displays the sum of all dc system shunts.

0 Likes 0 ·
Kevin Windrem avatar image Kevin Windrem bathnm commented ·
Hi Mark. Glad you are weighing in on this. The issue is strange in that when I use the commented version of this calculation we are seeing an error that is 2x the alternator power. I think that code is WRONG and the alternator should ADD to the value like other charging sources. But aa I mentioned above other tests with a Scotty seemed to indicate proper power calculations. Your thoughts?
0 Likes 0 ·
bathnm avatar image bathnm Kevin Windrem commented ·
@Kevin Windrem Sign... at one stage during testing the alternator delivered a negative current/power as it is a source and that is possibly the correct sign to use. It was then changed to be positive. As the code had been commented out, it was not fixed.

Scotty / WS3000 has nothing to do with the issue :0

0 Likes 0 ·
Eric M. avatar image Eric M. bathnm commented ·
Ah okay, makes sense. Not sure, but definitely Water Generator and Fuel Cell both acted the same in GuiMods. Perhaps some that code implied some specific use for those and not others.

To be fair, I'm moving some of my GUI stuff to HomeAssistant, just wanted to put these quirks down to help the community before setting up my new screen. Waiting to have the time to fork their Energy Dashboard and create one that lends more towards off grid use and Victron ModBus readings. The ModBus works great, so thats a plus :)

0 Likes 0 ·
jwfrary avatar image jwfrary Eric M. commented ·

@Kevin Windrem hi, Kevin was this fixed or is it still a bit of a question?

I'm running your latest, was working great before I added the pv charger, now the power animation, at least, runs backwards into the alternator the calculations are correct though I think number wise.

Im running 7.21

3 shunts

1 main which everything goes though then the alternator and loads.

Sorry about the appealing video skills and the temp sensors I haven't gotten around to fitting.... 6 months and counting!

0 Likes 0 ·
Robert avatar image
Robert answered ·

Hello, so many user want to measure other DC Loads with a shunt as an DC meter.

Is there any chance to get sometimes a Smartshunt for the positive wire?

Or a special Lynx Distributor with several Shunts inside.

This should be awesome.

Best regards Robert

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Kevin Windrem avatar image
Kevin Windrem answered ·

No, I think it's backwards in v7.21.

Should be fixed in v7.30 which is currently in beta. Change the branch/tag to "beta" if you want to give it a try. I'll be releasing GuiMods 7.30 when Venus OS v3.00 is released.

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

jwfrary avatar image jwfrary commented ·
Hi Kevin, thanks I'll give the beta a shot and see.

Cheers Jon

0 Likes 0 ·

Related Resources