Schedule Confusion

Using a new Vera Lite, I’ve created two scenes, one to turn certain lights on and one to turn those same lights off. Under “Advanced Settings” I’ve created schedules for those scenes. The lights are to come on 30 minutes before sunset and the the lights are to go off at sunrise. I saved the scenes and schedules. But the lights go on and off at random times. When I check the scenes from the UI, the schedule shows the lights are to go on or off at a specific time, either 00:30:00 for lights going on and 00:00:00 for lights going off. Checking back at the schedules under “Advanced Settings”, they are as I originally set them up. That is, on at 30 minutes before sunset and off at sunrise. Looking at the next schedule event for those scenes, the times are random - the lights are scheduled to go on at 1:08 in the morning and to go off 11:43 at night, for example.

If I change the schedules under Advanced Settings to go on and off at specific times, such as on at 5:30 PM and off at 6:00 AM, everything works as expected.

Through my searches of the forums, I have seen some suggestions to add plug-ins. If that is the best solution, I’ll need some hand-holding on that as I don’t know how to add a plug in. also, it would seem ridiculous to me to have rot resort to a 3rd party fix to a very basic operation.

I would appreciate any help.

A stock Vera is perfectly capable of doing simple On/Off scenes at Sunrise/Sunset offsets, without any plugins.

Making sure I understand your description, you say that schedules set for explicit times work, but schedules based on the calculated sunrise/sunset times trigger at seemingly random times.

This sounds like an issue with your location settings, which Vera uses to calculate sunrise/sunset times. In UI5 go to Setup → Location and make sure that your timezone and city are set correctly. If your city is not present verify that the Longitude and Latitude is correct. http://itouchmap.com/latlong.html

What version of firmware is on your VeraLite? You can see this on SETUP → Firmware. There have been a few recent reports of problems with sunset timing with version 1.6.xxx. At least one has been reported to MCV.

The most reliable fix is to install the Day/Night plugin from [url=http://apps.mios.com/plugin.php?id=3166]MiOS Apps. Then you will find that you can trigger your scenes with Day or Night indicates night or Day or Night indicates day. This plugin has been verified as working on V1.6.

Z-Waver and RexBeckett, thanks a lot for your quick help. My firmware number is 1.6.641. The system has my location correctly so I tried to get the plug-in from MIOS. Nothing is easy with these folks. In my second home i have a Vera 2 and a MIOS account. When I log into that account, it only recognizes the Vera 2, not the Vera Lite at this house. I tried to create another account to recognize this device but it won’t let me because my email address is associated with that existing account. So apparently to effectively use this equipment, you can only buy one device or have more than one email address. Being the capitalist that I am, I would want to sell as many devices as possible regardless of the number of email addresses my customer has.

Okay, enough of the ranting. I’m going to walk away in frustration for now and do other things. I’ll try again later. Thanks again - a lot.

because of the new security in the latest version 1.6.641, MCV you really cannot have a shared account between the latest and older versions of the firmware.

So, you have to deal with the two versions until you upgrade your other devices.

Your new installs, if they start on UI6 will not have to deal with this issue.

If you paste this code into APPS → Develop Apps → Test Luup code (Lua) and then click GO, it will write some diagnostic log messages. See Logs for how to access LuaUPnP.log to see the results. If your Timezone, City, Latitude and Longitude are correct but Sunrise and/or Sunset times are not, I suggest raising an MCV Support ticket.

luup.log("Timezone: " .. luup.timezone .. " hours") luup.log("City: " .. luup.city) luup.log("Latitude: " .. luup.latitude) luup.log("Longitude: " .. luup.longitude) local srtime = os.date("%c",luup.sunrise()) luup.log("Sunrise: " .. srtime) local sstime = os.date("%c",luup.sunset()) luup.log("Sunset: " .. sstime)

Thanks for all the effort RexBeckett. Unfortunately, the code failed. I entered the latitude and longitude values in my location settings. Maybe that will help. The timezone was correct. In a little bit I’ll follow bulldog’s advice and try for the new MIOS account. you guys ought to have better things to do on a Sunday.

Thanks a lot, everyone.

Unfortunately, the code failed.
Something must have gone wrong with the copy/paste process. Try passing it through Notepad or another text editor to make sure it didn't pick up any stray characters from your browser.

:slight_smile: Wanted to let everyone know that the longitude/latitude suggestion worked. At least seems to have worked. Strange. My profile and location had the correct timezone but there wasn’t a lat/long entry. When I followed Z-Waver’s suggestion and entered the lat/long info, the timing straightened out and everything worked as hoped last night and this morning. Apparently, the sunset/sunrise times are determined by lat/long and not time zone. I’ll work on RexBeckett’s suggestions as i would like to understand and take advantage of the plug-ins. Sincere thanks to everyone for your patience and your help.

Apparently, the sunset/sunrise times are determined by lat/long and not time zone.

Actually they are determined by BOTH or more specifically the UTC day/night is determined by lat/long … and then converted to local time using your timezone!

[quote=“Cslagle, post:1, topic:179891”]Using a new Vera Lite, I’ve created two scenes, one to turn certain lights on and one to turn those same lights off. Under “Advanced Settings” I’ve created schedules for those scenes. The lights are to come on 30 minutes before sunset and the the lights are to go off at sunrise. I saved the scenes and schedules. But the lights go on and off at random times. When I check the scenes from the UI, the schedule shows the lights are to go on or off at a specific time, either 00:30:00 for lights going on and 00:00:00 for lights going off. Checking back at the schedules under “Advanced Settings”, they are as I originally set them up. That is, on at 30 minutes before sunset and off at sunrise. Looking at the next schedule event for those scenes, the times are random - the lights are scheduled to go on at 1:08 in the morning and to go off 11:43 at night, for example.

If I change the schedules under Advanced Settings to go on and off at specific times, such as on at 5:30 PM and off at 6:00 AM, everything works as expected.

Through my searches of the forums, I have seen some suggestions to add plug-ins. If that is the best solution, I’ll need some hand-holding on that as I don’t know how to add a plug in. also, it would seem ridiculous to me to have rot resort to a 3rd party fix to a very basic operation.

I would appreciate any help.[/quote]

I recently purchased a Vera Light, and upgraded it to UI6.

I was able to enter a schedule based on sunrise/sunset in the UI6 advanced settings, however it doesn’t really show up in the “regular” interface.
How is it supposed to show up?

Coming back to this thread after over a year… I too had the problem of a scene triggering at the wrong time for “sunset”, and RexBeckett’s suggested code (post #5) not working. 2 issues:

  1. The code will throw an exception if values aren’t set. In my case, “city” wasn’t set, and so in the UI (UI5, BTW) there was a simple alert that the code failed (which wasn’t helpful), but tailing the lua log showed the problem.

  2. I was having a tough time figuring out where to enter the city. It turns out that some server somewhere needs to be contacted after you enter the timezone in order to populate the rest of the page. So when you go to Setup/Location you only see Date Format, Timezone, and Temperature Format. After setting the timezone you may need to wait a long time (almost a minute in my case) before additional information is populated below on the page. Incremental selections (country, region, etc.) expose additional information, again, possibly slowly. Eventually you’ll be able to enter the city, and then subsequent visits to Setup/Location will show the city without having to wait.

Hope this helps someone…

Doug