I’m currently starting with home assistant. In my home I have a Velbus installation with quite some modules and panels. I have a raspberry pi 5 running HA OS hooked up to my system. After installing the Velbus integration and doing a scan over USB, the system always finds a few modules. However, the number of modules found seems to be different in every scan. One time I find 20, another time 31, even 60 ones. But never does it discover the entire system…
With the VelbusLink software, I never have issues scanning the network. I’m using the Velbus system a few weeks full-time now and don’t notice any poot Quality CAN communications either. It’s always responding fast and working great.
What could be the issue here? I tried: 3 different USB cables, different USB ports on my pi, reloading my configuration using VelbusLink, restarting HA and the integration multiple times,… What else can I try?
I’m not a HA user, but I do read all the posts and try to keep a good idea of how it works, so I can I support people.
The original / first time HA scans your Velbus network, it can take ages to fully read the bus.
My advice you be
Setup a TCP gateway for the Velbus USB device, so that every bit of software can connect via TCP, instead of swapping the USB cable each time you do anything.
This is something I can try, but is it possible to run this server on home assistant os? So I don’t need additional hardware?
How is this different from te approach of directly using the USB serial interfaces in the Velbus integration? Another way of scanning for the devices?
I was wondering: would it be possible to manually add each module (without having to scan for it) based on the CAN address and the type of module? In the meantime, I’ve tried openHAB to see if I could find all modules there, however there my problem is that the Vmb8dc module is not yet implemented.
I have another similar setup (other house) with a few less modules, there the configuration went flawless. Alle modules were immediately Found. There Is used as Raspberry Pi 4. Therefore I tried with this Pi on the new installation but I’m facing te same issue.
VMB8DC-20 is implemented in OH, but for the upcoming v5 release.
If you wish, you can use the package I compiled for v4.3.x with the same updates I implemented for v5.
In the other setup I Also use Home assistant but the issue is not there.
So now I think I managed to get the VelServ complied and Running on the home assistant os. I had some issues installing gcc but it seemed I had to use apk add instead of apt-get.
However, if I now run
./velserv -d /dev/ttyACM0 -p 6000
I get no error or whatsoever.
I assume it is Running as I get a result when I try pidof velserv
However, if I try to setup TCP in the Velbus integration using 127.0.0.1 and port 6000, it tells me I can’t connect.
Doing the same in VelbusLink Also won’t work.
I’m confident that the USB port is the correct one
when I was configuring the same for the Velbus integration, I could find some modules…
when I’m starting the VelServ and try to configure the Velbus integration again with USB, no entities are found, which I think makes sense as it is occupied by VelServ.
I have only 1 USB device connected to my pi. Home assistant is also recognizing that it is velbus
Maybe I should use a different IP? Could the issue be I’m using the localhost but the integration runs in a docker container? Does that make it not local?
First scan of velbus integration, is always a bit tricky, and indeed … it needs a lot off time. Work is ongoing to avoid the scan and upload the velbuslink project file instead (already announced in another thread). Hopefully available in next release …
Meanwhile, some suggestions:
It’s absolutely a good idea to install velserv. It enables simultaneous connection to velbus for velbuslink and HA integration (velbus-aio). VelbusLink is not only a great logging tool, you will also be able to monitor in real time the HA scan. (just open your project in velbuslink and connect to the bus without scanning, then start new scan in HA and you will see turning the status of your modules to ok one by one)
Do the scan when there is low activity on the bus
You mention random missing some modules. This might be caused by some coincidental higher activity on the bus (you can trace this with velbuslink once you have installed velserv). I know this is (and should not) be common use, but with some manual work you can easily merge the results of different scans and even add some modules manually.
Steps to manually merge scans:
locate the velbus cache on your PI (it should be in a directory .velbuscache, but depends on your os)
In the cache you will find files named address.json for each detected module (e.g when you have modules with addresses 10, 205 there should be the files 10.json and 205.json)
After an (incomplete) scan, move the json files to a backup folder and relaunch the scan with an empty cache.
Repeat previous step until you have all modules detected once
Finally merge all json files from the backup(s) in the velbuscache and restart the automation (don’t scan again, and keep a backup of your cache so you have to go through this pain just once!)
Alternative to repeating scans you can check if you got another detected module of the same type. If you do: clone the file of the detected module to the missing module (don’t bother editing the file, the cloned file will only serve for discovery and content will be updated on next restart of velbusintegration)
Hope this helps a bit … while waiting for final solution with project file …
It looks like the server is running. But when I try to connect to the Pi’s IP on port 6000 in VelbusLink, nothing seems to happen. Also no error or whatsoever.
It seems it’s not being so random. Last scans always show same result. The detection with the module on address 11 as last one.
I’ve tried adding the address.json files for all my modules manually by copying and editing the files. Adding them all at once didn’t seem to do the trick. But when I was adding 1 by 1, each time reloading the the integration, I could find 3 that weren’t working. I’ve left them out and could add the rest. However, the controls do show up in home-assistant and it looks like I would be able to use them. But if I try to control a relay I’ve added for example, nothing happens.
One weird thing that came to my attention: Shortly after trying to enable a manually added relay from home assistant, controlling my lights with my velbus switches on the wall suddenly seemed to lag for a a moment. Suddenly the lights went on and the lag was gone.
So still no luck in the attempt to get it all working today…
It seems it’s not being so random …
It looks like there is a problem with the module on address 11. When an unexpected error occurs in the scan code, the scan is aborted. With current code the scan is never restarted until all cache files are removed (already fixed in code, but not yet released). What is the type off the module? A log would also be nice once you got velserv fixed
Adding them all at once didn’t seem to do the trick. But when I was adding 1 by 1 …
Seems odd, adding them all at once should work fine …
However, the controls do show up in home-assistant and it looks like I would be able to use them. But if I try to control a relay …
If you have no json files for the modules the modules will not be bound. The controls you see in HA are most likely created on a previous scan. HA caches also a lot off things. Check there state.
Shortly after trying to enable a manually added relay from home assistant, controlling my lights with my velbus switches on the wall suddenly seemed to lag …
HA assistant scans can stress the canBus (opposed to velbuslink a HA scan is in fact a scan + synchronise module). I never experienced a lag on velbus actions but it does not seem impossible. That is why I suggest to do the scan in a low activity period.
From your input I am guessing module 11 is your main problem. Did you try to temporary remove module 11 (just disconnect velbus power from the module) and do a clean scan. Module 11 will not be detected but scan should continue. Again … I am just guessing without log …
About velserv … you can start velserv interactive with some logging / debug switches. Might help for diagnostics … but you probably know that.
I noticed that you are trying to run velserv on HAOS. Are you sure this is possible? Lot of things are blocked in HAOS.
I never managed to get it working but that might be my lack off knowledge on linux. I finally switched to docker (on PI4) … and love it since.