Yes you can do that, but for each new feature you need new decoders, new parts.
For detection, i need special compunent that detects the rain when it passes certain point, that compunent will inform the system about the train and then you can give an order. But i dont have that yet.... need some more time ($) ....