Then I would stick with IFTT and a virtual switch. Its probably easier to set up and can be leveraged by CoRe better.
Here is coRe: [OBSOLETE] [BETA MILESTONE 1] CoRE (Community's own Rules Engine)
edit:
link to create a virtual switch (I think this is still valid): FAQ: Creating a virtual Device