Emoncms + Victron CCGX + My Battery App

Try doing sudo apt update first although another user has had an issue with this.

Hi,

Got myself into a bit of mess with the ‘sudo apt update’. I was running the 2018 emonbase sd card image and the discrete sampling software on my emontxv3 and the ‘sudo apt update’ stalled half way through :frowning:

Tried to reboot and nothing…

So I reflashed the emonbase sd card with the lastest 2019 image and uploaded the latest continuous monitoring firmware onto the emontx. All the input were present and working.

I then used putty to complete the sudo apt update and it all updated and installed pymodbus. Will have a play this weekend and see if I can get the victron modubus registering on the input page.

I will keep you update :slight_smile:

cheers

1 Like

Its much easier to activate mqtt on the venus and use mqtt.
After that use nodered or any parser to get the desired values…

I might have a go with MQTT. I dont have node red running on anything atm.

I have pymodbus up and running now, but more errors. Can seem to find the answer to this one. See below.

My code in the emonhub config is this.

[[ModbusTCP]]    
    Type = EmonModbusTcpInterfacer
    [[[init_settings]]]
         modbus_IP = 192.168.0.80
         modbus_port = 502          # Portclient listens on
    [[[runtimesettings]]]
         rName = Battery State of Charge (System), Battery Voltage (System)
         register = 843, 840
         nReg = 1, 1
         rType = uint16, uint16
         # nodeid used to match with node definition in nodes section below. Can be set to any integer value not previously used.
         nodeId = 27
         # Channel to publish data to should leave as ToEmonCMS
         pubchannels = ToEmonCMS,            
         interval = 10

[[27]]
     nodename = Multiplus
     [[[rx]]]
       names = Battery State of Charge (System), Battery Voltage (System)
       datacodes = H, H
       scales = 1, 10
       units = %, V

any help would be much appreciated :slight_smile:

cheers

Edit - formatted text. BT, Moderatorr

HI all,

For those who have a CCGX connected to a multiplus/quattro and want to read registers via Modbus TCP and import them to the inputs page of emoncms. I have worked out the code that is required for the config file in the interfacers section of the emonhub.

As @James_Hill mentioned the unit ID must be included as there is multiple unit ID’s/slaves on the Victron VE Bus system. See below.

I wanted the SOC and charge/discharger power feed for the My Solar & Battery app.

[[ModbusTCP]]    
    Type = EmonModbusTcpInterfacer
    [[[init_settings]]]
         modbus_IP = 192.168.x.x
         modbus_port = 502         
     [[[runtimesettings]]]
         rName = Battery State of Charge (System), Input Voltage Phase 1, Grid Power, Battery Power, 
         register = 31, 4, 821, 843
         nReg = 1,1,1,1
         nUnit = 239, 239, 100, 100
         rType = uint16, uint16, uint16, int16
         nodeId = 27
         pubchannels = ToEmonCMS,            
         interval = 10

[[27]]
     nodename = Multiplus
     [[[rx]]]
       names = Battery State of Charge (System), Input Voltage Phase 1, Grid Power, Battery Power, 
       datacodes = H,H,h,h
       scales = 0.1,0.1,1,1
       units = %, V, W, W

Cheers

Gareth

1 Like

Can someone help me pls? I am trying to set up Emoncms to access my CCGX, but I am unsure exactly where this config file gets edited in. Worried I might install in the wrong place. Can someone show their full config file & location please?
My Emoncms is on an Intel NUC, & pymodbus has been installed.

Thanks, Doug (safe in Overcast Sunny Australia! Hope Donnie Trump gets over his Covid? )

If you are trying to do the same as @gjones84, you are going to modify emonhub config.

In installing emoncms on an NUC, how did you do it and is emonhub running?

image

Thanks Brian,
I installed from the Github image, & I think I disabled all the Pi bits. (I used the rPi user name etc as standard, cos it was easier!)
Emoncms is running fine, & it is getting data from my monitor. I Installed pymodbus, & that seems fine.
What I wish to achieve is to get the battery SOC from the CCGX, so that I can emulate the Victron Dashboard data (in some yet to be determined form).
My system is 2 of Solaredge 5Kw inverters, currently 15Kw of panels, thew Victron Charger/Inverter & Zenaji Batteries (Which are Lithium Titanate manufactured in Melbourne, Australia)

Hi Doug,

I have done this and it is all up and running and working fine. Once you have pymodbus installed and running. Log into your emonbase locally.

Then click the three bars at top left. Click emon hub. Select edit config. Scroll down to interfaces and insert my code. Restart and go to inputs and it should all be there :slightly_smiling_face:.

Once you have that you can configure the My Solar Battery App.

Hope that helps.

Cheers

Gareth

Are you on a generic Linux install or a Pi one?

On to an NUC? Or do you mean you ran the scripts?

