Shelly 2pm: read physical switch to automate shutter

Hi!
I want my shutters to automatically close or open when I hold the physical up/down button for more than 2 seconds. To archive this I want to use Shelly 2pm relais. I already use the Shellys to control the shutters from HA using automations. How can I read the Input from the physical button in HA?