After this post I kind of re-wrote it in another more complete post you can find here
Let me know if this answers your question otherwise I’ll try to help even though I’m definitely not an MQTT expert.
In the meantime, just for info, I’ve moved on from using MQTT to directly integrate Venus OS using modbusTP. There were two reasons: first, I’m also using modbus for the automation of my pool filters, SWC and sensors which do not offer MQTT so it made sense to consolidate onto one protocol rather than two. Secondly I simplify the whole setup by not having to run two MQTT brokers, one on the CCGX and another one on HA. I’m planning on following up on my post with this change but time is lacking.
Just let me know if you could sort it out.
Firstly thank you for your guide. I’m completely new to all this and was able to understand for the most part.
I successfully followed your guide until step 6 and everything is working fine. I even managed to add battery soc as a sensor. But the value is not translating properly.
My question is, how do I add the data from the topics successfully so I can use it in my automations?
Also, will you add instructions for modbus integration and would this be better?
How did you get things working in the Energy dashboard when using Modbus? I have all the entities working here, but I can’t add them to the Energy dashboard due to them not having uniqueIDs.
Attached a snippet of one of my modbus configuration files. I’m using unique_id as you can see. Did you try it and if yes do you get errors?
# Power and energy flows
# COO = ConsumtionOnOutput = consommation des charges
- name: Consumption On Output
unique_id: consumption_on_output
state_class: measurement
device_class: power
scan_interval: 30
slave: 100
data_type: uint16
address: 817
unit_of_measurement: 'W'
# AIP = ActiveInPower = Puissance entrée générateur
- name: Active In Power
unique_id: active_in_power
state_class: measurement
device_class: power
scan_interval: 30
slave: 100
data_type: int16
address: 823
unit_of_measurement: 'W'
Attention, these are “power” entities, you need to transform them into “energy” entities by using the “integration” integration (yes, that can be confusing).
# Intégration des entités puissance en énergie
- platform: integration
source: sensor.active_in_power
method: left
unit_prefix: k
name: Energy from Grid
The resulting “energy” entities are what you can/need to configure into your Energy Dashboard.
Have you looked into 2022.12: It does matter! - Home Assistant
The MQTT sensor configuration has changed. Did you catch that and changed your sensor configurations to the new standard?
As a rule, I always read the release notes in full especially the breaking changes part.
To share code you need to use the preformated text using the editing sign
</>
that you find at the top of your comment text editing window. That way your exact formatting comes through and you will get better advice. This bring said, your MQTT sensor configuration should look like:
# Example configuration.yaml entry
mqtt:
sensor:
- state_topic: "home/bedroom/temperature"
In your case I guess this would be (note the indentations, YAML requires strict indentations to work):
Hallo und guten Tag. Ich entschuldige mich, dass ich auf deutsch schreibe, aber da bin ich sicher, dass ich keine Fehler erkläre.
Ich habe seit 3 Wochen ein Victron System mit 1xMultiplus2, 1xCerbo GX und 2xMPPT Lader.
Ich habe es irgendwie geschafft, dass über mqtt Daten gesendet werden. Aber ich finde keine Tageswerte, wie sie im VRM gezeigt werden.
Nun habe ich gesucht und die Seite “vrm api docs.victronenergy .com/#/” gefunden.
Hier “VRM API documentation” kann ich mit der Email Adresse und dem Passwort einen Token erstellen. Egal wie ich diesen verwende, komme ich nicht weiter.
Ich wollte im nächsten Schritt hier “VRM API documentation” weiter machen.
Die Informationen von @lsgv Luis sind hervorragend geschrieben, aber ich habe den nächsten Schritt aus den Texten nicht erlesen können. Was kann ich tun?
Allgemein suche ich eine Möglichkeit, Tageswerte für Solarertrag und Verbrauch zu bekommen.
Danke fürs Lesen.
Guido
Hello Guido. My German is quite limited and rusty but I got the point.
This original post is quite old and dates from the time I did not know better and how to use Victron MQTT broker to establish a local connection rather then using VRM and be dependent on the internet connection.
Do you need to use VRM because your HA instance is not on the same network as your Victron installation? That is really the only case I can think of for using the API. If that is the case, then I’ll try to dust off my memories and help you as much as I can.
Es ist gut erkennbar, dass die MPPT Laderegler arbeiten und im eigenen Netz ein Verbrauch ist.
Am Ende des Tages ist es aber nicht möglich, die Summer der Verbräuche zu lesen.
Ich finde nur etwas von den MPPT Ladern “/solarcharger/277/History/Daily/0/Yield” als Zusammenfassung.
Mein Ziel ist es, eine Auswertung zu bekommen, die die Tages-Ergebnisse zeigt.
Ok then, you can use MQTT. To get daily results you can do the following:
If you have not done it yet, create MQTT sensor in HA for whatever power flows you need, production, consumption, etc. using MQTT Sensor - Home Assistant
You can use the same energy sensor in Utility Meter to create daily, weekly, monthly etc. sensors so you can keep historical track of your production/consumption.
Let me know if this is clear or if you need any further help.
Ich werde sehr bald daran arbeiten und testen, ob ich es kann. Auf dem ersten Blick, kann ich nicht sagen, ob ich weiter komme. Ich werde es dich wissen lassen.
Gruß Guido
ich habe die 3 Seiten gelesen und ich denke, ich verstehe was es für Arbeit bedeutet. Ich werde es jetzt noch nicht tun. Ein Freund hat mir mein System zusammen gestellt. Ich kann es mir nicht erlauben, da einen Fehler einzubauen.
Ich werde einfach am Monatsende, die Daten aus dem VRM Portal per Download nehmen und sie ablegen.
Es sind die Daten, die im Grunde das aussagen, was ich von der Anlage wissen will. Ich dachte, es ginge automatisch.
Ich danke für deine Zeit und Mühe.
Evtl. schaue ich in einiger Zeit noch erneut nach der Lösung… Dazu muss ich sicherer mit dem eigenen System sein.
Gruß Guido
Hello. This thread is quite old and for more than 3 years I’m now using local MQTT or modbus/TCP as implemented by Victron and detailed here
Unless you have a really compelling reason to use the API I do recommend you move to either the MQTT or modbus options.
Hello, yes I know. Old but still valueble for me.
My installation is remote, it’s on a Boat with cellular connection with a NAT ip address… I Use a RasPi that is connected to VRM. My Homeassstiant is running at home, and if I’m not mistaken the MQTT / modus/TCP will not work in my case.
But anyways. I got it to work.
Had to remove the UnitOfMesurment and change the value_template a bit…
Ok, good to know. I found the use of the API convenient in those cases but “cluncky” as best and prone to issues when Victron changed anything and the mappings didn’t work anymore.