How to setup your preferred location for sunset and sunrise conditions

In Apilio, you can setup timeframes that combine times of the day with your local sunset or sunrise times (or just do a sunrise to sunset for a “daytime” condition!):

Just so Apilio knows what’s your local sunset/sunrise time, you will need to setup your preferred location in your profile. You can remove your preferred location at any time.

If you go to Apilio now, there’s a new section in your profile that stores your default personal settings for logicblocks and conditions:

https://app.apilio.com/user/default_personal_settings

To setup your preferred location, click on the map or enter your location manually, for example let’s use this very well known Square:

Tap on “Save” and your location will be set:

To remove your location, you can go back to your default personal settings and delete it. If you have any logicblocks that were using sunset or sunrise as their conditions, these will be made inactive as the times can’t be calculated without the location and it would make the conditions impossible to check.

:bulb: Learn more about time conditions!

2 Likes

When I try to edit my location, I get the message "Oops! Something went wrong.

This page didn’t load Google Maps correctly. See the JavaScript console for technical details."

When I open my Chrome browser (running Windows 10), it says:
"Google Maps JavaScript API error: RefererNotAllowedMapError js?key={I removed the key for privacy reasons } &callback=initMap&libraries=&v=weekly:71 Google Maps JavaScript API error: RefererNotAllowedMapError
https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error

Any ideas? I logged into my Apilio account with my Google Login.

1 Like

Hi @james.a.stratman,
thanks for reporting! We had forgotten to allow the use of the map when accessed with the old domain.
It’s now fixed, but we recommend to use https://app.apilio.com anyway.

2 Likes

Hi. I set up two conditions Sunset - 2200
And 0600 - sunrise

It’s now 2215. The condition sunset - 2200 is false as expect. But the condition 0600-Sunrise is still true. When I expect it to be false

1 Like

Thanks for raising this! We will look into it.

2 Likes

Hi @Drivingforce,
can you use https://sunrise-sunset.org to determine when your current sunrise is at your location and local time?
Because if sunrise is before 6 am, the timecondition will automatically turn into an overnight timeframe, and your result would make sense (or let’s say “work as expected”).

3 Likes

So get round this I would set a time frame 0400 - Sunrise, and then use a trigger at 0600 to evaluate the logiiblock so it works as intended

1 Like

Yes. Depending on the season, you’d then get either a negative (currently) or positive result (in the winter months).

Some times the simpler solutions are easier
AND(Nighttime,OR(0500-0900,1600-2200)): false

  • Nighttime: false
  • OR(0500-0900,1600-2200): false
    • 0500-0900: false
    • 1600-2200: false