Global functions for use in rules

This is one of the driving requirements behind the creation of the Experimental Rules Engine. Kai’s vision is we would have ready made off the shelf rules that users can download and install from the IoT Marketplace. No more copy and paste from examples in the forum.

So, in addition to lambdas and what might be coming in the future, a great way to handle cross-cutting code like this is Design Pattern: Separation of Behaviors. This is particularly handy for notifications as it lets you add additional logic around alerts more easily (e.g. use a different mechanism at night than during the day).