Velbus Home Assistant missing module instances

Forked and ready for code review :wink:

1 Like

send me a pull-request :slight_smile:

Pull request created

Desperate need help to activate fork of https://github.com/Cereal2nd/velbus-aio in Home Assistant.

Because Cereal is fully occupied I created a fork https://github.com/sidlgor/velbus-aio which solves the scan problem on systems with many modules https://github.com/Cereal2nd/velbus-aio/issues/90.
The code is tested on my own velbus system with 77 modules and loads smooth in about half a minute without overloading the canBus.

So far all good, but the test code still runs in a virtual python environment with Visual Code and uses the cereal example load_modules(). This is perfect for testing because it runs completely independent of Home Assistant. However now is the time to activate the forked integration into Home Assistant but I cannot figure out how to do it. I tried:

  • copying the velbusio integration tree under hass/custom_components but the integration is not loaded and there seems to be nothing in the logs
  • load the custum integrations with HACS but structure seems to be not HACS compliant
  • PIP INSTALL from local files, PYPI, my git fork … all failed
  • installed standard Velbus integration with to hope to be able to overwrite new py files but didn’t find the files (I guess a binary build is made ?)

Velbus seems integrated in HAS (no custom integration or HACS integration). Should I use another way to install the fork? Please, any help, hint, reading much appreciated !

fyi: I am running Home Assistant Docker with HACS + Velserv + Velbus PI hat + Luxtronix, Huawai, … on a PI4

Still many thanks to cereal for putting me on the right dev track with load_modules. Hopefully we can move this fork back to the master when there is more time available

Problem solved, fork moved into master and deleted

1 Like

Hello @lgor and @cereal ,

How did you solve this issue? I’m currently running Home Assistant Container on a Raspberry Pi 3B using the (Raspberry Pi Lite) OS. I’m using docker compose with the ha-compose.yml file provided.

On the same RPi I’ve also installed the velbus-tcp snap package so that I connect to my Velbus installation using TCP/IP through either VelbusLink or Home Assistant. Connection through VelbusLink works flawless as I can scan, find and operate all my modules. However, when I add the Velbus integration on HA via the TCP/IP connection, only 11 of my devices are found. Thus, I’m missing a lot of modules, such as my relais and my roller shutter modules.

I’ve already tried reloading the velbus hub through the HA dashboard and I’ve also tried using the “velbus.clear_cache” and “velbus.scan” actions through HA scripts. Nothing seems to add these missing modules, so if anybody has a clue on what to do next, that’d be much appreciated!

(I’m also tagging @MDAR as he is heavily involved in the velbus tcp snap package)
ha-compose.log (375 Bytes)

It would help if you can list the module types that you’re missing.

The attached image shows all addresses (hexadecimal) and types of the modules I find using VelbusLink.
image

In HA I now manage to find 14 module, primarely touch panels:

1 Like

@cereal, there also seems to be something wrong with the names of my modules.
The last loaded module has each character of its name as a key-value dictionary pair. This is actually seen in the picture of my previous post (the HA device overview). I’ve also supplemented my HA Velbus config file which contains the same naming error:
config_entry-velbus.log (80.4 KB)
Could this phenomenon be caused by a second instance of Velbus (probably my USB connection)?


I have also tried to remotely load my modules using velbus-aio 2024.7.6 (connection string: harpi.local:27015) and this is the output:

