PLEG schedule "sunset to sunrise" not working

I’ve created a schedule called “sNightTime” with an OnType of “Absolute” and time of “At or after sunset” (offset 0), and a OffType of “Absolute” and time of “At or after sunrise” (offset 0) All other fields are left as default.

When the schedule is saved, it appears in the list with an On Type of Absolute, On Time of “+00:00:00t”, Off Type of “Absolute” and Off Time of “+00:00:00r”

I created the schedule after sunset last night, and so used to the manual “Toggle Schedule State” to force it true. It was my expectation that this morning at sunrise the schedule would flip to a “false” state. However, it didn’t. The “Last True” is 2016-09-15, 21:21:31.251 (when I manually toggled the state), and the “Last False” is 0.

Am I doing something wrong, are my expectations wrong, or is this a bug?

Edit: added PDF attachment showing the first page of my “status report” (which includes the schedule)

Thanks
Gary

firmware is 1.7.2138
PLEG is 8.11
PLC is 8.17

Thank you
Gary

Did you restart Vera after creating the timers ?

No, only did the reload lua thing. I’ll reboot Vera now and will report in a couple hours how things worked out.

For future reference, under what circumstances is a reboot needed vs just a “reload lua” command? (I’ve created a lot of stuff in PLEG over the past couple of days and this was the first time something didn’t work when it wasn’t my own fault.)

Reboot doesn’t seem to have helped. (It’s past sunset here and the schedule is false.)

I had also created a NEW schedule (in addition to the one mentioned below) that added 30 seconds (00:00:30) to the sunset/sunrise times (so they appear as +00:00:30t and +00:00:00r) and that schedule is also still false.

What’s interesting is that I have a generic Vera built in scene for turning a couple outside lights on at sunset and that scene executed just fine.

I use the Day or Night Plug In for these triggers (I never thought about using the Schedule in PLEG for this), the only time I use Absolute Timers has been for winter-spring and so on.

I use Day and Night as well … but that’s because the Day/Night plugin is my Virtual switch that is typically toggled automatically.
But using the Day and Night Plugin allows me to test the Night logic during the day.

@garyd
Have you tried to turn on debugging and looking at the log file ?

[quote=“RichardTSchaefer, post:6, topic:193739”]@garyd
Have you tried to turn on debugging and looking at the log file ?[/quote]

Not yet. I installed the day/night plugin, added a trigger for it, and changed my conditions to use that for now (instead of querying the sNightTime schedule.) If that works on the “sunrise” transition, then I’ll try (very hard) to remember to turn on debug logging just before sunset tomorrow evening and watch to see if anything pops out at me. (Actually, I’ll set an alarm on my phone for that right now: local sunset should be ~19:26)

If I turn on and change debug logging to be in a standalone file, will the file rotate in a manner similar to LuaUPnP.log? (If so, I need to be careful to catch things at the right time so it doesn’t rotate out. If not, I need to be careful about drive space. Fun balance.)

Take care
Gary

You can send PLEG Debug to it’s own file … and it will not get rotated … You do need to resrtart LUA to pick up the new change.

Turned on debugging (to it’s own file) and watched the log. In particular, I was witness to the log showing when the day/night virtual switch tripped, but nothing whatsoever occurred with the schedule:

