//import org.java.math.* //import org.joda.Date.* rule "bug zapper on" when Time cron "0 00 16 ? * *" then //grpExteriorOutlets.sendCommand(ON) end rule "bug zapper off" when Channel 'astro:sun:home:civilDawn#event' triggered START then //grpExteriorOutlets.sendCommand(OFF) end rule "Civil Dawn - turn off lights" when Channel 'astro:sun:home:civilDawn#event' triggered START then //Ext_Lights.sendCommand(OFF) //Living_Rm_Lights.sendCommand(ON) Ext_1FL_Porch_Lights.sendCommand(OFF) Ext_Garage_Lights.sendCommand(OFF) end rule "Civil Dusk - turn on all lights" when Channel 'astro:sun:home:civilDusk#event' triggered START then //Ext_Front_Lights.sendCommand(ON) //Living_Rm_Lights.sendCommand(ON) Ext_1FL_Porch_Lights.sendCommand(ON) //Ext_Garage_Lights.sendCommand(ON) Ext_2FL_Porch_Lights.sendCommand(ON) //following line is for ext xmas lights //grpExteriorOutlets.sendCommand(ON) end rule "at 1 min past midnight turn off certain lights" when Time cron "0 01 00 ? * *" then Ext_Garage_Lights.sendCommand(OFF) Ext_2FL_Porch_Lights.sendCommand(OFF) grpExteriorOutlets.sendCommand(OFF) Ext_1FL_Porch_Lights.sendCommand(ON) end rule "at 1 min past 2am turn off certain lights" when Time cron "0 1 2 1/1 * ? *" then Ext_1FL_Porch_Lights.sendCommand(OFF) end //scene rules rule "my scenes switch" when Item myScenes changed then switch (myScenes.state) { case 0: { //OFF grpLivingArea.sendCommand(OFF) } case 1: { //Kitchen grpKitchenDimmers.sendCommand(50) grpKitchenSwitches.sendCommand(ON) } case 2: { //TV grpKitchen.sendCommand(OFF) grpLivingRoomDimmers.sendCommand(OFF) grpLivingRoomSwitches.sendCommand(ON) } case 3: { //Hang grpKitchenDimmers.sendCommand(50) grpKitchenSwitches.sendCommand(ON) grpLivingRoomDimmers.sendCommand(15) grpLivingRoomSwitches.sendCommand(ON) } case 4: { //Max grpKitchenDimmers.sendCommand(100) grpKitchenSwitches.sendCommand(ON) grpLivingRoomDimmers.sendCommand(100) grpLivingRoomSwitches.sendCommand(ON) } default: { logInfo("myScenes","incorrect state: {}",myScenes.state) } } end //below this line are old openhab 1.x rules //********************************** //********************************** /* rule "Civil Dawn - turn off all external lights" when Item Civil_Dawn_Event received update ON then //Ext_Lights.sendCommand(OFF) //Living_Rm_Lights.sendCommand(ON) Ext_1FL_Porch_Lights.sendCommand(OFF) Ext_Garage_Lights.sendCommand(OFF) Ext_Outlet1.sendCommand(OFF) end // ************************************ rule "civil dawn offset" when Item Civil_Dawn_Event_Offset received update ON then //Living_Rm_Lights.sendCommand(OFF) end rule "Civil Dusk offset" when Item Civil_Dusk_Event_Offset received update ON then //Living_Rm_Lights.sendCommand(OFF) end */ /* rule "turn testlight on" when Time cron "0 54 16 ? * *" then Living_Rm_Light.sendCommand(100%) end rule "turn testlight off" when Time cron "0 56 16 ? * *" then Living_Rm_Light.sendCommand(OFF) end */