Archive for February, 2025

Victron Energy munin plugins for Cerbo GX monitoring

Friday, February 28th, 2025

Charger amps


#!/usr/bin/perl

use Device::Modbus::TCP::Client;

my $client = Device::Modbus::TCP::Client->new(
host => ‘put your GX ip or name here’
);

$config = 1 if(“config” ~~ @ARGV);
$chargers = [ 223, 224, 226, 238, 239 ]; # devices

if($config) {
print “graph_title charger amps\n”;
print “graph_category victron\n”;
foreach $charger (@{$chargers}) {
print $charger . “_amps.label Amps\n”;
}
} else {
foreach $charger (@{$chargers}) {
my $req = $client->read_holding_registers( unit => $charger, address => 772, quantity => 1 );
$client->send_request($req) || die “Send error: $!”;
my $response = $client->receive_response;
print $charger . “_amps.value ” . uint16_to_int( @{$response->{‘message’}->{‘values’}}[0]) / 10 . “\n”;

}
}

sub uint16_to_int {
my $uint16 = shift;
return $uint16 > 0x7FFF ? $uint16 – 0x10000 : $uint16;
}

Charger overall power


#!/usr/bin/perl

use Device::Modbus::TCP::Client;

my $client = Device::Modbus::TCP::Client->new(
host => ‘put your GX ip or name here’
);

$config = 1 if(“config” ~~ @ARGV);

$chargers = [ 223, 224, 226, 238, 239 ]; # adjust with your actual list. See Settings -> Services -> Modbus for a list

if($config) {
print “graph_title charger total watts\n”;
print “graph_category victron\n”;
print “total_watts.label watts\n”;
} else {
my $total = 0;

foreach $charger (@{$chargers}) {
my $req = $client->read_holding_registers( unit => $charger, address => 789, quantity => 1 );
$client->send_request($req) || die “Send error: $!”;
my $response = $client->receive_response;
$total += uint16_to_int( @{$response->{‘message’}->{‘values’}}[0]) / 10;
}

print “total_watts.value $total\n”;
}

sub uint16_to_int {
my $uint16 = shift;
return $uint16 > 0x7FFF ? $uint16 – 0x10000 : $uint16;
}

Charger individual power


#!/usr/bin/perl

use Device::Modbus::TCP::Client;

my $client = Device::Modbus::TCP::Client->new(
host => ‘put your GX name or IP here’
);

$config = 1 if(“config” ~~ @ARGV);

$chargers = [ 223, 224, 226, 238, 239 ];

if($config) {
print “graph_title charger watts\n”;
print “graph_category victron\n”;
foreach $charger (@{$chargers}) {
print $charger . “_watts.label Amps\n”;
}
} else {
foreach $charger (@{$chargers}) {
my $req = $client->read_holding_registers( unit => $charger, address => 789, quantity => 1 );
$client->send_request($req) || die “Send error: $!”;
my $response = $client->receive_response;
print $charger . “_watts.value ” . uint16_to_int( @{$response->{‘message’}->{‘values’}}[0]) / 10 . “\n”;

}
}

sub uint16_to_int {
my $uint16 = shift;
return $uint16 > 0x7FFF ? $uint16 – 0x10000 : $uint16;
}

inverter state of charge


#!/usr/bin/perl

use Device::Modbus::TCP::Client;

my $client = Device::Modbus::TCP::Client->new(
host => ‘put your GX name or IP here’
);

$config = 1 if(“config” ~~ @ARGV);

my $req = $client->read_holding_registers( unit => 227, address => 30, quantity => 1 );

$client->send_request($req) || die “Send error: $!”;
my $response = $client->receive_response;

if($config) {
print “graph_title state of charge\n”;
print “graph_category victron\n”;
print “inv_soc.label SOC\n”;
} else {
print “inv_soc.value ” . uint16_to_int( @{$response->{‘message’}->{‘values’}}[0]) / 10 . “\n”;
}

sub uint16_to_int {
my $uint16 = shift;
return $uint16 > 0x7FFF ? $uint16 – 0x10000 : $uint16;
}

Inverter bus voltage


#!/usr/bin/perl
use Device::Modbus::TCP::Client;

my $client = Device::Modbus::TCP::Client->new(
host => ‘your GX device goes here’
);

$config = 1 if(“config” ~~ @ARGV);

my $req = $client->read_holding_registers( unit => 227, address => 26, quantity => 2 );

$client->send_request($req) || die “Send error: $!”;
my $response = $client->receive_response;

if($config) {
print “graph_title battery volts\n”;
print “graph_category victron\n”;
print “inv_volts.label Volts\n”;
} else {
print “inv_volts.value ” . @{$response->{‘message’}->{‘values’}}[0] /100 . “\n”;
}

Allen & Heath – getting static address off Dante card

Friday, February 28th, 2025

So, Dante should improve their controller so it is possible to reset the IP address of a card that isn’t in the current subnet – I’ll send them a email about that. But, for now, should you have a Dante card that you can’t talk to because it’s not on the same subnet you are, what you need to do in windows is get a newer version of the Dante client (4.4.2.2 or later), then set the subnet on the ethernet interface to be the same as your Dante controller’s subnet (which you will see in the network view or if you click on the red device in the device view). Now, you’ll have to guess at subnet mask, or use something like wireshark to see what broadcast address is being hit.

Once you’ve done all this, you should be able to set the controller back to DHCP.

Musk is a moron, and DOGE is a terrible cryptocurrency

Sunday, February 2nd, 2025

So, one thing you can safely say about DOGE, the cryptocurrency. It is headed for zero. It has a *unlimited supply*, with a fairly high mint rate. It was originally intended as a joke.

One thing you can say about DOGE, the government agency, is it is also a terrible idea. Musk is the poster child for Dunning-Kruger – we’re talking about the guy who thought you could have a 600 mile long evacuated above ground tunnel, among other things. He also doesn’t understand that the more people you make homeless and hungry, the less wealth we as a species have. DOGE is also likely to destroy many useful functions that the government performs.. protecting our bank accounts, protecting us against bad loans, protecting us from e coli, protecting us from predatory corporations who otherwise would destroy all the land and poison all the water to make a few bucks.

Musk himself has says there will be some hardship. I vote all Musk’s money be taken away and he be forced to live with the hardships he is causing.