Sian-Lee-SA / Home-Assistant-Switch-Manager

Switch manager is a centralised component to handle button pushes for your wireless switches. This includes anything passed through the event bus. The component relies on switch blueprints which is easily made to allow GUI configuration of your switches and their button pushes. This helps remove clutter from the automations.
Other
232 stars 85 forks source link

Hue dimmer switch hold problem #174

Closed RezzZ closed 1 year ago

RezzZ commented 1 year ago

I have two philips hue dimmer switches model: RWL021 Im using zigbee2mqtt and have switch manager setup to control the switch. This works super easy so thank you for adding this manager to HA.

I do notice the hold is not functioning properly. The hold is registered/activated once every second or less and thus executing the action attached should only run once. As I setup the dimmer to publish via mqtt for the hold, this results in several messages send to zigbee2mqtt which should not happen. Am I setting something up wrong?

I had a different action with a restarting sequence before but learned sending a single command to dim the light should be more fluent and should use less traffic..

Any thoughts?

edit: i also see the hold button pulsing as if it is registering more presses...

Sian-Lee-SA commented 1 year ago

Philips hue hold will always repeat, if you want it to only execute once then you will need to use the hold (released) action

RezzZ commented 1 year ago

Why will the hold command repeat? I can already tell in switch manager to repeat an action untill the hold-release has been published.

My idea was to start the dimming when the hold is received and send a stop dimming command when the hold release is received.

service: mqtt.publish data: topic: zigbee2mqtt/bedroom/set payload: "{\"brightness_move\":50}"

That's the most elegant way of dimming lights

Sian-Lee-SA commented 1 year ago

"Why will the hold command repeat?" Because that's just how the Z2M and Device Firmware works. Blueprints are designed to reflect this. How you use Switch Manager based on those blueprint is at your own discretion. If you want to make your own Blueprint to better suit your needs then you can do that aswell.

RezzZ commented 1 year ago

Okay so z2m will also publish the hold until the hold release?

I will look into the blueprints, thank you for the suggestion. I already created one for a Xiaomi contact sensor to turn on lights on/off but for the current usecase i need something more advanced...

Sian-Lee-SA commented 1 year ago

Thats correct. Blueprints don't generally go out there way to do their own voodoo magic as such. They're designed to proxy what comes in from their services (Z2M, Z-wave etc). I think there has been one or two occasions where a blueprint has emulated it's own hold (released) action but it's rare and advised against.

Generally once you have all actions at your disposal then you can become creative with your switches through actions and variables. Eg. set a variable then check that variable in a repeat loop etc.