Closed dkerr64 closed 1 year ago
Fixed!
Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html)
Awesome, thank you @Koenkk
Something else I just noticed is that the homebridge plugin seems to be sensitive to the order that the actions are listed... assigning the first to button 1, second to button 2, etc. (The plugin creates multiple Apple HomeKit stateless switch accessories that are linked together). I had hoped that it would key off the order that I listed the actions in its config file, but apparently not. Which means that the best thing to do would be to order as...
exposes: [e.action(['brightness_move_to_level', 'brightness_step_up', 'brightness_step_down', 'brightness_stop'])],
But that of course doesn't really solve the problem at the homebridge side which I am going to start working on soon... ideally the configuration for it should allow you to assign actions to specific buttons in whatever order you want. And it will have to ignore brightness_stop
and instead assign brightness_move_to_level
with action_level
zero to button 4. If I solve that, I might as well allow for button assignment order to be based on its configuration and not the order in the MQTT message.
THANK YOU!! David.
@itavero tagging you into this discussion for awareness. I'll let you know when I figure out how to handle this in your plugin.
Not sure what you need from homebridge-z2m, but currently the action values are sorted to assign numbers to them (with some additional logic in case the values already contain some numbered values). This is done so that changing the order in the exposes information will not result in different behavior in the plugin.
Do note that if you are looking to do something specific just for this device model, I would suggest having a look at the homebridge-mqttthing plugin instead.
@itavero thanks for the pointer, I will look at mqttthing. The main issue I am trying to solve is that this particular device send the same action for two buttons, the "on" and "off" buttons on the remote (two of the four buttons).
The on button sends:
{"action":"brightness_move_to_level","action_group":8124,"action_level":254,"action_transition_time":0.04,"linkquality":96}
and the off button sends:
{"action":"brightness_move_to_level","action_group":8124,"action_level":0,"action_transition_time":0.04,"linkquality":96}
I need to assign those two mqtt messages to two separate stateless switches based only on the difference in action_level
.
Thanks David
I see. Well, in that case I would definitely recommend looking at MQTT thing to create this specific mapping.
@itavero Thank you for the pointer MQTT-Thing is exactly what I need. It lets me parse the JSON that comes back.
The convertor for Lutron connected remote LZL4BWHL01 exposes the actions...
However when I look at the logs the actual messages sent for each button press are...
So given the actual action messages sent, shouldn't the exposed actions be defined as...
These actions are published when a device is registered with a MQTT listener, so if they do not match what is actually sent, then they are likely not properly handled. I am trying to get the a Homebridge plugin to work with this remote and this is the first fix I'll need to get this working... The other being that these do not match directly to each button,
brightness_move_to_level
is sent on pressing both the on and off button (with different move-to-levels) and that will need special handling on the Homebridge side.Thanks