c:/Users/colin/Desktop/velbus-test/.venv/Scripts/python.exe c:/Users/colin/Desktop/velbus-test/load_modules.py
DEBUG:asyncio:Using proactor: IocpProactor
INFO:velbus-protocol:Connection established to Velbus
DEBUG:velbus-protocol:Starting Velbus write message from send queue
DEBUG:velbus-protocol:Acquiring write lock
INFO:velbus-handler:No cache yet, so forcing a bus scan
INFO:velbus-handler:Start module scan
INFO:velbus-handler:Starting handling scan 1
INFO:velbus-handler:Starting scan 1
ERROR:velbus-protocol:Velbus connection lost: ConnectionResetError(22, 'The specified network name is no longer available', None, 64, None)
DEBUG:velbus:Reconnecting to transport
INFO:velbus-handler:Scan module 1 failed: not present or unavailable
INFO:velbus-handler:Starting handling scan 2
INFO:velbus-handler:Starting scan 2
INFO:velbus-protocol:Connection established to Velbus
INFO:velbus-handler:No cache yet, so forcing a bus scan
INFO:velbus-handler:Start module scan
INFO:velbus-handler:Starting handling scan 3
INFO:velbus-handler:Starting scan 3
INFO:velbus-handler:Scan module 2 failed: not present or unavailable
INFO:velbus-handler:Starting handling scan 4
INFO:velbus-handler:Starting scan 4

Before I updated to the latest version of Home Assistant Container (current version: 2024.8.2 with Python version 3.12.4) and velbus-aio (current version: 2024.7.6) everything worked flawlessly, so I’m not sure what to do next.

ERROR:velbus-protocol:Velbus connection lost: ConnectionResetError(22, 'The specified network name is no longer available', None, 64, None)

This clearly gives the impression that there is a network problem between hass and the bus.
Can you provide me a diagnostics dump?

1 Like

The diagnostics dump was already provided in my last post as a log file (config_entry-velbus.log) or should I provide some other diagnostics?

there is not much to go on.

so can’t really help here, its the underlying async lib that says it can’t connect to the “127.0.0.1:6000” address

1 Like

@cereal In my last post, I was indeed not connected to the correct address, I have since resolved this and found the source of some of my modules not loading in HA. Does the following log file help you to deduce the problem with my setup?

