I’ve got a bit of an odd one here…I’m using this as a learning experience, so yes, I know it’s fairly over complicated, but I’m okay with that. However, if you have a better way to accomplish this, I’m open to it. Let me know if what I want to do is feasible?
Here’s what I want to do…
This piston is just to control the lights in my house…but a little more than that…basically it will have the ability to be run at any time during the day and it will always set the lights to what they should be at that time.
I have a variable for each device I plan to control throughout the day, so I want it to work a little like this (this is half pseudo code and half webCore syntax, so bear with me):
string DrivewayLightsSwitch = off;
string FishTankSwitch = off;
integer PorchLightLevel = 0;
integer BalconyLightsLevel = 0;
string LivingRoomFanSwitch = off;
Happens at: 5:00AM, Sunrise, Sunset+30, 8:30PM, 10:00PM, 11:30PM
OR
Routine "fix lights" runs
{
IF currentTime >= 5:00AM
DrivewayLightsSwitch = on
FishTankSwitch = on
IF currentTime >= Sunrise
DrivewayLightsSwitch = off
PorchLightLevel = 0
IF currentTime >= Sunset+30
DrivewayLightsSwitch = on
PorchLightLevel = 40
BalconyLightsLevel = 40
IF currentTime >= 8:30PM
FishTankSwitch = off
IF currentTime >= 10:00PM
DrivewayLightsSwitch = off
PorchLightLevel = 20
BalconyLightsLevel = 0
IF currentTime >= 11:30PM
LivingRoomFanSwitch = off
}
Driveway Lights
Set switch to = {DrivewayLightsSwitch};
Fish Tank
Set switch to = {FishTankSwitch};
Porch Light
Set level to = {PorchLightLevel};
Balcony Lights
Set level to = {BalconyLightsLevel};
Living Room Fan
Set switch to = {LivingRoomFanSwitch};