Incorporation URL: https://gist.github.com/bstenborg/1731775b26541d607584aea102d53236#file-smart_dimmer-yaml
This Blueprint creates 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)
It works by providing functions for toggling and dimming the group.
Timestamp: this mode 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 mode has a known issue: sometimes the lights jumps to a completely different brightness when the button is released.
ZHA ZLL: this mode 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).
Zigbee2MQTT: If using Zigbee2MQTT instead of ZHA. Only works with lights that support the brightness_move
command.
Note: You may need to click on "reconfigure device" (ZHA device page) if the light doesn't push back it's current brightness
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" or "Zigbee2MQTT" as dimming mode, Zigbee group ID if you selected "ZHA Group" (GROUP IDs IN DECIMAL NOTATION) | This value doesn't matter if you're using Timestamp |
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.
Please, let me know down below if you find any working blueprint for your remote
IKEA E1743: for this remote, you can directly use the all-in-one blueprint: https://gist.github.com/notherealmarco/6c7313e0411341d9dd6be40162dd67a9
(Alternative) IKEA E1743: (the one with two buttons) https://github.com/EPMatt/awesome-ha-blueprints/blob/main/blueprints/controllers/ikea_e1743/ikea_e1743.yaml
IKEA E1524/E1810: (the one with five buttons) https://github.com/EPMatt/awesome-ha-blueprints/blob/main/blueprints/controllers/ikea_e1524_e1810/ikea_e1524_e1810.yaml
Xiaomi WXKG01LM: (the round Mijia one) https://gist.github.com/notherealmarco/9b7218264f40ff934119870d57b2b21b
Smart Dimmer: A dimmer for everyone
I am super happy with this blueprint!! :slight_smile: , but there is one thing I would like to see (preferably) differently.
The lights do not go fluently from one state to another state (not smooth/no transition time).
So, it’s more like a flickering lights when the lux values changes, especially during the winter and autumn.
Is this something that can be added to this blueprint (not using additional scripts and so on/no added complexity)?
Thank you in advance!!