Help with Dimmer function

Hi

Can someone help me to write this.

I have Shelly Dimmer 2
Home assistant with node red on a raspberry
Lights thru Deconz

I want to use input 2 on the Shelly Dimmer to on/off/dimming a light in Deconz.
On input 2 on the shelly I have a push button.