All possible using CoRE which has the flexibility you require.
All you need to know here: http://thingsthataresmart.wiki/index.php?title=CoRE
And some useful info from @JDRoberts here: