How to properly integrate track lighting into smart home?

See Seperate the input from output - Fibaro Smart Implant where Shelly 2.5 with detached mode is mentioned.