Check out this blueprint to simulate the IKEA TRADFRI Dimmer (2 button version) through ZHA events.
Button
Action
on(short)
Turn the light on
off(short)
Turn the light off
on(long)
Increase brightness
off(long)
Decrease brightness
Get started
Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)
Or import this Blueprint by using the Gist URL: https://github.com/niro1987/homeassistant-config/blob/master/blueprints/automation/niro1987/zha_ikea_tradfri_2button_remote_brightness.yaml
really nice, only thing I would need in addition is to define the start dim level as a field (only when turn on) nice would also to have this empty so it would take the last state.
I’ve deliberately chosen to set the brightness in the turn_on sequence, because I wanted the switch to act as any normal light switch would, with an added benefit of setting the brightness.
Leaving it empty would cause unexpected behavior, as it depends on the previous state. The brightness required is different ‘the next morning’ then it was in the evening.
You are more then welcome to copy and modify the code to your own requirements. Perhaps you can share a link to yours, so that others may enjoy it as well.
THANK YOU! this blueprint is so simple and it just works. i’ve been fighting with getting these stupid things to work for weeks and yours is the first one to finally work
Don’t know why, but it didn’t work yesterday. Re-importing the blueprint and creating a new automation now solved the issue.
Edit: Could have been a zigbee issue. Playing around with the remote, I have noticed a delay of several seconds when turning on or off occurring randomly.