sebdehne / dbus-mqtt-services

Create services on the dbus using MQTT
MIT License
9 stars 2 forks source link

Issue with creating a battery #2

Closed klandos closed 1 year ago

klandos commented 1 year ago

Hi there, I have 2 batteries which I would like to join. For this I've a little python script which calculates the values and publishes this to the topic for this service. This service seems to make this easy possible. I'm struggling a bit with which Paths are mandatory and which not. At the moment I'm sending the following json to the topic: { "service": "VirtualBat", "serviceType": "battery", "serviceInstance": 0, "dbus_data": [ { "path": "/Mgmt/ProcessName", "value": "VirtualBatBridge", "valueType": "string", "writeable": false }, { "path": "/Mgmt/ProcessVersion", "value": "1.0", "valueType": "string", "writeable": false }, { "path": "/Mgmt/Connection", "value": "MQTT", "valueType": "string", "writeable": false }, { "path": "/ProductId", "value": "0", "valueType": "integer", "writeable": false }, { "path": "/ProductName", "value": "VirtualBat service", "valueType": "string", "writeable": false }, { "path": "/FirmwareVersion", "value": "1.0", "valueType": "string", "writeable": false }, { "path": "/HardwareVersion", "value": "1.0", "valueType": "string", "writeable": false }, { "path": "/Connected", "value": "1", "valueType": "integer", "writeable": false }, { "path": "/CustomName", "value": "Virtual Bat service", "valueType": "string", "writeable": true }, { "path": "/Soc", "value": "99.95", "valueType": "float", "writeable": true }, { "path": "/TimeToGo", "value": "0", "valueType": "float", "writeable": true }, { "path": "/ConsumedAmphours", "value": "-0.9", "valueType": "float", "writeable": true }, { "path": "/Dc/0/Current", "value": "0.0", "valueType": "float", "writeable": false }, { "path": "/Dc/0/Power", "value": "0", "valueType": "float", "writeable": false }, { "path": "/Dc/0/Voltage", "value": "55.18", "valueType": "float", "writeable": false }, { "path": "/Devices/0/CustomName", "value": "VirtualBat", "valueType": "string", "writeable": false }, { "path": "/Devices/0/DeviceInstace", "value": "275", "valueType": "string", "writeable": false } ]

This ends up in a battery in the Venus OS (using a Cerbo). But without units and this device does not pop up as "battery monitor" to be used for the main screen. Here is a screenshot, Batteries are full at the moment, that's why Current / Power (see the missing units?) are 0 cerbo Any hints what values are missing?