How? emonhub? HTTP? MQTT?

Unless I understand more how you have set emoncms up on the NUC I’ll not be able to help much as there are simply too many variables.

Can you click on the button Copy as Markdown next to Server Information on the Admin page and paste into a reply here please (no further formatting required).

Server Information

Server Information

Services

  • emoncms_mqtt :- Active Running
  • feedwriter :- Active Running - sleep 300s 360 feed points pending write
  • service-runner :- Activating Auto-restart
  • redis-server :- Active Running
  • mosquitto :- Active Running
  • demandshaper :- Active Running

Emoncms

Server

  • OS :- Linux 5.4.0-48-generic
  • Host :- pi-desktop | pi-desktop | (192.168.1.182)
  • Date :- 2020-10-03 21:28:33 AEST
  • Uptime :- 21:28:33 up 22:37, 1 user, load average: 0.34, 0.19, 0.13

Memory

  • RAM :- Used: 42.89%
    • Total :- 3.74 GB
    • Used :- 1.6 GB
    • Free :- 2.13 GB
  • Swap :- Used: 0.00%
    • Total :- 2 GB
    • Used :- 0 B
    • Free :- 2 GB
      Write Load Period

Disk

  • / :- Used: 8.87%
    • Total :- 109.04 GB
    • Used :- 9.67 GB
    • Free :- 93.79 GB
    • Write Load :- n/a
  • /boot/efi :- Used: 1.53%
    • Total :- 510.98 MB
    • Used :- 7.8 MB
    • Free :- 503.19 MB
    • Write Load :- n/a

HTTP

  • Server :- Apache/2.4.41 (Ubuntu) HTTP/1.1 CGI/1.1 80

MySQL

  • Version :- 5.5.5-10.3.22-MariaDB-1ubuntu1
  • Host :- localhost:6379 (127.0.0.1)
  • Date :- 2020-10-03 21:28:33 (UTC 10:00‌​)
  • Stats :- Uptime: 81468 Threads: 10 Questions: 42422 Slow queries: 0 Opens: 45 Flush tables: 1 Open tables: 39 Queries per second avg: 0.520

Redis

  • Version :-
    • Redis Server :- 5.0.7
    • PHP Redis :- 5.3.1
  • Host :- localhost:6379
  • Size :- 103 keys (926.98K)
  • Uptime :- 0 days

MQTT Server

  • Version :- Mosquitto 1.6.9
  • Host :- localhost:1883 (127.0.0.1)

PHP

  • Version :- 7.4.3 (Zend Version 3.4.0)
  • Modules :- apache2handler bz2 calendar Core ctype curl date dom v20031129exif FFI fileinfo filter ftp gd gettext hash iconv json libxml mbstring mosquitto v0.4.0mysqli mysqlnd vmysqlnd 7.4.3openssl pcre PDO pdo_mysql Phar posix readline redis v5.3.1Reflection session shmop SimpleXML sockets sodium SPL standard sysvmsg sysvsem sysvshm tokenizer xml xmlreader xmlwriter xsl Zend OPcache zip v1.15.6zlib
Client Information

Client Information

HTTP

  • Browser :- Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Cyberfox/52.9.1
  • Language :- en-US,en;q=0.5

Window

  • Size :- 2545 x 1343

Screen

  • Resolution :- 2560 x 1440

(end)
Thanks Brian, realising I am well out of my depth (but prepared to learn). I am a hardware man!
I realise that I do not know how all the s/w fits together, except in a basic way.

regards, Doug

You didn’t say how you did the install.

But, when you did the install, you did not install emonhub. You will need to do that.

I think you can just clone the emonhub repo and run the install. As I do not know where or how you installed the scripting part of emoncms, I can’t advise where to install it to.

On the Pi systems that is all in /opt/openenergymonitor.

The standard pi one :+1:

Yes much simpler as emonhub is installed by default.

Hi Gareth,

I realise that this thread is quite old now, but I’m trying to do exactly the same as you did. It seems to run MODBUS successfully, but then I get this in the logfile:

I’d be grateful if you had any advice!

Thanks,

John.

Is your system fully updated?

Yes - just done a full system update and get the same error :man_shrugging:

Hi. Some time ago I did this. I remember it being a PITA when I did it.

Tbh with all my experience now. I can help you muddle way through the modbus stuff but the best way to parse data from your victron system is via mqtt

Download this and install of your pc.

Then connect to your venus device and take a look at which topics you wish to pull out.

Then use the venus os large image with node red and you can pull the topics out using the installed victron nodes or via mqtt topics and ping them straight into emon device piece of cake.

Its easy, robust and reliable.

Cheers

Gareth

Thanks Gareth - I came to that conclusion too, but I’m not running Node Red, and am having problems with that too! See here:

Could you do a quick sketch of of your system please? Inverter/charger, battery, bms, gx or venus device and comms?