question

tonobo avatar image
tonobo asked

reading special mqtt variable doesn't work

Reading common vars like "R/<id>/vebus/276/Dc/0/Voltage" works quite well but "R/<id>/settings/0/Settings/CGwacs/Hub4Mode" doesn't work. I tried to get into building dbus-flashmq for cerbo arch without success on archlinux. I just skipped over the code and didn't get it directly, but it seems to be intended in some case as no error is being returned. Maybe you can provide some details :D Thanks guys

MQTT
3 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.

kevgermany avatar image kevgermany ♦♦ commented ·
@tonobo

I've moved this to the modifications space, it's beyond the scope of general Q&A.

0 Likes 0 ·
elvis avatar image elvis commented ·

@tonobo

Reading how? With what?

Get an MQTT client and view all the values on your Cerbo (Such as MQTT explorer)

All the topics and values are under N on the broker.

N/<id>/settings/0/Settings/CGwacs/Hub4Mode

0 Likes 0 ·
tonobo avatar image tonobo elvis commented ·

For example, by emitting `mosquitto_pub -h <cerbo> -t 'R/<id>/vebus/276/Dc/0/Power' -m ''` it will result in `N/<id>/vebus/276/Dc/0/Power {"value": 13}`


But this won't work for the Hub4Mode mentioned above, so not sure what actually different between those values. Writing the Hub4Mode works via mqtt.

0 Likes 0 ·
1 Answer
elvis avatar image
elvis answered ·

@tonobo

Reading a value with publish is news to me.

Use subscribe.

as in:

mosquitto_sub -h <cerbo-IP> -p 1883 -t 'N/<VRM-ID>/settings/0/Settings/CGwacs/Hub4Mode'

If you have a recent firmware with FlashMQ it will display the value everytime the keepalive is sent (all topics are refreshed) or the value changed it will be sent. You can send the keepalive a fast as you need it but there really is no need for a rapid fire keepalive, Any value that changes is sent instantly.


In the below example since the value rarely changes its only sent because of the keepalive. Try it for something like "time since last full charge" and you will see the value is sent every 1 second.


mosquitto_sub -h <cerbo-IP> -p 1883 -t 'N/<VRM-ID>/settings/0/Settings/CGwacs/Hub4Mode'
{"value":1}
{"value":1}
{"value":1}
{"value":1}


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.

tonobo avatar image tonobo commented ·

Ah ok didn't noticed that it returned on inital keepalive without suppression params. Just used the keepalive with suppression and switched back to original keepalive on inital subscribe followed by keepalive for changed value tracking, to keep it as most efficient as possible.


I'm talking about https://github.com/victronenergy/dbus-flashmq?tab=readme-ov-file#read-requests


Which definitively works for some common values like dc power from multiplus master, but not for Hub4Mode. Maybe you can try yourself. But thanks for pointing out. I only want to discover the ESS mode in order make sure the victron system is configured correctly.

0 Likes 0 ·

Related Resources