Page 2 of 3

Re: Can't Get Sunrise / Sunset To Work Properly

PostPosted: Thu Apr 14, 2016 8:28 pm
by WHTNUKL
Thanks for the reply, Jay. So in real-time.... The lights went on at 6:24 PST. There was no entry in the event log to indicate the lights came on. I manually turned the lights off at 6:26, using the wall switch (Levity 1000W, 2203WI). The lights turned on again at 7:24 (sunset PST) as set in the schedules in Indigo. The manual on and off do not register in the event log. Attached is the event log for this afternoon that shows no activity until the 7:24 turn on.

What could be causing the 6:24 turn on?

Can't Get Sunrise / Sunset To Work Properly

PostPosted: Fri Apr 15, 2016 12:14 am
by howartp
Do manual switchings of that switch usually show in the log?

Is this X10 controller the one you can store schedules in that execute themselves; Indigo can't store them but other software can.

I'd be resetting the controller to factory settings first.

EDIT: Sorry, just noticed you already reset it.

Get rid of Indigo 5, disable the one schedule you do have intentionally set and see what happens and report back.

Re: Can't Get Sunrise / Sunset To Work Properly

PostPosted: Fri Apr 15, 2016 5:31 am
by WHTNUKL
How do I get rid of Indigo 5? I haven't found an "uninstall" function. Manual operation of the switches never show up in the event log.

Re: Can't Get Sunrise / Sunset To Work Properly

PostPosted: Fri Apr 15, 2016 5:40 am
by DaveL17
See Jay's post above. There's a link to the instructions.


Sent from my iPhone using Tapatalk

Re: Can't Get Sunrise / Sunset To Work Properly

PostPosted: Fri Apr 15, 2016 8:42 am
by jay (support)
WHTNUKL wrote:
The lights went on at 6:24 PST. There was no entry in the event log to indicate the lights came on.


That indicates that is was not Indigo that caused the lights to go on (Indigo will always report when it sends commands to X10 devices). You may want to try resetting your interface again since it may have something stored in it that's doing it. For the CM15A, reset isn't really easy. You have to unplug it and remove the batteries. Then you have to let it sit like that for a long while - I'd let it sit for an hour.

WHTNUKL wrote:
The manual on and off do not register in the event log.


X10 devices don't report status, nor do they acknowledge that they've completed a command. This is one reason why we don't recommend that technology.

Re: Can't Get Sunrise / Sunset To Work Properly

PostPosted: Mon Apr 03, 2017 7:50 pm
by philipbasile
Jay,

Is there a way to get the sunrise / sunset date time into a variable for use in a sons announcement ?

Thanks

Philip

Re: Can't Get Sunrise / Sunset To Work Properly

PostPosted: Mon Apr 03, 2017 9:06 pm
by DaveL17
:evil:
philipbasile wrote:
Jay,

Is there a way to get the sunrise / sunset date time into a variable for use in a sons announcement ?

Thanks

Philip

I use a trigger that fires whenever the variable isDaylight changes. When the trigger fires, I have it run the following embedded Python script:

Code: Select all
import datetime

sunrise = indigo.server.calculateSunrise()
sunrise = sunrise.strftime("%r")
indigo.variable.updateValue(307432140, sunrise)

sunset = indigo.server.calculateSunset()
sunset = sunset.strftime("%r")
indigo.variable.updateValue(57462192, sunset)

Code: Select all
   Script                          06:29:13 AM
   Script                          07:18:41 PM

If you decide to try it, create two variables and replace the variable IDs in the script with your own (note that the script doesn't print the values to the log--I did that to show the format of the result.)

Re: Can't Get Sunrise / Sunset To Work Properly

PostPosted: Tue Apr 04, 2017 3:59 am
by CliveS
Make a New Schedule Sunrise,
Schedule >Time > Sunrise
Condition > Always
Actions > Type > Variable Actions > Insert Timestamp into Variable > Configure > Save

CliveS

Re: Can't Get Sunrise / Sunset To Work Properly

PostPosted: Tue Apr 04, 2017 5:47 am
by DaveL17
If you choose to use Clive's method, I would recommend using a custom format string for the timestamp, otherwise you'll get a timestamp down to the microsecond and with the date included (which IMO isn't optimal for spoken time). The following format specifiers can also be used in the script above if you choose to go that route.

My personal favorite is:
'%r' --> 01:23:45 PM

You can also try:
%H:%M --> 13:45
%I:%M %p --> 01:23 PM (capital eye not lower el)

You can browse the format specifiers here.

Re: Can't Get Sunrise / Sunset To Work Properly

PostPosted: Tue Apr 04, 2017 5:50 am
by jalves
Here is another way to do it. This uses a short AppleScript process to get the values for sunrise/set. It runs every time the variable IsDaylight changes. When setting this up, first make two variables; Sunrise and Sunset. When the script is run these variables will contain the day and time of the next sunrise/sunset.

Code: Select all
tell application "IndigoServer"
   
   set value of variable "sunrise" to "Sunrise: " & (weekday of (calculate sunrise) as string) & " " & (time string of (calculate sunrise) as string)
   
   
   set value of variable "sunset" to "Sunset: " & (weekday of (calculate sunset) as string) & " " & (time string of (calculate sunset) as string)
   
end tell

Re: Can't Get Sunrise / Sunset To Work Properly

PostPosted: Tue Apr 04, 2017 8:39 am
by jay (support)
philipbasile wrote:
Is there a way to get the sunrise / sunset date time into a variable for use in a sons announcement ?


As you can see, there are a variety of solutions. It also depends on exactly what you want to use it for. @CliveS solution will only maintain the previous sunrise/sunset time (as opposed to what it will be at the next sunrise/sunset). Of course, it won't be that far off so that may be fine for your use. That solution is the least complicated even using the custom format specifier. This is a very future-proof way as well.

@DaveL17's Python script approach is also pretty future-proof and will be more accurate if you're looking for what the next interval will be.

I'd advise against using AppleScript since we've made no secret that AppleScript is legacy and won't be around forever.

Re: Can't Get Sunrise / Sunset To Work Properly

PostPosted: Tue Jun 27, 2017 2:12 pm
by mortenkols
I have problem with sunrise, it shows two different times.

In Indigo preferences there is one time for sunrise, and down to the right, there is another time for the sunrise. Look at the pictures attached.
The sunrise time down to the right its the correct time for sunrise

What could do this?

Re: Can't Get Sunrise / Sunset To Work Properly

PostPosted: Tue Jun 27, 2017 2:44 pm
by RogueProeliator
Umm, is it just me or does the preferences window show the next sunrise is on July 15th, 2085? That is a long time without seeing the sun! :-o

Re: Can't Get Sunrise / Sunset To Work Properly

PostPosted: Tue Jun 27, 2017 2:50 pm
by mortenkols
RogueProeliator wrote:
Umm, is it just me or does the preferences window show the next sunrise is on July 15th, 2085? That is a long time without seeing the sun! :-o


haha. it does. something is wrong 8)

Re: Can't Get Sunrise / Sunset To Work Properly

PostPosted: Tue Jun 27, 2017 2:59 pm
by johnfdl
Must be fake climate news :twisted: