Victron integrated with HA and EMHASS - My Single Guide

yes please!!!

https://github.com/Daddy1976/mqtt

Readme first

if there are any problems, just write

I hope that the procedure is sufficient

I’m sorry, if you find some Slovak names there, change them accordingly

files can be customized (it’s my configuration, may not suit everyone)

if something doesn’t work as expected, you need to download and check the path in state_topic and command_topic using MQTT explorer.

all necesary items can be imported into ENERGY immediately after starting and working properly

I recommend to simply use the Victron integration provided here:

It works fantastic, no hassle with manually adding devices etc plus pretty much all parameters can be modified, not only the setpoint.

To control charging, for example, there are two main parameters
select.victron_vebus_mode_X
and
number.victron_settings_ess_batterylife_minimumsoc

Hi,
I’m trying to figure out if EMHASS still fits in the system if I enable Dynamic ESS from victron: What is Dynamic ESS? | Dynamic ESS Overview [Victron Energy]

I get that it can be used to control the loads more efficiently, but I’m worried running both will interfere with one and other. So I’m wondering which would be better?

Hi. Thanks very much for this. I have all the parameters reading nicely onto Dashboards, setup automations for fans, heaters and when to run things and about to add the slider for exporting.

I’d like to add a “BOOST” button whereby I export 1 hours worth of energy to the grid or 2kWh at a certain time.

For this I will need to “set the slider” to a certain value of wattage and measure time. Ideally understanding better how the slider controls Victron would be better but I think that will take a little leap of faith on my programming skills and understanding!

Is this something you can help with or would like to do?
I’m thinking of a dashboard with button and kWh option buttons and a set time to do it.
e.g.

