article

sebdehne avatar image
sebdehne posted

dbus-mqtt-services - create dbus service from mqtt messages (+ a battery service for multiple Daly BMSes)

I wrote a small driver called dbus-mqtt-services (https://github.com/sebdehne/dbus-mqtt-services) which listens on a special MQTT topic and creates new services on the dbus as instructed in the MQTT-message.

This allows you to create whatever service you desire on the dbus without having to install/run any code/driver on the VenusOS device. Just publish the desired service data onto this special MQTT topic and the service is being created (multiple services are supported). Subsequent MQTT message just updates all values.


I used this driver to bring my own battery-service on the dbus - which supports multiple Daly BMSes and reports all the data as as single battery to the Victron system. Se victron_daly_bms_service (https://github.com/sebdehne/victron_daly_bms_service)

So, instead of doing this:


screenshot-2022-12-05-at-174806.png

This driver allows something like this (or any other type of service):

screenshot-2022-12-05-at-175213.png


The code is a bit raw and not very polished yet (I just made it all work), but feedback is very welcome.


screenshot-2022-12-05-at-154216.png

screenshot-2022-12-05-at-154225.png

screenshot-2022-12-05-at-154357.png

screenshot-2022-12-05-at-154414.png


Venus OSBMSMQTTvictron community
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.

mtucker502 avatar image mtucker502 commented ·

This looks pretty cool. There is already a similar project from freakent which does the same. Are there any advantages to using your driver over freakents?


https://github.com/freakent/dbus-mqtt-devices

1 Like 1 ·
zonnigbreda avatar image zonnigbreda commented ·

Thanks for your script!

I made a 'companion script' for it... It takes a json message and maps it to the format your dbus-mqtt-services script needs

https://github.com/marcelrv/victron-dbus-mqttmapper

0 Likes 0 ·

Article

Contributors

sebdehne contributed to this article