Sat Sep 17 19:24:10.113 - TriggerPropertyUpdate:Status
Sat Sep 17 19:24:10.114 - TPU:Status :0=0
Sat Sep 17 19:24:10.115 - TriggerPropertyUpdate:Name:trIsNight State:true Device:87
Sat Sep 17 19:24:10.116 - FireAction:Nothing found for:trIsNight
Sat Sep 17 19:24:10.117 - EvalConditions:Multi Trigger:trIsNight
Sat Sep 17 19:24:10.120 - EvalConditions:Condition:cOfficeMotionOn Trigger:trIsNight Result:false
Sat Sep 17 19:24:10.122 - EvalConditions:Condition:cBasementGarageCancel Trigger:trIsNight Result:false
Sat Sep 17 19:24:10.125 - EvalConditions:Condition:cBasementGarageOpen Trigger:trIsNight Result:false
Sat Sep 17 19:24:10.128 - EvalConditions:Condition:cFrontDoorOpen Trigger:trIsNight Result:false
Sat Sep 17 19:24:10.130 - EvalConditions:Condition:cFrontDoorCancel Trigger:trIsNight Result:false
Sat Sep 17 19:24:10.131 - EvalConditions:Condition:cFrontDoorClosedUnlocked Trigger:trIsNight Result:false
Sat Sep 17 19:24:10.132 - EvalConditions:Condition:cFrontDoorOpenLocked Trigger:trIsNight Result:false
Sat Sep 17 19:24:10.134 - EvalConditions:Condition:cFrontDoorClosedUnlockedExpired Trigger:trIsNight Result:false
Sat Sep 17 19:24:10.135 - TriggerCondition:None
Sat Sep 17 19:24:10.140 - SaveDB:{{name = 'trOfficeMotion', state = false, seq = 1474154595.9163, oseq = 1474154626.8686},{name = 'sOfficeMotionTimer', state = true, seq = 1474154595.9498, oseq = 1474151016.0967},{name = 'pOfficeLux', state = '8', seq = 1474142775.3611, oseq = 1474139168.1624},{name = 'cOfficeMotionOn', state = false, seq = 1474154595.9196, oseq = 1474154626.872},{name = 'cBasementGarageOpen', state = false, seq = 1474150642.2463, oseq = 1474150646.0182},{name = 'trBasementGarageDoorOpen', state = false, seq = 1474150642.2427, oseq = 1474150646.0148},{name = 'cBasementGarageCancel', state = false, seq = 1474150654.6799, oseq = 1474150654.7091},{name = 'sGameRoomStairsSwitchTimer', state = false, seq = 1474150642.2741, oseq = 1474150654.7055},{name = 'sFoyerSwitchTimer', state = false, seq = 1474087127.8869, oseq = 1474087307.1004},{name = 'cFrontDoorOpen', state = false, seq = 1474087127.8539, oseq = 1474087155.322},{name = 'cFrontDoorCancel', state = false, seq = 1473997845.2554, oseq = 1473997845.3017},{name = 'trFrontDoorOpen', state = false, seq = 1474145670.6083, oseq = 1474145678.6022},{name = 'sNightTime', state = false, seq = 1473988891.3514, oseq = 1474053773.611},{name = 'sFrontDoorReLock', state = false, seq = 1474145970.8171, oseq = 1474146010.9317},{name = 'cFrontDoorClosedUnlocked', state = false, seq = 1474145970.7912, oseq = 1474146010.9051},{name = 'cFrontDoorOpenLocked', state = false, seq = 1474146010.9062, oseq = 1474146010.9388},{name = 'cFrontDoorClosedUnlockedExpired', state = false, seq = 1474084922.1093, oseq = 1474084925.0032},{name = 'trFrontDoorLocked', state = true, seq = 1474146010.8983, oseq = 1474145970.785},{name = 'trFoyerLightOff', state = true, seq = 1474145955.5155, oseq = 1474145948.5819},{name = 'trGameRoomStairsOff', state = true, seq = 1474150654.6773, oseq = 1474150580.242},{name = 'trNestIsOff', state = false, seq = 1474000237.1014, oseq = 1474046600.1308},{name = 'p1', state = '50', seq = 1474086994.4218, oseq = 1474086984.7251},{name = 'sAltNightTime', state = false, seq = 0, oseq = 0},{name = 'trIsNight', state = true, seq = 1474154650.1155, oseq = 1474110154.2722},{name = 'pFrontDoorLockPIN', state = 'UserID%3D%223%22%20UserName%3D%22Laci%22', seq = 1474139467.092, oseq = 1474130922.4621},{name = 't1', state = true, seq = 1474139467.077, oseq = 0},}
Sat Sep 17 19:24:10.147 - SaveDB:Memory:364167

It “feels” as if there’s no event that wakes PLEG up at the sunset time (or offset) to let it know it should look at its schedules. (When I use a schedule as a timer, I explicitly call StartTimer() to kick it off. there’s nothing like that here for the sunset/sunrise thing.)

To investigate that theory, I created (well, edited, actually) a schedule called “sAltNight” that is an absolute start of 19:37:00 and an absolute end of 00:00:00. I saved that, reloaded LUA, and watched the logs. At 7:37:00pm, nothing happened in the log. Refresh the status, and the schedule is marked as FALSE.

I’m attaching the first page of the status report showing that this “sAltNight” schedule never got started. (The report was taken 5 minutes after the schedule should have started - the timestamp is at the top of the page.)

@RichardTSchaefer, is absolute scheduling known to be working on firmware 1.7.2138, PLEG 8.11, PLC 8.17? I’m trying to figure out if the problem is with PLEG/PLC or with the vera unit…

Take care
Gary

Edit: In addition to the above, I also tried an absolute schedule with a start time < end time (ie: 19:50 to 23:00) to ensure it wasn’t a problem with an end time that might seem earlier than a start time. It failed. I then tried a start time < end time, and ALSO specified the date (using today’s date for both absolute times) and that also failed. Not sure what else I might be able to try…

The schedules are set when the plugin initializes AFTER a reload.
So I can can’t tell because you did not provide the WHOLE log.

No problem. It just so happens that I copied that portion of the log (after a reload) but didn’t paste it here. This is with a start time of sunset + 5 min:

Sat Sep 17 19:24:10.147 - SaveDB:Memory:364167
Sat Sep 17 19:28:44.615 - Entry:NOW
Sat Sep 17 19:28:44.677 - WatchTriggerProperties:trBasementGarageDoorOpen: urn:micasaverde-com:serviceId:SecuritySensor1Tripped53
Sat Sep 17 19:28:44.699 - WatchTriggerProperties:trFoyerLightOff: urn:upnp-org:serviceId:SwitchPower1Status71
Sat Sep 17 19:28:44.700 - WatchTriggerProperties:trFrontDoorLocked: urn:micasaverde-com:serviceId:DoorLock1Status89
Sat Sep 17 19:28:44.701 - WatchTriggerProperties:trFrontDoorOpen: urn:micasaverde-com:serviceId:SecuritySensor1Tripped68
Sat Sep 17 19:28:44.702 - WatchTriggerProperties:trGameRoomStairsOff: urn:upnp-org:serviceId:SwitchPower1Status52
Sat Sep 17 19:28:44.703 - WatchTriggerProperties:trIsNight: urn:rts-services-com:serviceId:DayTimeStatus87
Sat Sep 17 19:28:44.704 - WatchTriggerProperties:trNestIsOff: urn:upnp-org:serviceId:HVAC_UserOperatingMode1ModeStatus23
Sat Sep 17 19:28:44.705 - WatchTriggerProperties:trOfficeMotion: urn:micasaverde-com:serviceId:SecuritySensor1Tripped30
Sat Sep 17 19:28:44.710 - WatchTriggerProperties:t1: urn:micasaverde-com:serviceId:DoorLock1sl_UserCode89
Sat Sep 17 19:28:44.712 - WatchProperties:p1: 78:urn:upnp-org:serviceId:Dimming1:LoadLevelStatus
Sat Sep 17 19:28:44.713 - WatchProperties:pFrontDoorLockPIN: 89:urn:micasaverde-com:serviceId:DoorLock1:sl_UserCode
Sat Sep 17 19:28:44.714 - WatchProperties:pOfficeLux: 32:urn:micasaverde-com:serviceId:LightSensor1:CurrentLevel
Sat Sep 17 19:28:44.716 - ScheduleEventOn:Data:sFoyerSwitchTimer:6,,,nil
Sat Sep 17 19:28:44.717 - ScheduleEventOn:Data:sFrontDoorReLock:6,,,nil
Sat Sep 17 19:28:44.724 - ScheduleEventOn:Data:sGameRoomStairsSwitchTimer:6,,,nil
Sat Sep 17 19:28:44.724 - ScheduleEventOn:Data:sNightTime:4,+00:00:00t,,
Sat Sep 17 19:28:44.726 - ScheduleEventOn:sNightTime:4,00:00:00t, Result:-1
Sat Sep 17 19:28:44.733 - ScheduleEventOn:Data:sOfficeMotionTimer:6,,,nil
Sat Sep 17 19:28:44.739 - ScheduleEventOff:Data:sOfficeMotionTimer:1,00:30:00,,
Sat Sep 17 19:28:44.740 - ScheduleEventOff:sOfficeMotionTimer:1,1472, Result:0
Sat Sep 17 19:28:44.741 - Entry:sAltIsNight
Sat Sep 17 19:28:44.742 - ScheduleEventOn:Data:sAltIsNight:4,+00:05:00t,,
Sat Sep 17 19:28:44.746 - ScheduleEventOn:sAltIsNight:4,00:05:00t, Result:-1
Sat Sep 17 19:28:44.760 - EvalConditions:Condition:cOfficeMotionOn Trigger:nil Result:false
Sat Sep 17 19:28:44.763 - EvalConditions:Condition:cBasementGarageCancel Trigger:nil Result:false
Sat Sep 17 19:28:44.765 - EvalConditions:Condition:cBasementGarageOpen Trigger:nil Result:false
Sat Sep 17 19:28:44.768 - EvalConditions:Condition:cFrontDoorOpen Trigger:nil Result:false
Sat Sep 17 19:28:44.771 - EvalConditions:Condition:cFrontDoorCancel Trigger:nil Result:false
Sat Sep 17 19:28:44.772 - EvalConditions:Condition:cFrontDoorClosedUnlocked Trigger:nil Result:false
Sat Sep 17 19:28:44.781 - EvalConditions:Condition:cFrontDoorOpenLocked Trigger:nil Result:false
Sat Sep 17 19:28:44.788 - EvalConditions:Condition:cFrontDoorClosedUnlockedExpired Trigger:nil Result:false
Sat Sep 17 19:28:44.791 - TriggerCondition:None
Sat Sep 17 19:28:44.793 - SweepDB:sAltNightTime
Sat Sep 17 19:28:44.797 - SweepDB:NOW
Sat Sep 17 19:28:44.806 - SaveDB:{{name = 'trOfficeMotion', state = false, seq = 1474154595.9163, oseq = 1474154626.8686},{name = 'sOfficeMotionTimer', state = true, seq = 1474154595.9498, oseq = 1474151016.0967},{name = 'pOfficeLux', state = '8', seq = 1474142775.3611, oseq = 1474139168.1624},{name = 'cOfficeMotionOn', state = false, seq = 1474154595.9196, oseq = 1474154626.872},{name = 'cBasementGarageOpen', state = false, seq = 1474150642.2463, oseq = 1474150646.0182},{name = 'trBasementGarageDoorOpen', state = false, seq = 1474150642.2427, oseq = 1474150646.0148},{name = 'cBasementGarageCancel', state = false, seq = 1474150654.6799, oseq = 1474150654.7091},{name = 'sGameRoomStairsSwitchTimer', state = false, seq = 1474150642.2741, oseq = 1474150654.7055},{name = 'sFoyerSwitchTimer', state = false, seq = 1474087127.8869, oseq = 1474087307.1004},{name = 'cFrontDoorOpen', state = false, seq = 1474087127.8539, oseq = 1474087155.322},{name = 'cFrontDoorCancel', state = false, seq = 1473997845.2554, oseq = 1473997845.3017},{name = 'trFrontDoorOpen', state = false, seq = 1474145670.6083, oseq = 1474145678.6022},{name = 'sNightTime', state = false, seq = 1473988891.3514, oseq = 1474053773.611},{name = 'sFrontDoorReLock', state = false, seq = 1474145970.8171, oseq = 1474146010.9317},{name = 'cFrontDoorClosedUnlocked', state = false, seq = 1474145970.7912, oseq = 1474146010.9051},{name = 'cFrontDoorOpenLocked', state = false, seq = 1474146010.9062, oseq = 1474146010.9388},{name = 'cFrontDoorClosedUnlockedExpired', state = false, seq = 1474084922.1093, oseq = 1474084925.0032},{name = 'trFrontDoorLocked', state = true, seq = 1474146010.8983, oseq = 1474145970.785},{name = 'trFoyerLightOff', state = true, seq = 1474145955.5155, oseq = 1474145948.5819},{name = 'trGameRoomStairsOff', state = true, seq = 1474150654.6773, oseq = 1474150580.242},{name = 'trNestIsOff', state = false, seq = 1474000237.1014, oseq = 1474046600.1308},{name = 'p1', state = '50', seq = 1474086994.4218, oseq = 1474086984.7251},{name = 'trIsNight', state = true, seq = 1474154650.1155, oseq = 1474110154.2722},{name = 'pFrontDoorLockPIN', state = 'UserID%3D%223%22%20UserName%3D%22Laci%22', seq = 1474139467.092, oseq = 1474130922.4621},{name = 't1', state = true, seq = 1474139467.077, oseq = 0},{name = 'sAltIsNight', state = false, seq = 0, oseq = 0},}
Sat Sep 17 19:28:44.824 - SaveDB:Memory:340588
Sat Sep 17 19:28:45.846 - CheckRegistration:First:9925451474
Sat Sep 17 19:28:45.872 - RegisterMessage:Installed: 1473560098 You have 1 license, which allows a total of 4 PLEG and/or PLTS plugins.
Sat Sep 17 19:28:45.873 - Registration:Registered: true $1$18X3EKGH$P+d94Z4buZKk0eBJkbfczf
Sat Sep 17 19:28:45.873 - Registration:PLC[4]: 39 PLEG#: 1 PLTS#: 0
Sat Sep 17 19:28:54.101 - DelayedEval:Tripped :0=1
Sat Sep 17 19:28:54.102 - DelayedEval:Status :0=0
Sat Sep 17 19:28:54.103 - DelayedEval:Status :1=1
Sat Sep 17 19:28:54.104 - DelayedEval:Tripped :0=1
Sat Sep 17 19:28:54.105 - DelayedEval:Status :0=0
Sat Sep 17 19:28:54.106 - DelayedEval:Status :0=0
Sat Sep 17 19:28:54.107 - DelayedEval:ModeStatus :CoolOn=Off
Sat Sep 17 19:28:54.108 - DelayedEval:Tripped :0=1
Sat Sep 17 19:28:54.108 - DelayedEval:sl_UserCode :UserID="3" UserName="Laci"=3
Sat Sep 17 19:28:54.110 - WatchProperties:Old: 50 New: 50
Sat Sep 17 19:28:54.110 - WatchProperties:Old: UserID="3" UserName="Laci" New: UserID="3" UserName="Laci"
Sat Sep 17 19:28:54.111 - WatchProperties:Old: 8 New: 8

The only lines matching the schedule name:

Sat Sep 17 19:28:44.742 - ScheduleEventOn:Data:sAltIsNight:4,+00:05:00t,,
Sat Sep 17 19:28:44.746 - ScheduleEventOn:sAltIsNight:4,00:05:00t, Result:-1

Result -1?

You might try to tell it witch days you want the schedule to run … at sunset …

Okay, So I made that change. Log entries on reload:

Sun Sep 18 00:46:31.024 - Entry:sAltIsNight
Sun Sep 18 00:46:31.024 - ScheduleEventOn:Data:sAltIsNight:2,+00:00:00t,1,2,3,4,5,6,7,
Sun Sep 18 00:46:31.027 - ScheduleEventOn:sAltIsNight:2,00:00:00t,1,2,3,4,5,6,7 Result:0

If a result of -1 indicates an error, the 0 likely indicates success. So, this is more promising than earlier.

Of course, the schedule didn’t auto-set to true, so I did it manually with the toggle button and I’ll check in the morning to see if it sets itself back to false after sunrise. Here’s the log entries after manually toggling it:

Sun Sep 18 00:48:48.673 - FireAction:Nothing found for:sAltIsNight
Sun Sep 18 00:48:48.674 - ScheduleEventOn:Data:sAltIsNight:2,+00:00:00t,1,2,3,4,5,6,7,
Sun Sep 18 00:48:48.677 - ScheduleEventOn:sAltIsNight:2,00:00:00t,1,2,3,4,5,6,7 Result:0
Sun Sep 18 00:48:48.678 - ScheduleEventOff:Data:sAltIsNight:2,+00:00:00r,1,2,3,4,5,6,7,
Sun Sep 18 00:48:48.680 - ScheduleEventOff:sAltIsNight:2,00:00:00r,1,2,3,4,5,6,7 Result:0

[quote=“garyd9, post:13, topic:193739”]… I’ll check in the morning to see if it sets itself back to false after sunrise.[/quote]I did transition to ‘false’ around the proper time this morning. :slight_smile: Will check again in the evening.

Edit: It also transitioned to ‘true’ at around the proper time this evening. So, this works.

Is using a “day of the week” schedule (instead of absolute) a work-around for an issue with absolute, or was I using “absolute” improperly?

Absolute is ONE Day each year.

I had this same problem and just posted elsewhere. I’ll delete. Perhaps in a later iteration you could add a “Daily” option? I know how hard it is to make a GUI intuitive, but I also misinterpreted the meaning of “absolute”.

Thanks.