mr-manuel / venus-os_dbus-mqtt-grid Goto Github PK
View Code? Open in Web Editor NEWThis Venus OS driver gets the data from MQTT and displays it as grid meter.
License: MIT License
This Venus OS driver gets the data from MQTT and displays it as grid meter.
License: MIT License
Hello,
Unfortunately the 3 phases are not shown in my Victron Multiplus GX when using JSON.
Minimum required with L1, L2, L3 does not show any phases but only the main power value:
{
"grid": {
"power": 0.0,
"L1": {
"power": 0.0
},
"L2": {
"power": 0.0
},
"L3": {
"power": 0.0
}
}
}
Minimum required works as expected:
{
"grid": {
"power": 0.0
}
}
I would be happy to retrieve a message with some hints.
Thanks and all the best,
Michael
I have been successful and using your MQTT Energy Meter script.
But it is not identified as being a Grid Meter. It is instead identified, I think, as a Load Meter.
As shown in the included image. The "AC Loads" box is populated by the MQTT data, not the "AC Input" box.
The system gives me a Warning and is not able to properly work with the Dynamic ESS feature.
Is this a configuration issue. Or is the issue in the MQTT Energy Meter script.
In case the feed of grid power information stops (e.g.: Wifi trouble, whatever), the ESS would either increase battery charging / discharging to the maximum, unless the seldom case would happen that the last grid power was "perfect".
Thinking about the best solution, the monitoring of the feed should happen on the venus/GX device itself. IMHO, the best would be a timer, a boolean and 2 commands:
I've seen couple of times that the drivers seems to get stuck in initial loop setup, during venus-OS upgrade/reboot this sometimes happens and also when eg. the (external) mqtt broker has been offline for sometime due to eg. maintenance.
Log shows this:
@40000000657f677f27e831b4 *** starting dbus-mqtt-grid ***
@40000000657f67be1efd307c WARNING:root:Waiting since 60 seconds for receiving fi
rst data...
@40000000657f67fa21ec6ce4 WARNING:root:Waiting since 120 seconds for receiving first data...
@40000000657f683625390b8c WARNING:root:Waiting since 180 seconds for receiving first data...
@40000000657f687228a15824 WARNING:root:Waiting since 240 seconds for receiving first data...
and this can go on for extended time.
So I added few lines of code which seems to work rather well, probably this timeout should re-use the timeout in ini file for as a quick hack it does it job just fine. Would be nice if you could add this or something similar to this driver (BTW same applies to dbus-mqtt-pv).
+++ dbus-mqtt-grid.py
@@ -570,6 +570,11 @@
)
sleep(5)
i += 1
+ if i > 120:
+ logging.error(
+ "Driver stopped. waiting too long for first data (>600sec)"
+ )
+ sys.exit()
# formatting
def _kwh(p, v):
Now log looks like:
@40000000657f699e3693b3dc WARNING:root:Waiting since 540 seconds for receiving first data...
@40000000657f69da3a09141c WARNING:root:Waiting since 600 seconds for receiving first data...
@40000000657f69df3a5ff64c ERROR:root:Driver stopped. waiting too long for first data (>600sec)
@40000000657f69e007bb06dc *** starting dbus-mqtt-grid ***
MQTT Messages are single Phases and not complete json always, how did you get the Smart Meter running?
One message for example is:
{"Time":"2023-11-20T19:19:06","grid":{"L3":63.00}}
I have set up this enhancement to emulate a grid meter. I am sending once per second a new value to the venus os via this connection. When I also used the venus os MQTT for other communication the MQTT connection disconnected once per second for a few seconds. When I removed all the other MQTT connections and only left this one for the emulated grid meter, the disconnection did not happen anymore. There seems to be a conflict when using this MQTT connection in parallel to the other topics. I solved it for the time being by using the modbus protocoll for all the other connections i needed.
I have an usb dsmr meter in my rpi with Home Assistant. Could you give me an example how to mqtt the value's to Venusos?
Hi, I'm hoping someone can give me some help with this.
I have data going into Venus but i get an Error. Exception occurred: float division by zero
2024-03-13 09:31:54.565327500 ERROR:root:Exception occurred: float division by zero
I'm wondering if i can get an example of the config for just having 1 single meter on mains (single phase) with voltage.
thanks
Setup
Die Werte vom Zähler kommen korrekt im im Wechselrichter an.
Aktuell habe ich das Problem: Wenn keine Sonne scheint, soll der Akku genutzt werden, damit Netzbezug auf 0W geregelt wird.
Obwohl die Grundlast konstant bei 300W liegt, wird vom Victronsystem eine alternierende Leistung zwischen -300W bis 300W abgegeben.
für mich sieht es aus, als ob die Werte zu träge vom Victronsystem verarbeitet werden.
Kennt jemand das Problem?
Leider fehlt mir aktuell der Ansatz, wo ich nach Fehlern suchen kann (Logs liefern auch im Debug-Mode keine relevanten Infos)
Ich würde gerne ausschließlich, dass es mit dem Adapter zusammenhängt.
Would it be possible to simulate an EM540 for faster ESS response speed?
Hi,
I have this script running and it looks like it's working as expected. On the home screen I see Grid and AC Loads with correct values.
Once I go into the Venus Settings and scroll down to "Energy meters" it's empty. Is this a problem?
I'm now trying to combine my Venus OS with https://github.com/Telekatz/venus.dbus-hoymiles and this script has a "Setup > Power Meters" section which says "Unknown". Sounds similar to the "Enery meters" in the Venus Settings? It seem to read from com.victronenergy.acload
https://github.com/Telekatz/venus.dbus-hoymiles/blob/89568b623ee798afa108b93a317de1868b239a1f/HMpvinverter.py#L1162 ?
Do you know if venus.dbus-hoymiles
is reading it wrong or do you miss something while publishing the AC loads?
When simply sending the format {power...,"L1":{"power":x}, ...} the process crashes with this output:
2023-05-22 18:12:32.641184500 File "/data/etc/dbus-mqtt-grid/dbus-mqtt-grid.py", line 262, in _update
2023-05-22 18:12:32.641187500 self._dbusservice['/Ac/L1/Frequency'] = round(grid_L1_frequency, 2)
Obviously, this is because grid_L1_frequency is None unless transmitted. Commenting out the 3 lines for frequency of L1/L2/l3 works for me, but this is ugly.
Sorry for knowing to little about Python and internals to submit a fix - great work!
It took me a while to get it running without a broker in between because of the following things:
>D
>B
=>sensor53 r
>M 1
+1,3,s,0,9600,grid
1,77070100010800ff@1000,Bezug,kWh,energy_forward,19
1,77070100100700ff@1,Aktueller Verbrauch,W,power,16
1,77070100020800ff@1000,Einspeisung,kWh,energy_reverse,19
#
config.ini topic = SML/SENSOR
And another side note: for my installation the VRM looked strange with only transferring grid_power and not the single phases. I changed the script, so that if only grid_power is received, all the phases are calculated in the script.
After the "check if L3 and L3 -> power exists i added the following:
if grid_L1_power is None:
grid_L1_power = round(grid_power/3.0,2)
grid_L1_voltage = grid_voltage
grid_L1_current = round(grid_power/3.0/grid_L1_voltage,2)
grid_L2_power = round(grid_power/3.0,2)
grid_L2_voltage = grid_voltage
grid_L2_current = round(grid_power/3.0/grid_L2_voltage,2)
grid_L3_power = round(grid_power/3.0,2)
grid_L3_voltage = grid_voltage
grid_L3_current = round(grid_power/3.0/grid_L3_voltage,2)
I also commented the "Received JSON MQTT message...." because i receive the energy_forward, energy_reverse not at the same time as the power value.
Because of this it was also necessary to change the setting dbusservice
if grid_forward is not None:
self._dbusservice["/Ac/Energy/Forward"] = (
round(grid_forward, 2)
)
if grid_reverse is not None:
self._dbusservice["/Ac/Energy/Reverse"] = (
round(grid_reverse, 2)
)
Maybe the infos are useful for someone.
Thank you for the great script!
Hello,
I habe an old PV Inverter which is not capable to communicate with the Cerbo. It would be great to make it possible to add a possibility to send the mqqt values from the inverter to the Cerbo
JSON is: /tele/WR1/PAC: 10.0 (e.g.)
Currently I'm using to connect my tasmota smart-meter into the victron universe. As far as I understodd (at least this is how i do it currently) I run an additional service which transferes the topic from tasmota to the desired format.
It would be perfect if one could state each single topic in the config file; this would increase flexibility and reduces complexity (in the application).
Wenn ich es richtig sehe, wird das Skript beendet.
Was macht denn ein Victron System wenn man die RS485 zwischen Zähler und dem GX Gerät trennt?
Wäre es nicht sinnvoll Laden/Entladen vom Gerät zu deaktivieren?
Wenn gerade viel Strom aus der Batterie gezogen wird und dann die Verbindung abbricht, dann zieht der Multiplus schön den ganzen Akku leer, egal wie sich der Verbrauch weiter geändert hat.
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.