My system is a Multiplus II 5000 with 10.5KwH Pylontech US3000C batteries, CERBO GX 3.8KW PV.
Timed Version - Export
At 4PM (when the grid pays for export @ £1.50-£4.50) ,
IF the SOC of the battery is above 90% - Export 1KwH (this would be at 4kW for 18-20 minutes on my system since 4kw from battery gives about 3.5Kw to the grid after conversion losses.

Ad-Hoc Version
BOOST BUTTON: Export 1KwH Now - Low Power
Setpoint to -1200 for 1 hour.

BOOST BUTTON: Export 1KwH Now - Hi Power
Setpoint to -4000 for /18 minutes

Timed Version - Import
At 2AM (when the grid charges ~40% less for energy between 2am and 5am) ,
IF the SOC of the battery is below 60% - Import until SOC is 90% (this would be at 4kW for 18-20 minutes on my system since 4kw from battery gives about 3.5Kw from the grid after conversion losses.

1 Like

Hi Marek, yes please provide me the full code.
I already used MQTT for SMH & Axpert. I had to buy new batteries, so i switched from lead to litio. Therefore i also needed a new inverter. victron!

Regards
Peter, Spain

the code is here GitHub - Daddy1976/mqtt: MQTT Victron HomeAssistant
see also readme.md
in homeassistant it is necessary to add mqtt and set ip to cerbo gx
it is necessary to enable it in cerbo

I have os venus large installed

this code i have in NODE-RED

it is necessary to set the mqtt wakeup in cerbo every 30 seconds

[
    {
        "id": "4193f98e1ac08b2d",
        "type": "inject",
        "z": "eb825fdd94044cc5",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "30",
        "crontab": "",
        "once": true,
        "onceDelay": "2",
        "topic": "R/YOUR_VICTRON_ID/keepalive",
        "payload": "",
        "payloadType": "str",
        "x": 170,
        "y": 40,
        "wires": [
            [
                "abcb55e7bea05728"
            ]
        ]
    },
    {
        "id": "abcb55e7bea05728",
        "type": "mqtt out",
        "z": "eb825fdd94044cc5",
        "name": "mqtt wakeup",
        "topic": "",
        "qos": "0",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "6ee2e89363dc76a1",
        "x": 430,
        "y": 40,
        "wires": []
    },
    {
        "id": "6ee2e89363dc76a1",
        "type": "mqtt-broker",
        "name": "victron",
        "broker": "192.168.2.130",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]

change to large venus os


Super! Thank you Marek.
Instead of a Cerbo GX i have a Color Control. Does this change anything? The displays look similar.

As i do not know NodeRed i will try it with automation. It looks to me as you write/send a string of text without any meaning. Is this correct?

And how did you do the screen shots??

node-red is only to refresh mqtt every 30s. this is how i do it

automation or a script created in homeassistant can also handle it.
but this matter is beyond me

and yes the payload is empty. only the topic is sent

you download mqtt explorer. it is a great help to understand mqtt

http://venus.local or IP color control
macbook, command+shift+4
windows, windows key + shift + s

is there anything like Predbat for that is compatible with Victron Inverters?

https://springfall2008.github.io/batpred/what-does-predbat-do/

It uses solcast to decide how much to charge the batteries up to over night, depending on the sun the following day, and when the cheapest slots are on the live pricing electric tarrif (octopus agile in the UK).

Or does victron do this out the box?

I’m trying to setup your select.yaml so I can change my inverter mode. I’m able to get it to show up in MQTT, but it immediately says it’s unavailable. I’ve set my Cerbo ID correctly, and double checked all the topics. Not sure where I’m going wrong.

EDIT: Nvm figured it out. Typo on my end. Actually it looks like it’s still not working. I was able to get the selector to show the different states, and it is updating anytime I toggle the inverter from within VRM, but if I try to change it using the selector in home assistant…nothing happens.

it is necessary to check also # 276. you may have another number

pls paste here your “select.yaml code” for verify

 - select:
    state_topic: 'N/***/vebus/276/Mode'.         --- read
    command_topic: 'W/***/vebus/276/Mode'        --- write

Appreciate the reply. The solution came to me very early in the morning, and it was just a mistake on my part. I originally setup my Victron MQTT with instructions that have sense been updated. My victron.conf file was not setup to include “topic W/# out 0 victron/”

I added that line in and now everything works correctly!

My next step here is to setup a selector to change the input current limit on AC1 in 1 and AC in 2. Do you have any examples I could draw from for this? I imagine it’s similar to the yaml for changing the inverter states.

did you mean something like this?

 - number:
    state_topic: 'N/***/vebus/276/Ac/ActiveIn/CurrentLimit'
    command_topic: 'W/***/vebus/276/Ac/ActiveIn/CurrentLimit'
    name: 'Input Current Limit'
    unique_id: 'vebus/276/Ac/ActiveIn/CurrentLimit'
    min: 1
    max: 12
    step: 0.5
    mode: slider
    command_template: '{"value": {{ value }} }'
    value_template: '{{ value_json.value }}'
    device: {
         identifiers: [
          "Multiplus-II"
          ],
         manufacturer: "Victron Energy",
         model: "48/3000/35-32",
         name: "Multiplus-II"}
    entity_category: "config"

all important entities for “ess” management are in those files

if you would like to add something else that you are missing, I recommend downloading CCGX-modbus-tcp-register-list-3.00.xlsx from the victron website and mqtt explorer

and add the necessary data by editing my config

files are divided into entities:
sensor - data that is numerical, does not need to be changed or cannot be changed. if it is changed, it will not affect VenusOs, or it will revert to the original value.
number - these are numerical values that can change the operation of the victron
switch - is a switch for turning on and off the relay or charger, or other functions…
select - numeric values are converted to text for better reading of numeric status and back to numeric status for victron

It took me 2 weeks to set up entities by searching the internet. And it’s still not perfect.
The documentation on the homeassistant website is not sufficient for a beginner.
The developers should think and add the necessary examples where it would be explained that this or that can be added. And especially what he does and where she can be found ,if is this added.

cheers

I’m having connected my Victron installation over Modbus only to HA and I ask myself what the advantages are in using MQTT over Modbus only.