However, during my wintersports holiday, the SD-card in my RapberryPi got corrupted -> No more thermostat control. So my house went from the "fixed" temperature of 15 C to 9.5 C.
The ESPEasy itself is of course capable enough to do this all by itself, so I wanted a backup option which I could control directly..
So I wrote an Android app (see attached reduced images) and created a number of dummy devices.
The ESPEasy is connected to my central heating. The livingroom temperature (via event livingroomtemp) is sent by another ESPEasy with a ds18b20. Both are running on the normal 20191208 ESPEasy version.
This can all be controlled from the webGuid, but I also wanted to be able to do it from my phone, hence the Android app (which I can share by the way).
Devices: And I created a 3 Rules Sets:
Rules Set 1:
Code: Select all
On System#Boot do //When the ESP boots, do
event InitSettings
timerSet,1,20 //Set Timer 1 for the next event in 20 seconds
endon
On Rules#Timer=1 do //When Timer1 expires, do
if [Thermostat#Enabled]=1 and [Thermostat#Automatic]=0 //active and on manual
if [Thermostat#Setpoint]>[Thermostat#Temperature]
TaskValueSet,3,1,1
else
TaskValueSet,3,1,0
endif
endif
if [Thermostat#Enabled]=1 and [Thermostat#Automatic]=1 //active and on auto
if %sysweekday_s%=Sat or %sysweekday_s%=Sun
event weekend
else
event weekday
endif
timerSet,1,15 //Set Timer 1 for the next event in 15 seconds
endon
on weekend do
if %systime% > 07:45:00 and %systime% < 07:45:10
TaskValueSet,2,3,[InitSetpoints#weday]
endif
if %systime% > 07:45:10 and %systime% < 22:30:00
event CheckOnOff
endif
if %systime% < 07:45:00 or %systime% < 22:30:00
TaskValueSet,2,3,[InitSetpoints#wenight]
event CheckOnOff
endif
//timerSet,1,30 //Set Timer 1 for the next event in 30 seconds
endon
on livingroomtemp do
TaskValueSet,2,2,%eventvalue%
endon
Code: Select all
on weekday do
if %systime% > 06:45:00 and %systime% < 06:45:20
TaskValueSet 2,3,[InitSetPointsWeekday#wdmorning]
endif
if %systime% > 06:45:20 and %systime% < 08:00:00
event CheckOnOff
endif
if %systime% > 08:00:00 and %systime% < 08:00:20
TaskValueSet 2,3,[InitSetPointsWeekday#wdday]
endif
if %systime% > 08:00:20 and %systime% < 16:45:00
event CheckOnOff
endif
if %systime% > 16:45:00 and %systime% < 16:45:20
TaskValueSet 2,3,[InitSetPointsWeekday#wdevening]
endif
if %systime% > 16:45:20 and %systime% < 22:15:00
event CheckOnOff
endif
if %systime% < 06:45:00 or %systime% > 22:15:01
TaskValueSet 2,3,[InitSetPointsWeekday#wdnight]
event CheckOnOff
endif
//timerSet,1,30 //Set Timer 1 for the next event in 30 seconds
endon
on CheckOnOff
if Thermostat#Setpoint>Thermostat#Temperature
//TaskValueSetAndRun,3,1,1
GPIO,13,1
else
//TaskValueSetAndRun,3,1,0
GPIO,13,0
endif
endon
Code: Select all
On InitSettings do
TaskValueSet 2,1,1 //enabled
//TaskValueSet 2,1,0 //disabled
TaskValueSet 2,3,18.0 //Setpoint
TaskValueSet 2,4,1 //Auto=1, manual=0
Let,1,15 //wdnight
Let,2,19.5 //wdmorning
Let,3,18.5 //wdday
Let,4,20 //wdevening
TaskValueSet 4,1,[VAR#1]
TaskValueSet 4,2,[VAR#2]
TaskValueSet 4,3,[VAR#3]
TaskValueSet 4,4,[VAR#4]
// weekend
Let,5,15.5 //wenight
Let,6,20 //wemorning
Let,7,20 //weday
Let,8,20.5 //weevening
TaskValueSet 5,1,[VAR#5]
TaskValueSet 5,2,[VAR#6]
TaskValueSet 5,3,[VAR#7]
TaskValueSet 5,4,[VAR#8]
if %sysweekday_s%=Sat or %sysweekday_s%=Sun
event initweekend
else
event initweekday
endif
endon
on initweekend do
if %systime% > 07:45:00 and %systime% < 22:30:00
TaskValueSetAndRun,2,3,[InitSetPointsWeekend#weday]
else
TaskValueSetAndRun,2,3,[InitSetPointsWeekend#wenight]
endif
endon
on initweekday do
if %systime% > 06:45:00 and %systime% < 08:00:00
TaskValueSetAndRun,2,3,[InitSetPointsWeekday#wdmorning]
endif
if %systime% > 08:00:00 and %systime% < 16:45:00
TaskValueSetAndRun,2,3,[InitSetPointsWeekday#wdday]
endif
if %systime% > 16:45:00 and %systime% < 22:15:00
TaskValueSetAndRun,2,3,[InitSetPointsWeekday#wdevening]
endif
if %systime% < 06:45:00 or %systime% > 22:15:01
TaskValueSetAndRun,2,3,[InitSetPointsWeekday#wdnight]
endif
endon
Code: Select all
on CheckOnOff
if Thermostat#Setpoint>Thermostat#Temperature
//TaskValueSetAndRun,3,1,1
GPIO,13,1
else
//TaskValueSetAndRun,3,1,0
GPIO,13,0
endif
endon
What am I doing wrong?
And for those seeing the external address in the Settings: I know it is very dangerous, but I can ssh tunnel via my server with an extra encryption on top of it)