Shelly and Hue

It should be enough to set detached mode in the Shelly app, and I would assume that the trigger is the correct one (provided that the physical switch is connected to input 1, not 2).

Possibly you need to check other Shelly configuration settings, as sometimes they’re not correct and can cause large delays between switching and Homey triggering. See this.