question

andreww avatar image
andreww asked

Detect CCGX generator notifications over LAN

I have a CCGX which controls a diesel generator via a Victron Multiplus. The CCGX is on my home LAN.

Occasionally, the generator fails to start when the CCGX / Multiplus tries to turn it on. The CCGX then displays a "notification", something like "No AC detected at generator input".

What I want to do is to have another device on the LAN that talks to the CCGX in some way and monitors for this situation. The monitoring device would then be able to take some action (such as send an email, ring a bell, or whatever - but I don't need help with that aspect).

I have already succeeded in communicating with the CCGX using SSH, and also using MQTT. It looks to me as if it would be possible to do what I want using MQTT. I've also been wondering whether MODBUS would be a better way of doing it - it looks to me as if I could get the information I want by reading address 3213 over MODBUS once a minute or so.

My question is: what is the best (ie simplest / most robust) way of doing what I want (ie finding out over the LAN when "no AC detected at generator input" happens). Is the answer MQTT or MODBUS or something else, and has anyone else done this? I am OK programming in Python.

CCGX Color Control
2 |3000

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

2 Answers
Daniël Boekel (Victron Energy Staff) avatar image
Daniël Boekel (Victron Energy Staff) answered ·

Hi @AndrewW

I've moved your question to the 'modifications' section of the forum, as there is more knowledge about these topics there.

2 |3000

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

elvistherv avatar image
elvistherv answered ·

This alarm I belive appears at the MQTT topic N/f8369b03e687/generator/0/Generator0/Alarms/NoGeneratorAtAcIn

(replace f8369b03e687 with the ID of your CCGX)

It does seem to take a few minutes for the alarm to fire however so you may instead want to check N/f8369b03e687/system/0/Ac/ActiveIn/Source which will have the value of 240 whilst there is no input and 2 once using the generator.*

*Depending on how you have set up your inputs see the CCGX-Modbus-TCP-register-list spreadsheet)

2 comments
2 |3000

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

andreww avatar image andreww commented ·

Thank you. I have now managed to get the MQTT solution to work using the topic that you mention (and I never found a way to get the data directly from MODBUS). The main resources were https://github.com/victronenergy/dbus-mqtt/blob/master/README.md and http://www.steves-internet-guide.com/into-mqtt-python-client/

It is right that there is a delay between the generator relay closing and any alarm being raised. There are quite a few steps. The generator's own start-up sequence has a built in pause before the diesel engine starts. Then an internal relay in the generator blocks the output until it has "stabilized", and after that the Victron Multiplus also takes a good look at the AC before gradually drawing power. Altogether it is the best part of a minute between asking for power and getting it, and the CCGX waits longer still before declaring a problem.



0 Likes 0 ·
andreww avatar image andreww andreww commented ·

I was over-optimistic in saying that I had solved my problem! I have managed to get MQTT working and I can see the value of topic N/xxxxxxxxxxxx/generator/0/Generator0/Alarms/NoGeneratorAtAcIn but this value seems to be always zero, even when there is a generator failure. Here are the details:

My setup is that I have a CCGX, Multiplus and diesel generator which is started/stopped automatically by the Victron setup (conditions in the CCGX).

My objective is to detect over LAN when generator should have started but hasn't.

The CCGX is connected to my LAN and MQTT is turned on. I have a Raspberry Pi on the same LAN, configured as an MQTT client. The Raspberry Pi is subscribing to two topics: N/xxxxxxxxxxxx/generator/0/Generator0/Alarms/# and N/xxxxxxxxxxxx/system/0/Dc/Vebus/Power [where xxxxxxxxxxxx is my portal id]. The Raspberry Pi is also using mosquitto_pub to send a "keep alive" message every 10 seconds to the CCGX, as advised at https://github.com/victronenergy/dbus-mqtt/blob/master/README.md (which I have studied carefully).

I am confident that the set-up is basically OK because the Raspberry Pi is receiving messages for the topic N/xxxxxxxxxxxx/system/0/Dc/Vebus/Power (every two or three seconds for ever). However, I was hoping to get a message on the topic N/xxxxxxxxxxxx/generator/0/Generator0/Alarms/NoGeneratorAtAcIn when the generator fails to come on - but I don't.

Here is my test scenario.

• Starting situation: generator is OFF per the conditions in the CCGX; Raspberry Pi sending keep-alive messages to R/xxxxxxxxxxxx/system/0/Serial

• On the Raspberry Pi, subscribe to topics N/xxxxxxxxxxxx/generator/0/Generator0/Alarms/# and N/xxxxxxxxxxxx/system/0/Dc/Vebus/Power. Result: the Raspberry Pi receives *one* message at N/64cfd965c73b/generator/0/Generator0/Alarms/NoGeneratorAtAcIn with value 0, and regular messages at N/64cfd965c73b/system/0/Dc/Vebus/Power with varying values

• Manually disable the generator

• On the CCGX, change the generator start/stop conditions so that the generator should come on

• Result: after a several minutes the CCGX display changes to "Generator start/stop Alarm Generated not detected at AC input". This result is as expected.

• At this point, I would also expect the Raspberry Pi to receive an MQTT message with the topic N/xxxxxxxxxxxx/generator/0/Generator0/Alarms/NoGeneratorAtAcIn and a non-zero value. The actual result is that no message on this topic is received. That is the problem.


0 Likes 0 ·
1580217763828.png (1.7 KiB)
1580217772440.png (1.7 KiB)
1580217835099.png (1.7 KiB)