I don’t really understand what you are asking for here. I suspect you mean a custom device type handler, not a smart app?
If so, it already exists. Mike Maxwell has a universal virtual device type handler which allows any one device to report as a different kind of device. So you could take your virtual switch and have it report as a motion sensor or an open/close door sensor.
I’m not sure about the specialty sensors like a flood Sensor and a smoke sensor. You’d have to check with Mike about that.