template for on/off event