Homa Assistant / Victron / switches

Hi all,
so officially I am on the point of giving up :expressionless:

I managed to integrate Venus into my home assistant and I am reading current data with no problems.
In my configuration.yaml I added:

Victron modbus:

  • name: house
    host: 192.168.xxx.xxx
    type: tcp
    port: 502

However, as soon as I cut this out of configuration.yaml and insert it into a file on its own called modbus.yaml and include the line : modbus: !include modbus.yaml in the configuration.yaml, my config doesn’t pass when checked

configuration.yaml

/////

Configure a default setup of Home Assistant (frontend, api, etc)

default_config:

Themes

frontend:
themes: !include_dir_merge_named themes

Security

http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem

Unflashed SONOFF devices

sonoff:
username: “username”
password: “pass”
reload: always

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
modbus: !include modbus.yaml
sensor: !include_dir_merge_list /config/sensors/
hassio:

/////

The reason I am doing this is to try and configure option to switch the grid setpoint with a button that would be in home assistant (from 50w to 4000w with a single click)

Can anyone help me with what am I doing wrong or have any suggestion?

This is the error I am getting:
Invalid config for [modbus]: [modbus] is an invalid option for [modbus]. Check: modbus->modbus->0->modbus. (See /config/configuration.yaml, line 24).

EDIT:
Another interesting thing I saw when going through the log is the warning is sourced from HASS.IO

Log Details (ERROR)

Logger: homeassistant.components.hassio
Source: components/hassio/init.py:454
Integration: Hass.io (documentation, issues)
First occurred: 1:36:48 PM (1 occurrences)
Last logged: 1:36:48 PM

Invalid config for [modbus]: [modbus] is an invalid option for [modbus]. Check: modbus->modbus->0->modbus. (See /config/configuration.yaml, line 24).

What is the content of your modbus.yaml file?

I’m going to guess that you’ve left the modbus: header in there, where it should be removed.

# victron
modbus:
    name: house
    host: 192.168.1.50
    type: tcp
    port: 502

Only the above
I saw this link:
https://community.victronenergy.com/questions/12314/connecting-rpi-with-venusos-mqtt-to-home-assistant.html

Yup. He did.

So it’s been a while since I’ve messed with yaml, but I would guess either drop the modbus: in front of the include instruction, or remove the modbus header in the included file.

Edit: I fixed up your post a bit to help get the config snippet across :slight_smile: Tend to write quite a bit more markdown than most people, which is the language used by this particular forum software.

omg!!!

You guys opened my eyes!!!

WOW

Thank you…

My modbus.yaml is only:
name: house
host: 192.168.xx.xx
type: tcp
port: 502

Nothing more :slight_smile:

Now it works…back to put the switches

Thank you once more so very much

One more question, since I am trying to follow the instructions from the link I posted.
I created switches.yaml
and in configuration.yaml i added:
switches: !include switches.yaml

…and as expected it is not working (emoji smacking it self in the head) :slight_smile:

Please help me with what am I doing wrong, or what is it that I need to do

EDIT:

I can only see that # Charger
- name: Charger
hub: house
slave: 100
register: 2700
command_on: 4000
command_off: 80
verify_state: false

command_on and I presume command_off are not valid instructions?

I have no experience with modbus switches, sorry.
Maybe @ebendl or @plonkster can assist.

I managed…I am very persistent (read stubborn) person :slight_smile:

So it is all about the details and spelling…
switches vs switch, etc…errors encountered can lead you to the solution

It is easy but it is for people that have attention to detail

Thanks people!!!

Yaml is very sensitive , any mistake even spaces make you pay and if you dont know were to start it is quite a challenge. Personally I use Visual Studio Code to edit the files , at least it helps a bit to debug if need be.

1 Like