Victron Venus OS with MQTT sensors, switches and numbers

Hi,

we can also use a input_select on home assistant to configure the multiplus configuration

On the mqtt topic venus-home/W/xxx/vebus/276/Mode it’s can have 4 values :

  • 0 == Off
  • 1 == Charge Only
  • 2 == Inverter only
  • 3 == On

So i create this configuration :

select:
  - name: Multiplus Interrupteur
    unique_id: victron_Multiplus Interrupteur
    object_id: victron_Multiplus Interrupteur
    name: "Multiplus Mode"
    options:
      - "Off"
      - Chargeur uniquement
      - Convertisseur uniquement
      - "On"
    state_topic: "venus-home/N/xxxx/vebus/276/Mode"
    value_template: >
      {% if value_json.value == 0 %}
        Off
      {% elif value_json.value == 1 %}
        Charge Only
      {% elif value_json.value == 2 %}
        Inverter only
      {% elif value_json.value == 3 %}
        On
      {% endif %}
    command_topic: "venus-home/W/xxxx/vebus/276/Mode"
    command_template: >
      {% set value_map = {
            "Off": 0,
            "Charge Only": 1,
            "Inverter only": 2,
            "On": 3,
          }
      %}
      { "value": {{ value_map[value] }}}
    device: {
      identifiers: [
        "Victron Cerbo GX"
      ],
      manufacturer: "Victron Energy",
      model: "Cerbo GX",
      name: "Cerbo GX"}

The result :

Capture d’écran du 2024-05-23 13-28-38

Regards

I have a EV charger, and decided to integrate it using this topic.
Below is the start for some basics, I’ll map out the rest later.

For now, 1 switch for charging and 1 select for the mode, and 1 sensor if the car is connected

Selects:

select:
  - name: "Ev charger Mode"
    unique_id: victron_ev charger
    object_id: victron_ev charger
    options:
      - Auto
      - Manual
      - Scheduled charge
    state_topic: "victron/N/xxx/evcharger/40/Mode"
    value_template: >
      {% if value_json.value == 0 %}
        Manual
      {% elif value_json.value == 1 %}
        Auto
      {% elif value_json.value == 2 %}
        Scheduled charge
      {% endif %}
    command_topic: "victron/W/xxx/evcharger/40/Mode"
    command_template: >
      {% set value_map = {
            "Manual": 0,
            "Auto": 1,
            "Scheduled charge": 2,
          }
      %}
      { "value": {{ value_map[value] }}}
    device:
      {
        identifiers: ["Victron Cerbo GX"],
        manufacturer: "Victron Energy",
        model: "Cerbo GX",
        name: "Cerbo GX",
      }

Sensors:

sensor: 
  - name: Ev charger connected
    unique_id: victron_ev charger connected
    object_id: victron_ev charger connected
    name: "Ev charger connected"
    state_topic: "victron/N/xxx/evcharger/40/Connected"
    value_template: >
      {% if value_json.value == 0 %}
        No
      {% elif value_json.value == 1 %}
        Yes
      {% else %}
        Error - No Data
      {% endif %}
    device: {
      identifiers: [
        "Victron Cerbo GX"
      ],
      manufacturer: "Victron Energy",
      model: "Cerbo GX",
      name: "Cerbo GX"}
  - name: "Ev charger current"
    unique_id: victron_ev charger current
    object_id: victron_ev charger current
    state_class: measurement
    device_class: current
    unit_of_measurement: A
    icon: mdi:current-dc
    state_topic: "victron/N/xxx/evcharger/40/Current"
    value_template: "{{ value_json.value | round(2) }}"
    device: {
      identifiers: [
        "Victron Cerbo GX"
      ],
      manufacturer: "Victron Energy",
      model: "Cerbo GX",
      name: "Cerbo GX"}
  - name: "Ev charger max current"
    unique_id: victron_ev charger max current
    object_id: victron_ev charger max current
    state_class: measurement
    device_class: current
    unit_of_measurement: A
    icon: mdi:current-dc
    state_topic: "victron/N/c0619ab33324/evcharger/40/MaxCurrent"
    value_template: "{{ value_json.value | round(2) }}"
    device:
      {
        identifiers: ["Victron Cerbo GX"],
        manufacturer: "Victron Energy",
        model: "Cerbo GX",
        name: "Cerbo GX",
      }

