Bug in HubMesh with button devices

@bravenel @bcopeland

I think there is a bug in Hub mesh when it comes to using button devices.

Obviously I don't know how it's been written but it looks like there is a provision (probably to save unnecessary additional communication between the hubs) where if a device creates an event that does not actually change the state of the device then it does not send this event to the hub mesh device on the secondary hub.

For pretty much all devices this is fine and makes it more efficient. However for button devices it means that they don't function correctly. This is because if I have a 4 button device and I press button 1, and that is a change of state, then it will send this to the hub mesh device correctly. However, If I then press button 1 again, because there is no change of state it does not send the event to the hub mesh device.. but of course that is how buttons work... you can press the same button 100 times in a row and you would still expect it to work!

Let me know if I've made a mistake or have something wrong here that can hopefully help me resolve this.

on the source hub what button device driver are you using?

It's one that I made myself to control a custom button. It's very possible that there is something I could do better in the driver but before assuming that let me just say that I was using Hubconnect previously for this routing with no issue

in your button sendEvent(name:"push", value:x) did you include isStateChange:true?
like such:
sendEvent(name:"push", value:x, isStateChange:true)

Thanks Mike - I wasn't doing that - looks like an obvious fix :man_facepalming:t3: - I'll give that a whirl now!

Thanks again

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.