So for the summer I always move to my sailing boat, one only issues there is that the electricity line is only 6A@230V.
I have an electric heater , an electric water heater and electric oven top but if any of these are active at the same time then the fuse blows. So I would like to make a rule that alternate between these:
- 24 to 07.00 Just heater
- 10.00 to 15.00 Just water heater
- Else 10min heater on then 5 min water boiler on
4: Oventop on(manual switch og gpio on rpi) then water heater and heater off
The first two I can easily do with cron rules, but I am unsure how to combine these with 3 and 4.
Any ideas on how to implement this? My idea is that it needs to be a way to restart cron rules.
rule "Heater on"
when
Time cron "0 * * * " or Time cron "15 * * * " or Time cron "30 * * * " or Time cron "45 * * * "or restart changed from off to On
then
if ovenTop.state = OFF {
WaterBoiler.sendCommand(OFF)
Heater.sendCommand(ON)
}
end
rule "Water Boiler on"
when
Time cron "10 * * * " or Time cron "25 * * * " Time cron "40 * * * " or Time cron "55 * * * " or restart changed from off to On
then
if ovenTop.state = OFF {
Heater.sendCommand(OFF)
WaterBoiler.sendCommand(ON)
}
end
rule "Change oven top"
when oventopSwitch changed then
if oventopSwitch.state = OFF { //changed from ON to OFF
oventop.sendCommand(off)
restart.postUpdate()
}
else{
oventop.sendCommand(on)
restart.postUpdate()
}
end