The Virtual Crib - Home Automation Software Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
How To: Sunrise Sunset times via Insteon PLC
Goto page Previous  1, 2
 
Reply to topic    The Virtual Crib - Home Automation Software Forum Index » Virtual Crib general discussion View previous topic
View next topic
How To: Sunrise Sunset times via Insteon PLC
Author Message
SnyperBob



Joined: 22 Aug 2007
Posts: 630
Location: Illinois

Post Reply with quote
Hi, I have a question about times.

Can I do additions and subtractions to time variables? If so, how do I do it?

For instance. I want to do something 5 minutes after SUNRISE. Can I do it like this:
[VARIABLE=SUNRISE] +5

So if SUNRISE is at 07:03. [VARIABLE=SUNRISE] +5 would then be 7:08? I was wondering if this was possible. If not, maybe we could have this implemented in the future

_________________
Visit the vCrib Wiki!

Clever image to be inserted here soon.... Smile
Tue Oct 21, 2008 11:36 pm View user's profile Send private message Visit poster's website AIM Address
Humanzee



Joined: 22 Aug 2007
Posts: 519
Location: Seattle, WA

Post Reply with quote
Yes and no. This works for simple integers but not for time at the moment. See the link below.

However, this is what the sunrise and sunset offset values are for. If you put in a value in the offset that value will automatically be added to the sunrise / sunset values to arrive at the Sunrise Adjusted and Sunset Adjusted variables. Then when you call the "get sunrise" and "Get sunset" commands the Sunrise and Sunset Adjusted will automatically be updated. If you put in a value of -1:00 for sunset offset and the sun sets at 5pm then the "Sunset Adjusted" variable will be created with a value of 4:00 etc. I was thinking about commands to update the offset values based on the civil twilight delay for my area, however it was just simpler to do a monthly change. I think my offset in the winter is like an hour and a half and in the summer its 45 minutes. Then I just change it + or - 9 minutes every month depending on if the days are getting longer or shorter.

The negative number stuff is not quite right in the current version though so you can't set a negative value on a variable via a command. but it will hold if you update it via the settings tab. See this thread. http://thevirtualcrib.com/phpbbdir/viewtopic.php?t=255 Once that is fixed, I can enable my auto offset actions.

_________________
vCrib Tester #1, Forum moderator, using INSTEON devices, X10 sensors and remotes via W800RF, All doors are wired with contact closures.
vCrib Wiki

Last edited by Humanzee on Wed Oct 22, 2008 12:51 am; edited 1 time in total
Wed Oct 22, 2008 12:22 am View user's profile Send private message
Humanzee



Joined: 22 Aug 2007
Posts: 519
Location: Seattle, WA

Post Reply with quote
Just tested some stuff and the process for setting a new variable value by calling another is not working either. I.e. if you try to set a new variable called B to the value of [Variable=A] + 3 the you get a value for variable B of "[Variable=A] + 3" This was working in some previous version but I think it still needs work. You might post a bug report.

For now if you have a variable with a value of 5 and you send a command to update that variable with "- 1" the new value will be 4. If you send "1" it will just overwrite the existing value and replace it with "1". Again, the time manipulation stuff is not working in MASTER.exe 0.0.6.2

_________________
vCrib Tester #1, Forum moderator, using INSTEON devices, X10 sensors and remotes via W800RF, All doors are wired with contact closures.
vCrib Wiki
Wed Oct 22, 2008 12:40 am View user's profile Send private message
SnyperBob



Joined: 22 Aug 2007
Posts: 630
Location: Illinois

Post Reply with quote
ok, thanks for the explaination. I use the sunset/rise offsets, but I wanted another way to 'offset' those values.

Right now I have my lights turn on at SUNSET OFFSET.

If there's motion in either of the rooms between the time of SUNSET OFFSET and 1 AM then I have vCrib turn my lights on. The lights should already be on, but this is just in case an x10 signal was missed at SUNSET OFFSET and the lights are still off. This has happened many a times, and this simple fix works great.

I have vCrib turn my lights OFF at SUNRISE OFFSET. The problem with this is when I get home in the early mornings, all my lights are off. I always arrive home in between SUNRISE OFFSET and SUNRISE....and can't see a damn thing inside the house.

So I made it so vCrib will turn my lights on if there's motion (room occupied) between the times of 1 AM and SUNRISE. Then vCrib turns the lights back off if the room is vacant between 1 am and SUNRISE.

I just noticed that if I'm in the room (room is occupied) up until after SUNRISE time, then the lights stay on. I was just wondering if there's a way I could turn the lights off for good at SUNRISE + 5 minutes. For now I have it set to turn off the lights at SUNRISE again....I'm thinking that would do it. I'll check it out when I get home in a few hours.

This got me wondering though if additions/subrtractions could be made to time variables. For this case, think I have it solved by just turning off the lights at SUNRISE again, so I don't need to do time calculations for this example, but may want to in the near future.

_________________
Visit the vCrib Wiki!

Clever image to be inserted here soon.... Smile
Wed Oct 22, 2008 2:18 am View user's profile Send private message Visit poster's website AIM Address
Humanzee



Joined: 22 Aug 2007
Posts: 519
Location: Seattle, WA

Post Reply with quote
I usually use vacancy to turn off lights regardless of the time of day. If you have a porch light or something that you want to come on at offset time, you can always tell it explicitly when to turn off. To combine occupancy and timed events, you can create time range conditions. So you could have the porch light come on at sunset offset and turn off at 23:59 . For the hours before day break you want it to respond to occupancy only so you could set up a condition that is "Time Range Early Morning" = 00:00 until [Variable=SUNRISE OFFSET]. Then you'd set up an action triggered off of front porch occupancy with the condition of "Time Range Early Morning". You'd also want to put your Vacancy action within this time limit condition so that your porch light does not turn off by itself between sunset offset and 23:59. Remember that time ranges do not like to span the 00:00 mark. so you may need to set up multiple conditions.