PS C:\Users\colin\Desktop\velbus-test> & c:/Users/colin/Desktop/velbus-test/.venv/Scripts/python.exe c:/Users/colin/Desktop/velbus-test/load_modules.py
DEBUG:asyncio:Using proactor: IocpProactor
INFO:velbus-protocol:Connection established to Velbus
DEBUG:velbus-protocol:Starting Velbus write message from send queue
DEBUG:velbus-protocol:Acquiring write lock
INFO:velbus-handler:Start module scan
INFO:velbus-handler:Starting handling scan 1
INFO:velbus-handler:Starting scan 1
INFO:velbus:Found module 1: <{} type:40 address:1 loaded:False loading:False channels: {}>
DEBUG:velbus-handler:Module 1 detected: start loading
INFO:velbus-module:Request module status 1
INFO:velbus-handler:Scan module 1 completed, module loaded=True
INFO:velbus-handler:Starting handling scan 2
INFO:velbus-handler:Starting handling scan 3
INFO:velbus-handler:Starting handling scan 4
INFO:velbus-handler:Starting handling scan 5
INFO:velbus-handler:Starting handling scan 6
INFO:velbus-handler:Starting scan 6
DEBUG:velbus-module:RX: {"name": "ModuleStatusMessage2", "priority": 251, "address": 1, "rtr": false, "data": "bytearray(b'')", "closed": [], "enabled": [1, 2, 3, 4, 5, 6, 7, 8], "normal": [1, 2, 3, 4, 5, 6, 7, 8], "locked": [], "programenabled": [], "selected_program": 0, "selected_program_str": "none"}
DEBUG:velbus-module:RX: {"name": "ModuleStatusMessage2", "priority": 251, "address": 2, "rtr": false, "data": "bytearray(b'')", "closed": [], "enabled": [1, 2, 3, 4, 5, 6, 7, 8], "normal": [1, 2, 3, 4, 5, 6, 7, 8], "locked": [], "programenabled": [], "selected_program": 0, "selected_program_str": "none"}
DEBUG:velbus-module:RX: {"name": "ModuleStatusMessage2", "priority": 251, "address": 3, "rtr": false, "data": "bytearray(b'')", "closed": [], "enabled": [1, 2, 3, 4, 5, 6, 7, 8], "normal": [1, 2, 3, 4, 5, 6, 7, 8], "locked": [], "programenabled": [], "selected_program": 0, "selected_program_str": "none"}
DEBUG:velbus-module:RX: {"name": "ModuleStatusMessage2", "priority": 251, "address": 4, "rtr": false, "data": "bytearray(b'')", "closed": [], "enabled": [1, 2, 3, 4, 5, 6, 7, 8], "normal": [1, 2, 3, 4, 5, 6, 7, 8], "locked": [], "programenabled": [], "selected_program": 0, "selected_program_str": "none"}
INFO:velbus:Found module 6: <{} type:60 address:6 loaded:False loading:False channels: {}>
DEBUG:velbus-module:RX: {"name": "TempSensorStatusMessage", "priority": 251, "address": 1, "rtr": false, "data": "bytearray(b'')", "local_control": 0, "status_mode": "run", "status_str": "run", "auto_send": 0, "mode": "comfort", "mode_str": "comfort", "cool_mode": false, "heater": false, "boost": false, "pump": false, "cooler": false, "alarm1": false, "alarm2": false, "alarm3": false, "alarm4": false, "current_temp": 23.0, "target_temp": 22.5, "sleep_timer": 0}
DEBUG:velbus-handler:Module 6 detected: start loading
INFO:velbus-module:Request module status 6
INFO:velbus-handler:Scan module 6 completed, module loaded=True
INFO:velbus-handler:Starting handling scan 7
INFO:velbus-handler:Starting scan 7
DEBUG:velbus-module:RX: {"name": "ModuleStatusMessage2", "priority": 251, "address": 6, "rtr": false, "data": "bytearray(b'')", "closed": [], "enabled": [1, 2, 3, 4], "normal": [1, 2, 3, 4, 5, 6, 7, 8], "locked": [], "programenabled": [], "selected_program": 1, "selected_program_str": "summer"}
INFO:velbus:Found module 7: <{} type:60 address:7 loaded:False loading:False channels: {}>
DEBUG:velbus-handler:Module 7 detected: start loading
INFO:velbus-module:Request module status 7
INFO:velbus-handler:Scan module 7 completed, module loaded=True
INFO:velbus-handler:Starting handling scan 8
INFO:velbus-handler:Starting handling scan 9
INFO:velbus-handler:Starting handling scan 10
INFO:velbus-handler:Starting handling scan 11
INFO:velbus-handler:Starting handling scan 12
INFO:velbus-handler:Starting handling scan 13
INFO:velbus-handler:Starting handling scan 14
INFO:velbus-handler:Starting handling scan 15
INFO:velbus-handler:Starting handling scan 16
INFO:velbus-handler:Starting handling scan 17
INFO:velbus-handler:Starting scan 17
DEBUG:velbus-module:RX: {"name": "ModuleStatusMessage2", "priority": 251, "address": 7, "rtr": false, "data": "bytearray(b'')", "closed": [], "enabled": [1, 2, 3, 4], "normal": [1, 2, 3, 4, 5, 6, 7, 8], "locked": [], "programenabled": [], "selected_program": 1, "selected_program_str": "summer"}
INFO:velbus:Found module 17: <{} type:11 address:17 loaded:False loading:False channels: {}>
DEBUG:velbus-handler:Module 17 detected: start loading
INFO:velbus-module:Request module status 17
INFO:velbus-handler:Scan module 17 completed, module loaded=True
INFO:velbus-handler:Starting handling scan 18
INFO:velbus-handler:Starting scan 18
DEBUG:velbus-module:RX: {"name": "ModuleStatusMessage", "priority": 251, "address": 17, "rtr": false, "data": "bytearray(b'')", "closed": [], "led_on": [], "led_slow_blinking": [], "led_fast_blinking": []}
INFO:velbus:Found module 18: <{} type:32 address:18 loaded:False loading:False channels: {}>
DEBUG:velbus-handler:Module 18 detected: start loading
INFO:velbus-module:Request module status 18
INFO:velbus-handler:Scan module 18 completed, module loaded=True
INFO:velbus-handler:Starting handling scan 19
INFO:velbus-handler:Starting handling scan 20
INFO:velbus-handler:Starting scan 20
DEBUG:velbus-module:RX: {"name": "ModuleStatusMessage2", "priority": 251, "address": 18, "rtr": false, "data": "bytearray(b'')", "closed": [], "enabled": [1, 2, 3, 4], "normal": [1, 2, 3, 4, 5, 6, 7, 8], "locked": [], "programenabled": [], "selected_program": 1, "selected_program_str": "summer"}
DEBUG:velbus-module:RX: {"name": "TempSensorStatusMessage", "priority": 251, "address": 18, "rtr": false, "data": "bytearray(b'')", "local_control": 0, "status_mode": "run", "status_str": "run", "auto_send": 0, "mode": "safe", "mode_str": "safe", "cool_mode": false, "heater": false, "boost": false, "pump": false, "cooler": false, "alarm1": false, "alarm2": false, "alarm3": false, "alarm4": false, "current_temp": 22.0, "target_temp": 5.0, "sleep_timer": 0}
INFO:velbus:Found module 20: <{} type:32 address:20 loaded:False loading:False channels: {}>
DEBUG:velbus-handler:Module 20 detected: start loading
INFO:velbus-module:Request module status 20
INFO:velbus-handler:Scan module 20 completed, module loaded=True
INFO:velbus-handler:Starting handling scan 21
INFO:velbus-handler:Starting handling scan 22
INFO:velbus-handler:Starting scan 22
DEBUG:velbus-module:RX: {"name": "ModuleStatusMessage2", "priority": 251, "address": 20, "rtr": false, "data": "bytearray(b'')", "closed": [], "enabled": [1, 2, 3, 4], "normal": [1, 2, 3, 4, 5, 6, 7, 8], "locked": [], "programenabled": [], "selected_program": 1, "selected_program_str": "summer"}
DEBUG:velbus-module:RX: {"name": "TempSensorStatusMessage", "priority": 251, "address": 20, "rtr": false, "data": "bytearray(b'')", "local_control": 0, "status_mode": "run", "status_str": "run", "auto_send": 0, "mode": "safe", "mode_str": "safe", "cool_mode": false, "heater": false, "boost": false, "pump": false, "cooler": false, "alarm1": false, "alarm2": false, "alarm3": false, "alarm4": false, "current_temp": 21.0, "target_temp": 5.0, "sleep_timer": 0}
INFO:velbus:Found module 22: <{} type:32 address:22 loaded:False loading:False channels: {}>
DEBUG:velbus-handler:Module 22 detected: start loading
INFO:velbus-module:Request module status 22
INFO:velbus-handler:Scan module 22 completed, module loaded=True
INFO:velbus-handler:Starting handling scan 23
INFO:velbus-handler:Starting handling scan 24
INFO:velbus-handler:Starting handling scan 25
INFO:velbus-handler:Starting handling scan 26
INFO:velbus-handler:Starting scan 26
DEBUG:velbus-module:RX: {"name": "ModuleStatusMessage2", "priority": 251, "address": 22, "rtr": false, "data": "bytearray(b'')", "closed": [], "enabled": [1, 2, 3, 4], "normal": [1, 2, 3, 4, 5, 6, 7, 8], "locked": [], "programenabled": [], "selected_program": 1, "selected_program_str": "summer"}
DEBUG:velbus-module:RX: {"name": "TempSensorStatusMessage", "priority": 251, "address": 22, "rtr": false, "data": "bytearray(b'')", "local_control": 0, "status_mode": "run", "status_str": "run", "auto_send": 0, "mode": "safe", "mode_str": "safe", "cool_mode": false, "heater": false, "boost": false, "pump": false, "cooler": false, "alarm1": false, "alarm2": false, "alarm3": false, "alarm4": false, "current_temp": 21.5, "target_temp": 5.0, "sleep_timer": 0}
INFO:velbus:Found module 26: <{} type:32 address:26 loaded:False loading:False channels: {}>
DEBUG:velbus-handler:Module 26 detected: start loading
INFO:velbus-module:Request module status 26
INFO:velbus-handler:Scan module 26 completed, module loaded=True
INFO:velbus-handler:Starting handling scan 27
INFO:velbus-handler:Starting handling scan 28
INFO:velbus-handler:Starting handling scan 29
INFO:velbus-handler:Starting handling scan 30
INFO:velbus-handler:Starting scan 30
DEBUG:velbus-module:RX: {"name": "ModuleStatusMessage2", "priority": 251, "address": 26, "rtr": false, "data": "bytearray(b'')", "closed": [], "enabled": [1, 2, 3, 4], "normal": [1, 2, 3, 4, 5, 6, 7, 8], "locked": [], "programenabled": [], "selected_program": 1, "selected_program_str": "summer"}
DEBUG:velbus-module:RX: {"name": "TempSensorStatusMessage", "priority": 251, "address": 26, "rtr": false, "data": "bytearray(b'')", "local_control": 0, "status_mode": "run", "status_str": "run", "auto_send": 0, "mode": "safe", "mode_str": "safe", "cool_mode": false, "heater": false, "boost": false, "pump": false, "cooler": false, "alarm1": false, "alarm2": false, "alarm3": false, "alarm4": false, "current_temp": 21.5, "target_temp": 5.0, "sleep_timer": 0}
INFO:velbus:Found module 30: <{} type:32 address:30 loaded:False loading:False channels: {}>
DEBUG:velbus-handler:Module 30 detected: start loading
INFO:velbus-module:Request module status 30
INFO:velbus-handler:Scan module 30 completed, module loaded=True
INFO:velbus-handler:Starting handling scan 31
INFO:velbus-handler:Starting handling scan 32
INFO:velbus-handler:Starting handling scan 33
INFO:velbus-handler:Starting handling scan 34
INFO:velbus-handler:Starting scan 34
DEBUG:velbus-module:RX: {"name": "ModuleStatusMessage2", "priority": 251, "address": 30, "rtr": false, "data": "bytearray(b'')", "closed": [], "enabled": [1, 2, 3, 4], "normal": [1, 2, 3, 4, 5, 6, 7, 8], "locked": [], "programenabled": [], "selected_program": 1, "selected_program_str": "summer"}
DEBUG:velbus-module:RX: {"name": "TempSensorStatusMessage", "priority": 251, "address": 30, "rtr": false, "data": "bytearray(b'')", "local_control": 0, "status_mode": "run", "status_str": "run", "auto_send": 0, "mode": "day", "mode_str": "day", "cool_mode": false, "heater": false, "boost": false, "pump": false, "cooler": false, "alarm1": false, "alarm2": false, "alarm3": false, "alarm4": false, "current_temp": 22.0, "target_temp": 20.0, "sleep_timer": 0}
INFO:velbus:Found module 34: <{} type:32 address:34 loaded:False loading:False channels: {}>
DEBUG:velbus-handler:Module 34 detected: start loading
INFO:velbus-module:Request module status 34
INFO:velbus-handler:Scan module 34 completed, module loaded=True
INFO:velbus-handler:Starting handling scan 35
INFO:velbus-handler:Starting handling scan 36
INFO:velbus-handler:Starting scan 36
DEBUG:velbus-module:RX: {"name": "ModuleStatusMessage2", "priority": 251, "address": 34, "rtr": false, "data": "bytearray(b'')", "closed": [], "enabled": [1, 2, 3, 4], "normal": [1, 2, 3, 4, 5, 6, 7, 8], "locked": [], "programenabled": [], "selected_program": 1, "selected_program_str": "summer"}
DEBUG:velbus-module:RX: {"name": "TempSensorStatusMessage", "priority": 251, "address": 34, "rtr": false, "data": "bytearray(b'')", "local_control": 0, "status_mode": "run", "status_str": "run", "auto_send": 0, "mode": "safe", "mode_str": "safe", "cool_mode": false, "heater": false, "boost": false, "pump": false, "cooler": false, "alarm1": false, "alarm2": false, "alarm3": false, "alarm4": false, "current_temp": 21.5, "target_temp": 5.0, "sleep_timer": 0}
INFO:velbus:Found module 36: <{} type:32 address:36 loaded:False loading:False channels: {}>
DEBUG:velbus-handler:Module 36 detected: start loading
INFO:velbus-module:Request module status 36
INFO:velbus-handler:Scan module 36 completed, module loaded=True
INFO:velbus-handler:Starting handling scan 37
INFO:velbus-handler:Starting handling scan 38
INFO:velbus-handler:Starting handling scan 39
INFO:velbus-handler:Starting handling scan 40
INFO:velbus-handler:Starting handling scan 41
INFO:velbus-handler:Starting handling scan 42
INFO:velbus-handler:Starting handling scan 43
INFO:velbus-handler:Starting handling scan 44
INFO:velbus-handler:Starting handling scan 45
INFO:velbus-handler:Starting handling scan 46
INFO:velbus-handler:Starting handling scan 47
INFO:velbus-handler:Starting handling scan 48
INFO:velbus-handler:Starting handling scan 49
INFO:velbus-handler:Starting handling scan 50
INFO:velbus-handler:Starting handling scan 51
INFO:velbus-handler:Starting handling scan 52
INFO:velbus-handler:Starting handling scan 53
INFO:velbus-handler:Starting scan 53
DEBUG:velbus-module:RX: {"name": "ModuleStatusMessage2", "priority": 251, "address": 36, "rtr": false, "data": "bytearray(b'')", "closed": [], "enabled": [1, 2, 3, 4], "normal": [1, 2, 3, 4, 5, 6, 7, 8], "locked": [], "programenabled": [], "selected_program": 1, "selected_program_str": "summer"}
DEBUG:velbus-module:RX: {"name": "TempSensorStatusMessage", "priority": 251, "address": 36, "rtr": false, "data": "bytearray(b'')", "local_control": 0, "status_mode": "run", "status_str": "run", "auto_send": 0, "mode": "safe", "mode_str": "safe", "cool_mode": false, "heater": false, "boost": false, "pump": false, "cooler": false, "alarm1": false, "alarm2": false, "alarm3": false, "alarm4": false, "current_temp": 23.0, "target_temp": 5.0, "sleep_timer": 0}
INFO:velbus:Found module 53: <{} type:29 address:53 loaded:False loading:False channels: {}>
DEBUG:velbus-handler:Module 53 detected: start loading
ERROR:velbus-protocol:Stopping Velbus writer due to CancelledError()
DEBUG:velbus-protocol:Ending Velbus write message from send queue
Traceback (most recent call last):
  File "c:\Users\colin\Desktop\velbus-test\load_modules.py", line 33, in <module>
    asyncio.run(main(args.connect), debug=False)
  File "c:\Users\colin\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "c:\Users\colin\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\colin\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "c:\Users\colin\Desktop\velbus-test\load_modules.py", line 24, in main
    await velbus.connect()
  File "C:\Users\colin\Desktop\velbus-test\.venv\Lib\site-packages\velbusaio\controller.py", line 182, in connect
    await self._handler.scan()
  File "C:\Users\colin\Desktop\velbus-test\.venv\Lib\site-packages\velbusaio\handler.py", line 119, in scan
    await asyncio.wait_for(
  File "c:\Users\colin\AppData\Local\Programs\Python\Python312\Lib\asyncio\tasks.py", line 520, in wait_for
    return await fut
           ^^^^^^^^^
  File "C:\Users\colin\Desktop\velbus-test\.venv\Lib\site-packages\velbusaio\module.py", line 553, in load
    self._channels[int(num)]._name = chan["name"]
    ~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 3

So I’m getting an error message on address 36, but that module is just a simple glass panel that is working. I can even operate it in VelbusLink. To me it’s weird that everything can be scanned and operated in VelbusLink, but when I scan in HA, only the first 10 or so addresses are loaded and the rest is missing.

what is the exact type of this glasspanel?

Remember we need to do items in the code for every single module velbus is dropping on the market. So its not because it works in velbuslink it will work in ha.

So i need the exact module type and firmware version.

1 Like

I went looking for a list of supported modules to make life easier for @csoete but it seems that HA doesn’t have such a thing. (that I could find)

While looking, I was horrified to see only 89 active deployments of your Velbus integration.

Surely that can’t be right? there has to be many more than that?

But then I saw that after the core elements of HA, 89 is actually a good number. (compared to other device types)

596 out of 1086 integrations


Do you list your supported Velbus modules in this file?

https://github.com/Cereal2nd/velbus-aio/blob/master/velbusaio/command_registry.py

MODULE_DIRECTORY = {
    0x01: "VMB8PB",
    0x02: "VMB1RY",
    0x03: "VMB1BL",
    0x04: "VMB4LEDPWM-20",
    0x05: "VMB6IN",
    0x07: "VMB1DM",
    0x08: "VMB4RY",
    0x09: "VMB2BL",
    0x0A: "VMB8IR",
    0x0B: "VMB4PD",
    0x0C: "VMB1TS",
    0x0D: "VMB1TH",
    0x0E: "VMB1TC",
    0x0F: "VMB1LED",
    0x10: "VMB4RYLD",
    0x11: "VMB4RYNO",
    0x12: "VMB4DC",
    0x13: "VMBLCDWB",
    0x14: "VMBDME",
    0x15: "VMBDMI",
    0x16: "VMB8PBU",
    0x17: "VMB6PBN",
    0x18: "VMB2PBN",
    0x19: "VMB6PBB",
    0x1A: "VMB4RF",
    0x1B: "VMB1RYNO",
    0x1C: "VMB1BLE",
    0x1D: "VMB2BLE",
    0x1E: "VMBGP1",
    0x1F: "VMBGP2",
    0x20: "VMBGP4",
    0x21: "VMBGPO",
    0x22: "VMB7IN",
    0x28: "VMBGPOD",
    0x29: "VMB1RYNOS",
    0x2A: "VMBPIRM",
    0x2B: "VMBPIRC",
    0x2C: "VMBPIRO",
    0x2D: "VMBGP4PIR",
    0x2E: "VMB1BLS",
    0x2F: "VMBDMI-R",
    0x31: "VMBMETEO",
    0x32: "VMB4AN",
    0x33: "VMBVP01",
    0x34: "VMBEL1",
    0x35: "VMBEL2",
    0x36: "VMBEL4",
    0x37: "VMBELO",
    0x38: "VMBELPIR",
    0x39: "VMBSIG",
    0x3A: "VMBGP1-2",
    0x3B: "VMBGP2-2",
    0x3C: "VMBGP4-2",
    0x3D: "VMBGPOD-2",
    0x3E: "VMBGP4PIR-2",
    0x3F: "VMCM3",
    0x40: "VMBUSBIP",
    0x41: "VMB1RYS",
    0x42: "VMBKP",
    0x43: "VMBIN",
    0x44: "VMB4PB",
    0x45: "VMBDALI",
    0x48: "VMB4RYLD-10",
    0x49: "VMB4RYNO-10",
    0x4A: "VMB2BLE-10",
    0x4B: "VMB8DC-20",
    0x4C: "VMB6PB-20",
    0x4F: "VMBEL1-20",
    0x50: "VMBEL2-20",
    0x51: "VMBEL4-20",
    0x52: "VMBELO-20",
    0x53: "VMBGP1-20",
    0x54: "VMBGP2-20",
    0x55: "VMBGP4-20",
    0x56: "VMBGPO-20",
    0x5A: "VMBDALI-20",
    0x5C: "VMBEL4PIR-20",
    0x5F: "VMBGP4PIR-20",
}

It’s probably the most basic one, a VMBGP4 (build 1917, firmware: 2950-1.25.23). I have many others just like that one in my setup. Am I doing something wrong or is there something wrong with my wiring/installation?

As a last resort, I had downgraded my HA to 2024.5.0 which has velbus-aio==2024.4.1 as a requirement. All my modules were then visible within my Velbus integration on HA, but after retrying this for reproduction purposes, I could only load the first 10 or so again.

On the rare occasion that I can load them in, I get strange behaviour like this module name or modules randomly becoming inactive:

These tests are all done on fresh installs of HAOS every time (using Proxmox bash scripts).

If there is something else you want me to test out implementation wise, let me know, because this bug is eating me up.

Had this as well with the latest version… where it either gives these strange characters or no-name whatsoever… It’s probably a timing thing or special character in the original name… in HA you can just rename it back to the original name… I’m not too worried about that… I’m more worried about the new modules… as I dont have any of the new modules so I can’t program them in… else I would have spun up my dev toolkit again…

PS: Thermostat full control (including heat/cool mode) coming to HA soon :slight_smile:

I have added the relevant log file of what happens when I add the Velbus integration in HA. In this particular instance, all my modules were loaded, but you can still see some bugs in the log file when connecting.

ha-velbus.log (84.9 KB)

Fingers crossed that they don’t become unavailable. Also, is it normal that this scan of all my modules takes 10 minutes?

The character errors are possibly have to do with velbusIO line 190

def cleanupSubChannels(self) -> None:
        # TODO: 21/11/2022 DannyDeGaspari: Fix needed
        # Care should be taken for this function, not all subaddresses have their channels on multiples of 8.
        # The last subaddress contain typically the temperature channels, has more then 8 channels
        # and doesn't start on a boundary of 8.
        # E.g. The VMBGP4 has one subaddress, so since the second subaddress is not defined,
        # this function will delete channels 17-24 while 17 and 18 belong to the temperature channels.
        #
        # The solution would be that this functions knows were the temperature channels are located
        # and/or what the max number of subaddresses are for each module.
        # if self._sub_address == {} and self.loaded:
        #   raise Exception("No subaddresses defined")

The scan time… is essentially… we have 254 possible addresses… and the timeout on scan is 2 seconds… the less modules you have… the more time it takes…

If you look at the log… you see that when a module is found, the next address is scanned quickly…

2024-09-28 12:57:23.128 INFO (MainThread) [velbus-handler] Starting scan 6
2024-09-28 12:57:23.243 DEBUG (MainThread) [velbus-handler] Module 6 detected: start loading
2024-09-28 12:57:27.618 INFO (MainThread) [velbus-handler] Scan module 6 completed, module loaded=True
2024-09-28 12:57:27.618 INFO (MainThread) [velbus-handler] Starting handling scan 7
2024-09-28 12:57:27.618 INFO (MainThread) [velbus-handler] Starting scan 7

While modules not found take 2 seconds:

2024-09-28 **13:00:33.024** INFO (MainThread) [velbus-handler] Starting scan 62
2024-09-28 **13:00:35.026** INFO (MainThread) [velbus-handler] Scan module 62 failed: not present or unavailable
2024-09-28 13:00:35.026 INFO (MainThread) [velbus-handler] Starting handling scan 63
2024-09-28 13:00:35.026 INFO (MainThread) [velbus-handler] Starting scan 63

and your log started to get undetected modules at around 54 modules… so 200*2 seconds… is 6.6 minutes for the full scan to complete…

there are also some modules with multiple addresses (around 50) which is probably modules with thermostats or multiple buttons configured…

@RCZ Okay perfect, thanks for the clarification. I was under the assumption that loading all modules was done as quickly as in Velbuslink. Hence where my problem initiated, I was probably already reloading the integration before the initial scan had concluded.