switch:

  - name: "Ev charger charge"
    unique_id: victron_ev charger charge
    object_id: victron_ev charger charge
    command_topic: "victron/W/xxx/evcharger/40/StartStop"
    payload_on: '{"value": 1}'
    payload_off: '{"value": 0}'
    state_topic: "victron/N/xxx/evcharger/40/StartStop"
    value_template: "{{ value_json.value | int }}"
    state_on: "1"
    state_off: "0"
    device:
      {
        identifiers: ["Victron Cerbo GX"],
        manufacturer: "Victron Energy",
        model: "Cerbo GX",
        name: "Cerbo GX",
      }

Number

number:
  - name: "Ev charger set current"
    unique_id: victron_ev charger set current
    object_id: victron_ev charger set current
    device_class: current
    unit_of_measurement: A
    icon: mdi:current-dc
    min: 6
    max: 32
    step: 1
    mode: box
    state_topic: "victron/N/xxx/evcharger/40/SetCurrent"
    command_topic: "victron/W/xxx/evcharger/40/SetCurrent"
    command_template: '{"value": {{ value }} }'
    value_template: "{{ value_json.value | round(2) }}"
    device: {
      identifiers: [
        "Victron Cerbo GX"
      ],
      manufacturer: "Victron Energy",
      model: "Cerbo GX",
      name: "Cerbo GX"}
    
1 Like

First of all the integration seems to work fine.
I do see a slight difference in the HA data compared to the Victron data.

E.g in the time-frame 9.00 - 10.00 Victron reports 2.99 Kwh and HA reports 2.87Kwh.

Could this be related to the refresh-rate that sensor has?

Has anyone got a goog working implementation to limit the max battery charging to a longer battery life? For example setting it to a maximum of 80% SoC?

I’ve set up automations to do exactly this, by adjusting the grid set point dynamically. In my system the grid set point topic is here:

/settings/0/Settings/CGwacs/AcPowerSetPoint
1 Like

Can you go a bit more into that? Im not sure If i understood properly how that Limits tha maximum soc of the battery.

The way it worked when controlled just by my Cerbo GX was that the ESS SoC would cycle between the lower limit (controllable) and 100% (not controllable). Grid export would only commence when SOC was approaching 100%.

I have a bunch of automations and sensors which forecast what my energy balance is likely to be in the forthcoming hours. This is based on factors such as ESS SoC, heat pump demand, forecast solar and temperature change, time of year, time of day, EV charging etc. I also have a relatively generous export tariff and a big battery bank. So it’s nice to be able to take control of export when there is plenty of surplus energy, and also avoid leaving the battery bank at 100% for long periods of time in the summer.

I have an automation which dynamically adjusts the AC grid set point throughout the day based on all of this. So if my surplus energy balance is above a certain threshold (i.e I have too much spare) the grid set point becomes progressively more negative, until it is at it’s most negative value, as allowed by my electricity company. I can therefore start pushing back to the grid much earlier in the day (at a time of my choosing) than would be possible if waiting for the Cerbo GX export to kick in at an ESS SoC of 100% (typically mid afternoon). On my current contract I charge overnight to 90% in the summer, regardless of the next day’s forecasts, and then slowly push back what is not needed over the course of the next day. Once a month I have built in an option to charge overnight to 100% and hold for a few hours for balancing.

So in answer to your question, the upper limit for ESS SoC is controlled indirectly.

1 Like

Hi, Is it possible to send my PV production via Mqtt to Victron Venus OS? I want to get the complete charts and I think I also need it for Dess?