Closed aderusha closed 8 years ago
Ouch that's annoying. So what about changing the values here: https://github.com/SmartThingsCommunity/SmartThingsPublic/blob/master/devicetypes/smartthings/aeon-minimote.src/aeon-minimote.groovy#L70
to read something like "held $button" and "pushed $button"
That should end up making it more consistent with your ZWN-SC7, and it gives you an opportunity to parse the information in Home Assistant.
The alternative would be to send over the entire jsonData with each event, and it's unclear how to actually do that without wrapping the whole event in a data structure that needs to be parsed every time on the HA side.
That sure is annoying! It's not something that impacts me directly but I ran across it after a user of an ST SmartApp I wrote pointed it out as an issue with my own project.
Changing the Minimote code should in fact address the issue directly, but it's also an annoying fix as the code is a first-party ST driver which can create challenges merging updates to the codebase later. The overall problem is that there doesn't appear to be a well-defined standard for reporting both "press"/"hold" actions while also reporting the specific button being pressed.
I honestly don't know what I'm expecting here, other than surfacing the issue for you fellas to think about and maybe if you come up with an elegant solution I can steal it for my own app :grinning:
Closing because the proposed workaround works.
I'm reopening this as Issue #120 since this issue occurs for other button controllers, not just the Aeon Minimote. Using a GoControl WA00Z-1 Z-Wave Wireless Light Switch with two buttons, each button push event results in the same MQTT message, making it impossible to discern which button was pushed.
The fact that this item was closed "because the proposed workaround works" only applies to the Aeon Minimiote, while this issue affects all button devices. (Since the workaround was a modified Aeon Minimote device handler, this should really be addressed at the bridge level, to cover all devices.)
Button controllers like the Aeon Labs Minimote and the Enerwave ZWN-SC7 have several buttons on them which can send individual events. Testing the MQTT bridge with the ZWN-SC7 device using the community-created device handler returns a "button" event with a message of "button 1" or whatever which is what I would expect, like this:
The Aeon Labs Minimote with the SmartThings-provided device handler returns a "button" event without indicating the specific button. It does correctly report "pressed" or "held", but with no indication of which button has been activated, like this:
The SmartApp logs the following event in the IDE when I press button 1:
Forwarding device event to bridge: {"path":"/push","body":{"name":"Aeon Minimote","value":"pushed","type":"button"}}
The Device Handler logs the following event in the IDE from the same event:
Sending '{"path":"/push","body":{"name":"Aeon Minimote","value":"pushed","type":"button"}}' to device
From my own SmartApp testing, the Aeon Labs Minimote event looks like this:
The working test case with the Enerwave ZWN-SC7 looks like this: