dxdc / ifttt-if-sunrise-and-action

IFTTT applet to use sunset/sunrise times as an additional if/then trigger for when to run an action
MIT License
4 stars 0 forks source link

sun culmination #2

Closed boelle closed 3 years ago

boelle commented 3 years ago

i'm not sure how to add this and if it can even be done

but i'm trying to find a way to start my roomba at sun culmination, where its brightest

problem is that in winter time there is not enough light for the roomba to find its way, but mid between sunrise and sunset it can work

https://www.suncalc.org/#/55.3962,10.3908,11/2020.12.13/17:52/1/3 shows the culmination time

dxdc commented 3 years ago

If I understand what you want, your idea is unrelated to the original project.

The original project adds an extra "IF" condition, relating to sun angle, for an event. For example, if motion is detected, or if XYZ happens; then, it will check if the current time falls between certain sun angles and decide whether or not to skip the action.

What you want is an actual event driven by sun angle. E.g., once the sun angle is at a specific point, then do an action. There are some functionalities like this built into IFTTT, but only for sunrise and sunset as far as I know. You can check these for Weather Underground.

If you'd like to use IFTTT, the best way is something like this: https://ifttt.com/maker_webhooks

Then, have an external trigger call this webhook when the time is correct.

Something simple can be used to do this for free, if you use Google Apps Script. You could probably also find a free API which could give you parameters like solarNoon which is I think closer to what you're looking for.

https://mashe.hawksey.info/2017/12/using-ifttt-with-google-apps-script-for-delayed-that-triggers-and-more/

boelle commented 3 years ago

but only for sunrise and sunset as far as I know

yep, i checked those, i need one in between those

If you'd like to use IFTTT

does not have to be, but i also found that irobot have made a few aplets. they also have google home integration

but i will try and continue my search and see what i can find out, if nothing else i will add a switch to the robot so light is turned on if a cleaning run is started

dxdc commented 3 years ago

yep, i checked those, i need one in between those

In this case, you can do the following:

  1. Set an IFTTT trigger to run at a specific time (e.g., 12:00, which may/may not work for your use case)... or
  2. Use Google Apps Script (or some other kind of cron job) to create a daily timer to run at an early hour, suppose 5am. Then, at 5am, it will run a script which will calculate the correct SolarNoon for the day (or 1/2 way between sunrise and sunset). It will then create set a one-time timer to run in X minutes from the previous calculation. Upon completion, this timer will call the IFTTT maker webhook URL.
  3. Do a similar action, except on a local machine, e.g. via something like sunwait (http://www.risacher.org/sunwait/)
boelle commented 3 years ago

https://www.reddit.com/r/roomba/comments/kbt2hv/start_roomba_at_sun_culmination/

it turns out that it changes slightly over a year but an avg time of 12:52 for my location is not far off