To clean up the lighting status then you could create stand alone actions to either trigger vacancy, or do PorchLightOFF at both 00:00 and SUNRISE OFFSET. After SUNRISE OFFSET presumably, you do not need the lights to come on, and as the time range condition you set would now be FALSE the occupancy trigger would fail. I use the porch light example because there is no other light in the house which we would want left on with out the location being occupied.

Also I've found that sun offset may not be pertinent to your lifestyle. For example, regardless of when the sun comes up, my wife still gets up before I do in the morning. So I have the time ranges set to change between when she leaves and when I get up. This way I can define different default brightness levels so that she does not wake me up before my alarm goes off. Likewise, I have time ranges starting at her bed time so that I don't blow on the lights 100% when I come to bed late. In other words, the sunrise and sunset times change more than our wake and sleep patterns.

The other thing I do with time ranges is update the occupancy time out for each location. That way if I walk through the family room at 2 in the morning, the lights do not stay on for 20 minutes. Instead the room vacancy for these hours is set to 2 minutes etc. Of course you could get more elaborate with weekend settings or different security modes for different time outs etc.

One of the problems with completely automatic lighting is that it is automatic. Sometimes you don't want the lights on, so you have to get precise with your motion sensor positioning so that they don't point at the bed, heating vents, or see into adjacent rooms etc. I have not linked the local control of switches on the wall to occupancy, so that I can override a default setting. I.e. turn a light up or OFF. As long as that location does not change its occupancy status then the setting should be persistent. It can be a battle to set appropriate time out and brightness values, however once configured its pretty stable. Most rooms have a 5 minute time out, the family room is like 20 because we move around less in there. Also there are those tricks that change time outs if the bathroom door is closed vs open etc.

SUNSET OFFSET is by far the most valuable for me. I use it for both a condition and a trigger. At SUNSET OFFSET if LOCATION=OCCUPIED then LIGHTS =ON, close the drapes, turn on outdoor lighting or holiday lights etc. I also do a TTS announcement explaining why the lights just turned on.

I may look into finding a good indoor outdoor photocell to hook into a phidget that will give an accurate % of brightness that can help address the need for supplemental lighting during the day. If its dark and stormy, or if the curtains are closed etc.

_________________
vCrib Tester #1, Forum moderator, using INSTEON devices, X10 sensors and remotes via W800RF, All doors are wired with contact closures.
vCrib Wiki
Wed Oct 22, 2008 2:54 pm View user's profile Send private message
SnyperBob



Joined: 22 Aug 2007
Posts: 630
Location: Illinois

Post Reply with quote
Humanzee wrote:


The other thing I do with time ranges is update the occupancy time out for each location. That way if I walk through the family room at 2 in the morning, the lights do not stay on for 20 minutes. Instead the room vacancy for these hours is set to 2 minutes etc. Of course you could get more elaborate with weekend settings or different security modes for different time outs etc.


That's a great idea. I didn't know occupancy time outs could be updated dynamically. How do I do that? Is there a special variable I need to update for each room? Or do I have to create the variable or something?

_________________
Visit the vCrib Wiki!

Clever image to be inserted here soon.... Smile
Wed Oct 22, 2008 9:43 pm View user's profile Send private message Visit poster's website AIM Address
Humanzee



Joined: 22 Aug 2007
Posts: 519
Location: Seattle, WA

Post Reply with quote
Make a new command and look for command type "Object Off Timer" and then choose your location and save it. They may get created automatically. Mine are called "Location Name Timeout Update" Then when you call the command in an action you just put the new value in as a parameter in minutes.
Quote:
Edited:"Set Vacancy Timer" was changed to "Object Off Timer" in 0.0.7.2 +
see: http://thevirtualcrib.com/phpbbdir/viewtopic.php?p=1836#1836


_________________
vCrib Tester #1, Forum moderator, using INSTEON devices, X10 sensors and remotes via W800RF, All doors are wired with contact closures.
vCrib Wiki
Wed Oct 22, 2008 10:19 pm View user's profile Send private message
pomprocker



Joined: 19 Feb 2008
Posts: 69
Location: Mission Viejo, CA

Post Reply with quote
I don't get it....

why not just put in your lat/long in the same area you enter your zip for the weather?

_________________
-Brandt
Sun Aug 30, 2009 12:18 pm View user's profile Send private message AIM Address
Humanzee



Joined: 22 Aug 2007
Posts: 519
Location: Seattle, WA

Post Reply with quote
This method of getting sunrise and sunset it specific to the Insteon PLC hardware. Therefore we are sending command instructions to be carried out specifically by the Insteon.exe application and the Insteon PLC hardware. Currently, if a user does not have an Insteon PLC there would be no point in storing lat. long. anywhere, as there would be no means of retrieving sunrise, sunset times. Thus we don't provide a lat long place to store information that can not be used. If anywhere other than in a command, the lat. long info should be stored in the Insteon.exe application.

The zip code information stored is used as part of the weather process, which is integrated into the master process. Parameters, settings for the master process can be stored in a variety of places where they seem to fit most appropriately as they are not specific to a set of hardware. When and if the weather portion of vcrib is re-written, it may include sunrise and sunset times as part of the data provided by weather.com etc. This would make the need for specific commands setting and retrieving information from the PLC redundant. There would be no need for lat. long. at all.

_________________
vCrib Tester #1, Forum moderator, using INSTEON devices, X10 sensors and remotes via W800RF, All doors are wired with contact closures.
vCrib Wiki
Sun Aug 30, 2009 2:35 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    The Virtual Crib - Home Automation Software Forum Index » Virtual Crib general discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.