cereal2nd / velbus-aio

Velbus Asyncio
Apache License 2.0
15 stars 11 forks source link

Velbus in Home Assistant not detecting all modules #118

Closed Bernd-97 closed 1 week ago

Bernd-97 commented 3 months ago

Hi guys

I have used OpenHAB to tweak my Velbus setup for a few years on an Raspberry Pi 4b, but recently decided to jump on the HA train. I bought a HA Yellow, installed it, pretty neat software, detects a whole lot of stuff in my house (Musiccast, Samsung TV, Doorbird, ...)

When I added the Velbus device, I noticed that the hub only detects 24 of the 39 modules. Looking around I found that the last "found" address is decimal 70. The ones not found are :

FYI, all the modules that aren't found are in a 3rd cabinet. The modules in the first and second cabinet are all found. OpenHAB on my Rpi never had any problems with that.

Any ideas if there is anything I can do? I tried to reload the hub a few times, doesn't help. I'd rather not change the addresses, as it's easier for me to find the correct module.

Kind regards Bernd

cereal2nd commented 2 months ago

can you enable the debug loggin on the velbus integration? then reload it and attach it to this ticket?

Bernd-97 commented 2 months ago

Sure thing, here goes (added the json also, just in case)

home-assistant_velbus_2024-08-25T13-42-33.336Z.log config_entry-velbus-01J4VC8MG5DWCG406H5TCV40XN.json

c-soete commented 1 month ago

@Bernd-97 I'm having the exact same issue. I've already mentioned it in the Velbus forums here:

https://forum.velbus.eu/t/velbus-home-assistant-missing-module-instances/17402/19

Have you found a fix for this or should I downgrade?

cereal2nd commented 1 month ago

serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial/by-id/usb-Velleman_Projects_VMB1USB_Velbus_USB_interface-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Velleman_Projects_VMB1USB_Velbus_USB_interface-if00'

does this file exsists on your system? if not your integration is wrongly configured

can you also have a look at the cache directory? its in the same location as the homeassistant config file, a subdir here .storages and then the velbuscache directroy

Bernd-97 commented 1 month ago

@c-soete No not yet, but I don't find much time to try and fix it

@Cereal2nd I do have that file, took a screenshot with the VS Code add-on. And I can actually control the items, with realtime update, so the USB interface does work. usb

But I can't seem to find that velbuscache. Where exactly can I find that?

Extra update: I changed one of the addresses (201) to number 60, which is in the range of modules that the binding did find (I have a number 61,62,63 and 70 which are detected), and reloaded the binding. Didn't help, still only 24 modules found.

cereal2nd commented 1 month ago

fo the address changes the velbuscache needs to be cleared.

either do this via the HA service page or do this via the filesystem (while ha is stopped)

cereal2nd commented 1 month ago

i could really use some help here, there are mistakes in the protocol definition file:

https://github.com/Cereal2nd/velbus-aio/blob/master/velbusaio/protocol.json

if you could have a look thats everything is correct for your modules we may be able to solve it. This is the biggest pain in velbus, the protocol definitions are only availabel in pdf, so we need to extract the needed info for each module into this file, once its in there in 99% of the cases the modules will just work in HA.

c-soete commented 1 month ago

Does this also apply to me, because I want to help as well.

Where can I find the protocol definition for each one of my modules in my system?

cereal2nd commented 1 month ago

every little item that gets added would be helpfull

https://github.com/velbus/moduleprotocol

Bernd-97 commented 3 weeks ago

I honestly don't know what magic happened, but it works All the modules are added and entities can be controlled. I had some help from a friend, we found the Velbus cache, removed it, reloaded the Velbus integration. We changed some addresses (201 to 205 -> 31 to 35) for testing. That got added and I could control them, then I changed them back, did the cache-removing, reloading again. And so it works 🤷

I do think that the integration takes a really long time (in the background) to actually process everything. Here's the json with all the addresses (as they were when all the trouble started) config_entry-velbus-01J4VC8MG5DWCG406H5TCV40XN.json

c-soete commented 3 weeks ago

@Bernd-97 It also magically worked for me as well. I think our issue might has something to do with the long scanning time of the modules as I mentioned here:

https://forum.velbus.eu/t/velbus-home-assistant-missing-module-instances/17402/34

Did you also reload while the integration was already scanning in the background because I think that was what caused my issue?

Bernd-97 commented 2 weeks ago

I too think that's the reason. We don't have enough patience. Didn't see that post you mentioned.

I added a module (VMBIN) this week, but haven't rescanned yet with HA. I plan on doing that next week, will give an update here!

Bernd-97 commented 1 week ago

I deleted the Velbus cache, did a full reboot (so not a restart) When it was back up, I checked the Velbuscache-folder, and saw that everything was there I added the file, you can see that it takes quite some time for everything to get scanned velbuscache nr 1 got added 09.03, nr 250 09.14, so that's 11 minutes for me

Anyway, everything seems to be okay for now 😄

cereal2nd commented 1 week ago

yeah the initial load is really slow, but this is part of the velbus system, nothing much i can do at this moment. But i requested some addons in the velbus protocol to optimize this, not sure if they will be implemented.