mr-manuel / venus-os_dbus-mqtt-battery Goto Github PK
View Code? Open in Web Editor NEWThis Venus OS driver gets the data from MQTT and displays it as battery.
License: MIT License
This Venus OS driver gets the data from MQTT and displays it as battery.
License: MIT License
I've ran the install.sh - but the driver won't start.
When i run
root@einstein:~# svstat /service/dbus-mqtt-battery
then i get
/service/dbus-mqtt-battery: up (pid 2413) 1 seconds
Log is empty, even with INFO or DEBUG set
But when i run
python /data/etc/dbus-mqtt-battery/dbus-mqtt-battery.py
then it is starting and running.
Did i made something wrong?
Here is the Logs i found.
If I understand right, the driver did not recive any MQTT Updates.
He tried to auto-restart at 09:14 which failed.
My manual restart at 09:53 succeded.
2023-03-29 09:10:32.975302500 ERROR:root:Driver stopped. Timeout of 60 seconds exceeded, since no new MQTT message was received in this time.
2023-03-29 09:10:33.085773500 *** starting dbus-mqtt-battery ***
2023-03-29 09:14:04.473393500 Traceback (most recent call last):
2023-03-29 09:14:04.473397500 File "/data/etc/dbus-mqtt-battery/dbus-mqtt-battery.py", line 381, in _update
2023-03-29 09:14:04.473401500 self._dbusservice[setting] = data['value']
2023-03-29 09:14:04.473404500 File "/data/etc/dbus-mqtt-battery/ext/velib_python/vedbus.py", line 157, in __setitem__
2023-03-29 09:14:04.473408500 self._dbusobjects[path].local_set_value(newvalue)
2023-03-29 09:14:04.473411500 File "/data/etc/dbus-mqtt-battery/ext/velib_python/vedbus.py", line 499, in local_set_value
2023-03-29 09:14:04.473488500 changes = self._local_set_value(newvalue)
2023-03-29 09:14:04.473492500 File "/data/etc/dbus-mqtt-battery/ext/velib_python/vedbus.py", line 510, in _local_set_value
2023-03-29 09:14:04.473496500 'Text': self.GetText()
2023-03-29 09:14:04.473498500 File "/data/etc/dbus-mqtt-battery/ext/velib_python/vedbus.py", line 589, in GetText
2023-03-29 09:14:04.473502500 return self._gettextcallback(self.__dbus_object_path__, self._value)
2023-03-29 09:14:04.473530500 File "/data/etc/dbus-mqtt-battery/dbus-mqtt-battery.py", line 64, in <lambda>
2023-03-29 09:14:04.473534500 _a = lambda p, v: (str("%.2f" % v) + 'A')
2023-03-29 09:14:04.473537500 TypeError: must be real number, not dict
2023-03-29 09:53:46.758113500 *** starting dbus-mqtt-battery ***
Issue #2
When drivers is working we get the cells that are populated in the MQTT, but all of the fields that should be calculated automatically are not:
I must be missing something... Hint please?
Hi again :)
I thought it would be nice to be able to set the battery to offline mode when there are no messages to the mqtt broker or certain battery topic.
Online/offline management could be dealt with separately, e.g. via Nodered flow - no new messages for 1 minute - send offline flag.
I tested NrOfModulesOnline but it doesn't seem to work like that. On Devices page still is connected.
Hi Manuel
It's me again. I managed to publish the necessary data via Node-Red to the topic: enphase/battery.
The payload like this:
{ "Dc": { "Power": 1435.7, "Voltage": 53.77, "Current": 26.7, "Temperature": 25.6 }, "InstalledCapacity": 1400, "ConsumedAmphours": -116.9, "Capacity": 1283.1, "Soc": 95.9, "TimeToGo": 0, "Balancing": 0, "Info": { "MaxChargeVoltage": 55.3, "MaxChargeCurrent": 191.25, "MaxDischargeCurrent": 425 }, "History": { "ChargeCycles": 46, "MinimumVoltage": 34.43, "MaximumVoltage": 58.77, "TotalAhDrawn": -60169.2 }, "System": { "MinVoltageCellId": "P4_Z1", "MinCellVoltage": 3.358, "MaxVoltageCellId": "P1_Z10", "MaxCellVoltage": 3.362, "NrOfModulesOnline": 5, "NrOfModulesOffline": 0, "NrOfModulesBlockingCharge": 0, "NrOfModulesBlockingDischarge": 0 }, "Io": { "AllowToCharge": 1, "AllowToDischarge": 1, "AllowToBalance": 1 } }
I can see the topic and payload in the MQTT-Explorer.
But it looks like that the driver is not taking the data.
2023-04-06 08:23:48.131732500 INFO:root:Waiting 5 seconds for receiving first data... 2023-04-06 08:23:53.137292500 INFO:root:Waiting 5 seconds for receiving first data... 2023-04-06 08:23:58.142865500 INFO:root:Waiting 5 seconds for receiving first data... 2023-04-06 08:24:03.148426500 INFO:root:Waiting 5 seconds for receiving first data... 2023-04-06 08:24:08.150479500 INFO:root:Waiting 5 seconds for receiving first data... 2023-04-06 08:24:13.156049500 INFO:root:Waiting 5 seconds for receiving first data... 2023-04-06 08:24:18.160483500 INFO:root:Waiting 5 seconds for receiving first data... 2023-04-06 08:24:23.166044500 INFO:root:Waiting 5 seconds for receiving first data... 2023-04-06 08:24:28.171617500 INFO:root:Waiting 5 seconds for receiving first data... 2023-04-06 08:24:33.177186500 INFO:root:Waiting 5 seconds for receiving first data... 2023-04-06 08:24:38.182762500 INFO:root:Waiting 5 seconds for receiving first data... 2023-04-06 08:24:43.188347500 WARNING:root:Waiting since 1380 seconds for receiving first data...
What can I do?
Best regards
Harald
The example in the config.ini is lowercase
{ "dc": { "power": 321.6, "voltage": 52.6 }, "soc": 63 }
The resulting warning is mixed-Case
{"Dc":{"Power":321.6,"Voltage":52.7},"Soc":63}
Sending the first JSON to the topic throws a warning (:Received JSON doesn't contain minimum required values), the second shows this in the logs
*** starting dbus-mqtt-battery ***
What am I doing wrong? Did I unserstand correctly that this driver needs one single topic with this JSON-Value?
I also tried seperate topics with this hirarchy, but did not work either.
Thank you a lot for this driver!
The "minimal required JSON payload"
is not enough to set an MPPT in "network/BMS controlled mode".
I suggest to add a line in the config for
"minimal required JSON payload to allow BMS controlled MPPT".
I currently did not figure out what I needed to add, but I will try to test and find out.
If someone or you (@mr-manuel ) know what is additionally necessary, I would help me a lot.
Is there a way to integrate data from a battery based on MQTT Battery together with batteries based on Serial Battery in Aggregate Battery?
I have a lot of Devices, and Amps are formated to 1 for (almost) all devices.
This driver has 2, so reading and comparing several Devices in the HX-Console is a (little!) bit harder.
Can you format this with 1f or can this be part of the config.ini?
If you prefer, I can also change the code only in my installation, but this will brake default updates.
Hi mr-manuel.
First of all I'd like to send you very big thanks for this feature. This is what I looking for very long time!
I'd like to asking you about new feature such as displaying all cell voltages in details tab.
I've got my custom battery with custom BMS and I can send all cell voltages to MQTT broker. It will be very nice to see these all voltages in Victron. It would also be useful to display delta voltage value.
I can also confirm that it works correctly on CerboGX.
Hi,
I found this repo through your link in a dbus-serial-battery issue and was wondering, if I could use them together.
Basically I want to limit the Charge/Discharge Current based on the time of day. My problem is the noise my three Multiplus 2s create when turning on the fans, and since my bedroom is located next to them, preventing the fans to turn on during my sleep would be nice.
However, (atm) I only want to change the Charge and Discharge Current through Node-Red and let the other logic reside in dbus-serial-battery. Is this possible?
This also leads to my next question: Currently I have the Multiplus as my Battery Monitor selected. However dbus-serial-battery still imposes its parameters. Who is actually in charge of the limits?
Thanks in advance, Jan
@mr-manuel after couple of long night (5am) I finally manage to get my batteries shown on venus OS!
Thank you for the great repository!
I double checked every cell data and all comes true!
On the way I experienced many problems with my implementation (it was me not you... LOL), but few issues were persistent and i could not resolve, thus the title.
Please help with these:
Issue 1:
When RPI is restarted, it losses the drivers and I have to manually run bash install.sh
for each of the 4 drivers
Not sure what to do here... Any suggestions?
Can you please clarify, what the difference between
"config.default.ini" and "config.sample.ini" and "config.ini" is?
In the Releasenote you wrote "config.default.ini" (see footer ), but the file I find
"config.sample.ini.
As I understand is "config.ini" MY configfile where i can change defaults from "config.default.ini".
Is "config.default.ini" still used as you wrote:
Copy or rename the config.sample.ini to config.ini in the dbus-mqtt-battery folder and change it as you need it.
Thank you!!
Footer
v0.1.0
Added: Set logging level in config.default.ini
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.