This object is in archive! 
Adding hours, minutes and/or seconds to a time?
Need Answer
Hi,
I want to check whether an event occurs within, lets say, 30 minutes of another event e.g. the sunset. I have successfully been able to "filter out" the time of the sunset via the virtual weather station. How can I add 30 minutes to that time to be able to compare it to the current time? The +-operator does not seem to be working with times.
/Henrik
No connection
Real-time notifications may not work
Henrik,
Unfortunately, Zipato stuff doesn't have any support for time and date outside of the schedulers. The variables cannot hold numbers large enough to work with UnixTime or similar, even if you were to retrieve the values from external sources.
A workaround would be to work with *minute* counter variables, and to have a rule scheduled to run every minute to increment that variable. This way, you only add 1880 per day, and can fairly easily device a way to reset and start over if you hit the maximum number allowed.
By having a global variable holding the minute count, you can access this in your other rules and thus check if x minutes have lapsed since whenever...
Henrik,
Unfortunately, Zipato stuff doesn't have any support for time and date outside of the schedulers. The variables cannot hold numbers large enough to work with UnixTime or similar, even if you were to retrieve the values from external sources.
A workaround would be to work with *minute* counter variables, and to have a rule scheduled to run every minute to increment that variable. This way, you only add 1880 per day, and can fairly easily device a way to reset and start over if you hit the maximum number allowed.
By having a global variable holding the minute count, you can access this in your other rules and thus check if x minutes have lapsed since whenever...
I think I have it working. I wanted to have a rule activate a light between one hour before sunset and one hour after sunrise. I created to variables for that that get populated in a scheduled rule.
I think I have it working. I wanted to have a rule activate a light between one hour before sunset and one hour after sunrise. I created to variables for that that get populated in a scheduled rule.
use the astro offset in the scheduler, +30. This will trigger teh scheduler 30 minutes after sunset. Then you can compare this to the time now.
use the astro offset in the scheduler, +30. This will trigger teh scheduler 30 minutes after sunset. Then you can compare this to the time now.
Henrik,
Unfortunately, Zipato stuff doesn't have any support for time and date outside of the schedulers. The variables cannot hold numbers large enough to work with UnixTime or similar, even if you were to retrieve the values from external sources.
A workaround would be to work with *minute* counter variables, and to have a rule scheduled to run every minute to increment that variable. This way, you only add 1880 per day, and can fairly easily device a way to reset and start over if you hit the maximum number allowed.
By having a global variable holding the minute count, you can access this in your other rules and thus check if x minutes have lapsed since whenever...
Henrik,
Unfortunately, Zipato stuff doesn't have any support for time and date outside of the schedulers. The variables cannot hold numbers large enough to work with UnixTime or similar, even if you were to retrieve the values from external sources.
A workaround would be to work with *minute* counter variables, and to have a rule scheduled to run every minute to increment that variable. This way, you only add 1880 per day, and can fairly easily device a way to reset and start over if you hit the maximum number allowed.
By having a global variable holding the minute count, you can access this in your other rules and thus check if x minutes have lapsed since whenever...
Robert, I was trying to get in touch with you. I remember you mentioned you use Life360 and successfully integrated it to zipabox to track locations. what "between"service are you using to connect life360 with the virtual sensor?
Robert, I was trying to get in touch with you. I remember you mentioned you use Life360 and successfully integrated it to zipabox to track locations. what "between"service are you using to connect life360 with the virtual sensor?
I just posted this, which might be of interest:
https://community.zipato.com/topic/a-method-for-creating-manipulable-time-and-date-values
I just posted this, which might be of interest:
https://community.zipato.com/topic/a-method-for-creating-manipulable-time-and-date-values
Replies have been locked on this page!