I’m looking for a blueprint that can do the following:
Let’s say I have a smartswith that provides only
single-click
long-press
What the blueprint is supposed to do
single-click:
toggle light (turn off or turn on on at last recorded light intensity)
long-press:
turn on light (at last recorded light intensity) AND
if initial brightness < 50%
start "brightness up"
stop at single-click or brightness = 100%
if initial brightness > 50%
start "brightness-down"
stop at single click or brightness = 1%
long-press (within 1 sec of previous long-press):
turn on light (at last recorded light intensity) AND
if previous action "brightness-down":
start "brightness-up"
stop at single click or brightness = 100%
if previous action brightness-up:
start brightness-down
stop at single click or brightness = 1%
Is anybody aware of such a blueprint and/or automation?
I’d like to share an automation I’ve created for the Xiaomi/Aqara Wireless Mini Switch (WXKG11LM). You can find more details about this “simple button” here: Aqara WXKG11LM control via MQTT | Zigbee2MQTT
Before setting up this automation, you’ll need to create two helper entities:
input_text.minibutton_last_state
input_text.minibutton_last_controlled_entity
This automation supports the following button actions:
Single press
Double press
Triple press
Quintuple press
Many press
Hold
For the single, double, triple, quintuple, and many press actions, I’ve set them up to toggle different lights in my home. Feel free to adjust these to control whatever devices suit your needs.
The hold action is used to dim or brighten the last controlled light. This is particularly useful when you want to adjust the brightness after turning on a light without having to use a separate control.
Feel free to modify this automation to fit your specific needs. I hope you find it useful!