In the same style of the ZHA Philips Hue Dimmer blueprint that I shared here, I’ve made one for the TRADFRI On/Off switch as well.
The actions are mapped to the zha events associated with the specific device, and the blueprint will only let you select this device in particular.
Please note that as the title says, this only works for ZHA.
This is what the blueprint looks like:
Get it using this link:
Manual install:
TRADFRI Dimmer Config.yaml (github.com)
Please let me know if there’s anything that doesn’t work, though it should be pretty simple and it works fine from my experience using it over the last month.