@toggledbits thanks for the help. I will eventually improve this code and apply capabilities only if the device is somewhat new/changed or at startup. OpenSprinklerController is peculiar, but I think I could manage to achieve this result.
This code is shared among my controllers, I've modified them to better handle updates. Thanks!