I will often create a basic automation using someone’s blueprint, It usually covers my requirements but if it’s not enough or is too much, I can always modify the YAML manually to add or remove functionality.
There are many blueprints for this device that have been used by many community members and improved over time. You may find one of those as a good starting point for making an automation, as well as being able to manage it in the Home assistant user interface.
Most of these have the functionality to handle the dimming actions of these switches (but may require you to create a number or text helper to temporarily store the level of the dimmer control)
-
Malte (Documentation) - ZHA - IKEA four button remote (Styrbar) for lights (E2001, E2002) https://tinyurl.com/yc4zund5
-
JeffKrz (Documentation) - ZHA – IKEA Styrbar – White Spectrum Lights - [ZHA - IKEA Styrbar - White Spectrum Lights)
-
CybDis (Documentation) ZHA – IKEA Styrbar – White Spectrum Lights - https://tinyurl.com/mu243bh2
-
Keviin Cosmos (Documentation) - IKEA Styrbar E2001-2002 Ultimate Zigbee2MQTT (Z2M) - [IKEA Styrbar E2001-2002 Ultimate Zigbee2MQTT (Z2M))
-
Roberto80 (Documentation) - Zigbee2MQTT STYRBAR (Documentation) - https://tinyurl.com/2neht2zj