cedricboon / openhab-addons

Add-ons for openHAB 2.x
Eclipse Public License 2.0
6 stars 5 forks source link

Only 1st change in Button Status message (0x00) is processed (on VMBPIRM) #33

Open matthijsfh opened 3 years ago

matthijsfh commented 3 years ago

When a VelBus message "Button Status Message (00)" contains changes in more than 1 bits, only the first bit is processed and results in a "PRESSED" or "RELEASED" event in the OpenHab rules.

My (DIY) VMBPIRM sends following message:

0F F8 21 04 00 0C 00 00 ......

Module is 0x21, message type = 00.

So bits "4" and "8" changed (0x04 + 0x08 = 0x0C) (channels 3 & 4). Only the rules which respond to CH3 are triggered.

If I send:

0F F8 21 04 00 04 00 00 ...... 0F F8 21 04 00 08 00 00 ......

All rules of channels CH3 & CH4 are triggered.

So there seems to be something strange going on. The message with 0x0C seems valid as the other velbus modules respond correctly.

Or is following possible: CH3 is triggered, and I check if CH4 was also triggered? Cannot find anything like that in the documentation though.

Grtz Matthijs

cedricboon commented 3 years ago

Hi Matthijs,

Your observation is correct, the binding currently doesn't support status messages for multiple channels at once. I'll have to check how big the impact is to be able to support it. Is it just for status messages, or are you aware of multi-channel messages being used somewhere else as well?

Regards, Cédric

cedricboon commented 3 years ago

@matthijsfh I think the issue can easily be fixed. Are you using version 3 or 2.5 of openHab?

matthijsfh commented 3 years ago

Thanks for the prompt reply!

This happens with a VelBus module which I made myself. https://forum.velbus.eu/t/building-custom-velbus-devices/4125/44

For now I fixed it by sending 2 messages, but that is not the optimal solution. I did not see it with normal modules, but I only have glas switches, which will never send an update for multiple inputs. Nobody can press multiple buttons at the same moment. It can only happen with "calculated" outputs. I am on 2.5 latest.

Greetings Matthijs

MDAR commented 3 years ago

I only have glas switches, which will never send an update for multiple inputs. Nobody can press multiple buttons at the same moment

Ahem, actually it is possible to press multiple buttons on a glass panel at the same time.

That's a requirement of the Velbus protocol.

Likewise, that's how the Thermostat channels operate.

Heater & Pump both trigger at the same time (mostly)

matthijsfh commented 3 years ago

Oke. Didnt know that. In that case, the feature is a bug and I hope Cedric can fix it. Currently my embedded code is a bit funny to force 2 messages begin sent.

Greetings Matthijs

matthijsfh commented 3 years ago

How do I know (and get) the update when ready?

cedricboon commented 3 years ago

Ahem, actually it is possible to press multiple buttons on a glass panel at the same time.

That's a requirement of the Velbus protocol.

Likewise, that's how the Thermostat channels operate.

Heater & Pump both trigger at the same time (mostly)

Actually, I think most of the times pressing two buttons at once will generate 2 separate messages on the bus. This is certainly the case for the glass panels as the encoding of the channel for glass panels status messages allow only one channel per bus-message. Other modules have a different encoding of the channel, and might send a status update for several channels at once.

How do I know (and get) the update when ready? Once the fix is validated and we are sure it doesn't introduce any other problems, I can create a PR that will make the fix available in the 3.1 snapshot branch after approval. I don't know if they will merge it back to the 2.5 branch however.

I tried to compile a 2.5 version with the fix, but haven't found the time to test it yet. org.openhab.binding.velbus-2.5.10-SNAPSHOT.zip

If you want to try it out, you can extract it and place the *.jar file in your addons folder.

matthijsfh commented 2 years ago

Would it be possible to merge this fix in the last 2.5.13 (?) code and make one more release? I really would appreciate this to be working correctly and do not have time / energy to switch to 3.x yet.

Thanks, Matthijs