Hi, I would like to share with you my new blueprint. It allows to use any button to turn on/off and dimm a group of lights.
Note: Dimming non-Zigbee devices has known issues. ZHA lights works perfectly
(ZHA lights needs to implement the Zigbee Light Link standard, as I’m sending raw commands to them)
Incorporation URL: https://gist.github.com/notherealmarco/6ce63099a744cf7da3ce3d3f552f9b3d
This Blueprint provides a script for every group of light you want to control with a button. Then you can use automations (or another blueprint) to map the button to the script. (see below)
You can choose the action by passing a variable to the script.
Supported dimming algorithms
Timestamp: this algorithm should be used only if the lights are not ZHA devices compatible with the Zigbee Light Link standard.
When you call the dimmming function (e.g. you hold down a button), the lights starts dimming to the highest/lowest brightness level with a 3s transition. When the button is released, the a new brightness will be calculated based on the time (in microseconds) the button has been pressed and sent to the lamp.
This algorithm has a known issue: sometimes the lights jumps to a completely different brightness when the button is released (I’m still investigating why).
ZHA ZLL: this algoritm is optimized for Zigbee devices, when the button is released, a special Zigbee raw command is sent to the light, which stops the transition and answers with the current brightness.
This command is not natively supported by Home Assistant, so I need to send a raw message, that’s why I need the IEEE address.
ZHA Group: same as ZHA ZLL but for Zigbee groups (native Zigbee groups managed through the ZHA integration, doesn’t work with software defined groups like the light_group component).
Note: You may need to click on “reconfigure device” (ZHA device page) if the light doesn’t push back it’s current brightness
Configuration
Input | Value | Notes |
---|---|---|
Light | All the lights you want to turn on/off and dimm | At least one entity is needed, do not add only areas or devices |
Dimmer helper (input_boolean) | An input_boolean helper | You can use the same entity for every instance of this blueprint |
Dimmer helper (input_text) | An input_text helper | You can use the same entity for every instance of this blueprint |
Dimming mode | The algorithm to use, see above | Timestamp may be unstable for now, I need to find a way to address the issue |
IEEE or Group ID | Light’s Zigbee IEEE address if you selected “ZHA ZLL light” as dimming mode, Zigbee group ID if you selected “ZHA Group” | This value doesn’t matter if you’re using Timestamp |
Usage
Once you created an instance of the blueprint, you can start adding automations for your buttons:
If you have a blueprint for your button which support custom actions, use it! Otherwise you can manually create the automations.
When a button is pressed once, add an action, edit the action as yaml and paste:
service: script.<your_script_entity_id>
data:
action: toggle
Note: <your_script_entity_id>
needs to be replaced with the entity_id of the script you previously created with this blueprint.
On the button hold event, add:
service: script.<your_script_entity_id>
data:
action: dimm_auto
On the button hold release event, add:
service: script.<your_script_entity_id>
data:
action: stop
If your remote has separate buttons to dimm up / down the light, you can use the dimm_up
and dimm_down
actions, and the short_up
and short_down
actions for short presses.
Known working blueprints for remotes
Please, let me know down below if you find any working blueprint for your remote
IKEA E1743: (the one with two buttons) for this remote, you can directly use the all-in-one blueprint: https://gist.github.com/notherealmarco/6c7313e0411341d9dd6be40162dd67a9
(Alternative) IKEA E1743: https://github.com/EPMatt/awesome-ha-blueprints/blob/485b52c48bd7429dab7e45ced331920a57ea1363/blueprints/controllers/ikea_e1743/ikea_e1743.yaml
IKEA E1524/E1810: (the one with five buttons) https://github.com/EPMatt/awesome-ha-blueprints/blob/485b52c48bd7429dab7e45ced331920a57ea1363/blueprints/controllers/ikea_e1524_e1810/ikea_e1524_e1810.yaml
Xiaomi WXKG01LM: (the round Mijia one) https://gist.github.com/notherealmarco/9b7218264f40ff934119870d57b2b21b
Blueprint code
Check the incorporation link above