Hello Damien,
Many thanks for your time.
One of the possible conclusions from our observations is that indeed the protocol used between my modules is slightly different. I’ll provide info below to try to figure this out.
Before looking at my BiomatX setup and its specifics, a few observations/questions :
- We have tried different baud rates on the serial side to try and rule out the possibility that the data is garbled because of a speed mismatch between the RS485 bridge and the BiomatX modules. I see your code sets the speed at 19200 (I think it would only work using and rfc2217:// url, as it is my understanding that the client can then push serial parameters to the bridge, which is not possible using the raw connexion with a socket:// url). Is this speed something you are sure about ? I never found anything in the BiomatX documentation.
- I tried reversing polarity on the bus side using the connectors on the bridge, as RS485 is poorly worded in that regard (if you look around, you will find out that not all manufacturers implement polarity the same way on the RS485 A and B ports of their devices).
But yeah, as you stated, it looks a lot like things are properly configured.
On to my BiomatX setup…
Basic setup
- I have 5 light modules, model 2110.
- I do NOT own the MEWS Lt module for direct PC connection.
- The 5 light modules are daisy chained together using short UTP cables, using the ports you outlined and as in the BiomatX user guide (page 9).
- Addresses are set from 1 to 5 (BiomatX front panel LEDs), so technically modules 0 to 4.
Module 1 (address 0)
Left UTP goes to the RS485 bridge
Right UTP goes to module 2 (address 1)
Some intermediate module
Need I say more ?
Module 5 (address 4)
About push buttons and addresses
Of high interest : I do not use the “Anabus” for push buttons on my modules (where push buttons share a 5-wires bus and have manually configured addresses using dip switches boards in the wall boxes containing each button, user guide page 8). Instead each push button is wired to one of the individual digital inputs at the bottom left of the modules (user guide page 7).
However, I do not believe that this impacts the addressing protocol used on the RS485 bus, here’s why :
- Using individual digital inputs for each module means you don’t even need to connect the modules together (e.g. dedicated input 3 on a given module triggers relay 3 on the same module). Although the BiomatX guide implicitly states that it’s possible (user guide page 11) (presumably to use scenarios and/or the MEWS Lt module). I only connected them for the purpose of using the RS485 bridge and the HA integration.
- However, when you connect modules using dedicated inputs together, two modules using the same address will act as mirror of one another : anything triggered on one (either using the dedicated input or the local button on the module itself) is triggered on the other (this behavior is explicitly documented in the BiomatX guide, page 7, and I was able to confrm it easily). This means that any action on a module, is passed on the other modules through the RS485 bus, even if the system does not use the Anabus for its buttons.
- Also, as per the BiomatX documentation, if using Anabus buttons, the address of the modules on the RS485 bus and the address of the button boards on the Anabus have to match one another. The information received from the Anabus is most likely just passed to all modules on the RS485 bus.
This leads me to think that the same basic message “Module 1, button 5” is passed on the RS485 bus whether the user is
- A. pushing local button 5 on module 1,
- B. pushing a distant push button connected to input 5 on module 1,
- C. pushing a distant push button connected on address 1,5 on the Anabus (using the dip switches on the in-wall address board)
From that first reasoning and based on the existence of the MEWS Lt module that would also send messages to the RS485 bus, I would then deduce that if a Home Assistant integration (or any other piece of code for that matter) sends the same messages on the RS485 bus, it should not matter if the system uses the Anabus or dedicated inputs to connect its in-wall push buttons.
(I would go as far as to think that you could conceivably run in a form of hybrid setup, using both the Anabus AND dedicated inputs. Unfortunately I do not have address board to test this theory.)
Of course this is all an assumption I’m making based on my observations.
Maybe the messages ARE different, maybe the 2-bytes payload does contain some information as to the source of the action (local button / dedicated input button / Anabus button). In this case, the messages received from triggering the dedicated inputs on my modules are not those expected by your code, which is expecting messages indicating buttons triggered on the Anabus. Also it’s possible that if no BiomatX module uses the Anabus, then the messages received from the integration and referring to Anabus buttons are simply ignored.
I still believe my initial line of thinking is correct and we are seeing something caused by some other side effect in the addressing protocol or in the RS485/IP interface, for these additional reasons :
- I have noticed one of my light circuits improperly turning on based on unrelated actions on the integration side (meaning some improperly-formatted information sent by the RS485 bridge still happens to trigger my module).
- I have noticed some action on the in-wall buttons being interpreted by the integration as a push on a button from a non-existent module address 6 (the integration then explciitly drops this action because it was configured for 5 modules, not 7).
And now for the logs…
I reinstalled the initial RS485 bridge and did some experiments…
Comparison of using a local button (on a module) and a remote push button (wired through dedicated input) :
TRIGERRING ON THEN OFF PUSH BUTTON ON DEDICATED INPUT 8, MODULE 1 (ADDRESS 0.7)
13:11:51.587 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:11:51.588 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfe'
13:11:51.760 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:11:51.760 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfc'
13:11:56.159 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:11:56.159 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfe'
13:11:56.382 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:11:56.383 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfc'
TRIGERRING ON THEN OFF LOCAL BUTTON 8, MODULE 1 (ADDRESS 0.7)
13:12:05.336 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:12:05.336 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfe'
13:12:05.588 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:12:05.589 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfc'
13:12:10.415 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:12:10.415 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfe'
13:12:10.649 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:12:10.649 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfc'
All local buttons for module 1 :
TRIGERRING ON THEN OFF LOCAL BUTTON 1, MODULE 1 (ADDRESS 0.0)
13:03:59.185 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:03:59.185 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfe'
13:03:59.378 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:03:59.379 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfc'
13:04:03.547 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:04:03.548 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfe'
13:04:03.762 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:04:03.762 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfc'
TRIGERRING ON THEN OFF LOCAL BUTTON 2, MODULE 1 (ADDRESS 0.1)
13:04:08.609 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:04:08.609 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfe'
13:04:08.812 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:04:08.813 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfc'
13:04:13.082 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:04:13.082 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfe'
13:04:13.286 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:04:13.286 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfc'
TRIGERRING ON THEN OFF LOCAL BUTTON 3, MODULE 1 (ADDRESS 0.2)
13:04:17.037 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:04:17.037 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfe'
13:04:17.232 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:04:17.232 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfc'
13:04:20.922 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:04:20.923 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfe'
13:04:21.108 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:04:21.108 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfc'
TRIGERRING ON THEN OFF LOCAL BUTTON 4, MODULE 1 (ADDRESS 0.3)
13:04:24.748 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:04:24.749 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfe'
13:04:24.922 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:04:24.923 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfc'
13:04:28.643 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:04:28.644 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfe'
13:04:28.849 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:04:28.849 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfc'
TRIGERRING ON THEN OFF LOCAL BUTTON 5, MODULE 1 (ADDRESS 0.4)
13:04:32.609 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:04:32.609 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x9f'
13:04:32.814 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:04:32.814 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x8f'
13:04:36.425 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:04:36.425 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x9f'
13:04:36.609 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:04:36.610 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x8f'
TRIGERRING ON THEN OFF LOCAL BUTTON 6, MODULE 1 (ADDRESS 0.5)
13:04:40.181 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:04:40.182 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x9f'
13:04:40.396 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:04:40.397 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x8f'
13:04:44.029 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:04:44.029 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x9f'
13:04:44.212 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:04:44.212 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x8f'
TRIGERRING ON THEN OFF LOCAL BUTTON 7, MODULE 1 (ADDRESS 0.6)
13:04:47.833 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:04:47.833 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfe'
13:04:47.998 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:04:47.998 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfc'
13:04:51.658 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:04:51.659 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfe'
13:04:51.833 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:04:51.834 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfc'
TRIGERRING ON THEN OFF LOCAL BUTTON 8, MODULE 1 (ADDRESS 0.7)
13:04:55.415 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:04:55.415 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfe'
13:04:55.600 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:04:55.600 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfc'
13:04:59.370 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:04:59.371 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfe'
13:04:59.546 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:04:59.546 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xfc'
TRIGERRING ON THEN OFF LOCAL BUTTON 9, MODULE 1 (ADDRESS 0.8)
13:05:03.246 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:05:03.247 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xcf'
13:05:03.421 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:05:03.421 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc7'
13:05:06.992 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:05:06.992 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xcf'
13:05:07.177 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc5'
13:05:07.177 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc7'
TRIGERRING ON THEN OFF LOCAL BUTTON 10, MODULE 1 (ADDRESS 0.9)
13:05:10.729 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:05:10.729 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xcf'
13:05:10.893 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:05:10.893 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc7'
13:05:14.734 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:05:14.734 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xcf'
13:05:14.918 WARNING (MainThread) [biomatx] dropping invalid start byte b'E'
13:05:14.918 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc7'
Some local buttons for module 5 :
TRIGERRING ON THEN OFF LOCAL BUTTON 6, MODULE 5 (ADDRESS 4.5)
13:12:24.929 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x15'
13:12:25.153 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x1d'
13:12:29.240 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x15'
13:12:29.474 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x1d'
TRIGERRING ON THEN OFF LOCAL BUTTON 7, MODULE 5 (ADDRESS 4.6)
13:12:33.332 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x15'
13:12:33.332 WARNING (MainThread) [biomatx] dropping invalid start byte b'.'
13:12:33.546 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x15'
13:12:33.546 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x0e'
13:12:37.344 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x15'
13:12:37.344 WARNING (MainThread) [biomatx] dropping invalid start byte b'.'
13:12:37.559 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x15'
13:12:37.560 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x0e'
TRIGERRING ON THEN OFF LOCAL BUTTON 8, MODULE 5 (ADDRESS 4.7)
13:12:41.108 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x15'
13:12:41.312 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x1c'
13:12:44.762 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x15'
13:12:44.917 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x1c'
TRIGERRING ON THEN OFF LOCAL BUTTON 9, MODULE 5 (ADDRESS 4.8)
13:12:48.426 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x15'
13:12:48.426 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xcb'
13:12:48.631 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x15'
13:12:48.631 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc3'
13:12:52.210 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x15'
13:12:52.210 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xcb'
13:12:52.454 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x15'
13:12:52.454 WARNING (MainThread) [biomatx] dropping invalid start byte b'\xc3'
TRIGERRING ON THEN OFF LOCAL BUTTON 10, MODULE 5 (ADDRESS 4.9)
13:12:56.072 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x15'
13:12:56.247 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x1b'
13:13:00.205 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x15'
13:13:00.400 WARNING (MainThread) [biomatx] dropping invalid start byte b'\x1b'
I can’t help noticing that :
- Several actions seem to produce the same results in the log (I swear that in real life, different light channels turn on and off…).
- Some actions on module 5 produce shorter results (only 2 lines of log per action instead of 4).
EDIT : Removed DATE from logs so as to make the whole thing easier to read (no horizontal scrolling required)