heres my rule. (The code boxes are missing from the comment window so sorry for the formatting) it triggers and then nothing based upon the if statements based upon month.
"rule “Auto Solar Power Usage”
when
Item Inverter_Generation_Combined changed or
Item Inverter_1_Grid changed
then
createTimer(now.plusSeconds(15), [ |
if (Inverter_1_Grid.state < -3000 && Hot_water_Element_2.state !== OFF)
{
Hot_water_Element_2.sendCommand(OFF)
Hot_water_Element_1.sendCommand(OFF)
}
if (Inverter_1_Grid.state < -5000 && Force_Spa_Heat.state !== ON)
{
if(now.getMonth = 1) {
Spa_Target_Temp.sendCommand(38)
logInfo("Auto Solar Power Usage", "Set Spa Temp To 38")
}
if(now.getMonth = 2) {
Spa_Target_Temp.sendCommand(38)
logInfo("Auto Solar Power Usage", "Set Spa Temp To 38")
}
if(now.getMonth = 3) {
Spa_Target_Temp.sendCommand(39)
logInfo("Auto Solar Power Usage", "Set Spa Temp To 39")
sendNotification("rick@winterandsonroofing.co.nz", "Spa Set To 39.")
}
if(now.getMonth = 4) {
Spa_Target_Temp.sendCommand(39)
logInfo("Auto Solar Power Usage", "Set Spa Temp To 39")
}
if(now.getMonth = 5) {
Spa_Target_Temp.sendCommand(39)
logInfo("Auto Solar Power Usage", "Set Spa Temp To 39")
}
if(now.getMonth = 6) {
Spa_Target_Temp.sendCommand(40)
logInfo("Auto Solar Power Usage", "Set Spa Temp To 40")
}
if(now.getMonth = 7) {
Spa_Target_Temp.sendCommand(40)
logInfo("Auto Solar Power Usage", "Set Spa Temp To 40")
}
if(now.getMonth = 8) {
Spa_Target_Temp.sendCommand(40)
logInfo("Auto Solar Power Usage", "Set Spa Temp To 40")
}
if(now.getMonth = 9) {
Spa_Target_Temp.sendCommand(39)
logInfo("Auto Solar Power Usage", "Set Spa Temp To 39")
}
if(now.getMonth = 10) {
Spa_Target_Temp.sendCommand(39)
logInfo("Auto Solar Power Usage", "Set Spa Temp To 39")
}
if(now.getMonth = 11) {
Spa_Target_Temp.sendCommand(39)
logInfo("Auto Solar Power Usage", "Set Spa Temp To 39")
}
if(now.getMonth = 12) {
Spa_Target_Temp.sendCommand(38)
logInfo("Auto Solar Power Usage", "Set Spa Temp To 38")
}
}
if (Inverter_1_Grid.state > 1000 && Force_Hot_Water_HEAT.state !== ON)
{
Hot_water_Element_2.sendCommand(ON)
Hot_water_Element_1.sendCommand(ON)
}
if (Inverter_1_Grid.state > 1000 && Force_Spa_Heat.state !== ON && Spa_Target_Temp.state !== "33")
{
Spa_Target_Temp.sendCommand(30.0)
}
])