I changed settings to defaults in both lua script, exept onTime to one hour.
and today at 18:00 I did set leaving time to 19:00,
variables was:
Code: Select all
CarHeaterSwitchSingleStartTime Time 19:00
CarHeaterSwitchActivationType Integer 1
CarHeaterSwitchOffTime Integer 1478667660 (this came by itself )
so now settings are
Code: Select all
script_time_autolammitysaika.lua
deviceName = "autolammitys2"
switchOffTime = "CarHeaterSwitchOffTime"
switchActivationType = "CarHeaterSwitchActivationType"
lastRunTimeVariable = "CarHeaterSwitchLastRunTime"
wundergroundName = "SaatilaImatra"
switchRecurringStartTime = "CarHeaterSwitchRecurringStartTime"
switchSingleStartTime = "CarHeaterSwitchSingleStartTime"
tempLimit = 1
runInterval = 150
switchOnWindow = 5
debug = true
script_device_autolammityskomp.lua
devicename = "autolammitys2"
switchOffTime = "CarHeaterSwitchOffTime"
switchActivationType = "CarHeaterSwitchActivationType"
onTime = 3600
debug = false
and it logged in after first 2 minutes
Code: Select all
2016-11-09 18:02:00.180 LUA: Car heater switch script running...
2016-11-09 18:02:00.181 LUA: State of CarHeaterSwitchActivationType variable: 1
2016-11-09 18:02:00.181 LUA: Number of current month: 11
2016-11-09 18:02:00.182 LUA: Outside temperature: -4.9
2016-11-09 18:02:00.182 LUA: Car heating time: 30
2016-11-09 18:02:00.182 LUA: Current time in HH:MM: 18:2
2016-11-09 18:02:00.182 LUA: Current time in minutes: 1082
2016-11-09 18:02:00.183 LUA: Recurring start time in HH:MM (time when leaving home): 07:00
2016-11-09 18:02:00.183 LUA: Recurring start time in minutes: 420
2016-11-09 18:02:00.183 LUA: Single start time in HH:MM (time when leaving home): 19:00
2016-11-09 18:02:00.183 LUA: Single start time in minutes: 1140
2016-11-09 18:02:00.183 LUA: Single start time user variable was last time updated in YYYY-MM-DD HH:MM:SS format: 2016-11-09 18:00:06
2016-11-09 18:02:00.183 LUA: Single start time user variable was last time updated in seconds: 1478707206
2016-11-09 18:02:00.185 EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_autolammitysaika.lua
and after 11 minutes, Iam dont understand why that Single start time in minutes doesnt change "LUA: Single start time in minutes: 1140" ?
Code: Select all
2016-11-09 18:11:00.091 LUA: Car heater switch script running...
2016-11-09 18:11:00.092 LUA: State of CarHeaterSwitchActivationType variable: 1
2016-11-09 18:11:00.092 LUA: Number of current month: 11
2016-11-09 18:11:00.093 LUA: Outside temperature: -4.9
2016-11-09 18:11:00.093 LUA: Car heating time: 30
2016-11-09 18:11:00.093 LUA: Current time in HH:MM: 18:11
2016-11-09 18:11:00.093 LUA: Current time in minutes: 1091
2016-11-09 18:11:00.093 LUA: Recurring start time in HH:MM (time when leaving home): 07:00
2016-11-09 18:11:00.094 LUA: Recurring start time in minutes: 420
2016-11-09 18:11:00.094 LUA: Single start time in HH:MM (time when leaving home): 19:00
2016-11-09 18:11:00.094 LUA: Single start time in minutes: 1140
2016-11-09 18:11:00.094 LUA: Single start time user variable was last time updated in YYYY-MM-DD HH:MM:SS format: 2016-11-09 18:00:06
2016-11-09 18:11:00.094 LUA: Single start time user variable was last time updated in seconds: 1478707206
2016-11-09 18:11:00.097 EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_autolammitysaika.lua
and 18:32 not 19:00 when it should, it switched autolammitys2 switch On, and at 19:05 it switched Off.
Code: Select all
2016-11-09 18:32:00.058 LUA: Car heater switch script running...
2016-11-09 18:32:00.058 LUA: State of CarHeaterSwitchActivationType variable: 1
2016-11-09 18:32:00.058 LUA: Number of current month: 11
2016-11-09 18:32:00.059 LUA: Outside temperature: -4.8
2016-11-09 18:32:00.059 LUA: Car heating time: 30
2016-11-09 18:32:00.060 LUA: Current time in HH:MM: 18:32
2016-11-09 18:32:00.060 LUA: Current time in minutes: 1112
2016-11-09 18:32:00.060 LUA: Recurring start time in HH:MM (time when leaving home): 07:00
2016-11-09 18:32:00.060 LUA: Recurring start time in minutes: 420
2016-11-09 18:32:00.060 LUA: Single start time in HH:MM (time when leaving home): 19:00
2016-11-09 18:32:00.060 LUA: Single start time in minutes: 1140
2016-11-09 18:32:00.061 LUA: Single start time user variable was last time updated in YYYY-MM-DD HH:MM:SS format: 2016-11-09 18:00:06
2016-11-09 18:32:00.061 LUA: Single start time user variable was last time updated in seconds: 1478707206
2016-11-09 18:32:00.061 LUA: autolammitys2 switched on
2016-11-09 18:32:00.069 EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_autolammitysaika.lua
2016-11-09 18:32:00.126 LUA: Car heater switch companion script running...
2016-11-09 18:32:00.107 (RFXtrx433E) Lighting 2 (autolammitys2)
..
2016-11-09 19:05:00.462 LUA: Car heater switch script running...
2016-11-09 19:05:00.462 LUA: State of CarHeaterSwitchActivationType variable: 1
2016-11-09 19:05:00.463 LUA: Number of current month: 11
2016-11-09 19:05:00.463 LUA: autolammitys2 switched off
2016-11-09 19:05:00.467 EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_autolammitysaika.lua
2016-11-09 19:05:01.465 LUA: Car heater switch companion script running...
2016-11-09 19:05:01.467 EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_device_autolammityskomp.lua
2016-11-09 19:05:01.447 (RFXtrx433E) Lighting 2 (autolammitys2)