No signature of method: app1522044152693531009223.timeOfDayIsBetween() is applicable for argument types: (java.util.Date, java.util.Date, java.util.Date, sun.util.calendar.ZoneInfo)
this is the method signature i have coded to:
Boolean timeOfDayIsBetween(Date start, Date stop, Date value, TimeZone timeZone)
I did a quick search and that method appears to be a function written by ST; all hits are on ST documentation or their community. You may need to find an equivalent for Groovy.
2. timeOfDayIsBetween (timeStart, timeStop, new Date(), location.timeZone)
Iām getting exceptions for both them:
1. No signature of method: dev1522012292492307448138.runEvery1Minute() is applicable for argument types: (java.lang.String) values: [function] on line 131
2. No signature of method: app1522961901291117552557.timeOfDayIsBetween() is applicable for argument types: (java.lang.String, java.lang.String, java.util.Date, sun.util.calendar.ZoneInfo) values: [05:55, 18:15, Thu Apr 05 14:59:07 CST 2018, sun.util.calendar.ZoneInfo[id=āAmerica/Guatemalaā,offset=-21600000,dstSavings=0,useDaylight=false,transitions=11,lastRule=null]] on line 635
Could you add them on the current code or need to be modify by other similar expression?
add this method to your code for timeOfDayIsBetween. i have kept the method signature the same here so once hubitat adds the method the method itself can be removed but all calls to it will work as is.
Thanks for the quick reply. I tried both methods. With the timeOfDayIsBetween i“m still seeing and error, like values arent in proper format, is there any aditional convertion that i need to add for hubitat? This is what i have:
timeOfDayIsBetween(timeStart, timeStop, new Date(), location.timeZone)
Where timeStart and timeStop come from:
timeStart = new Date(riseTime).format("HH:mm", location.timeZone)
timeStop = new Date(setTime).format("HH:mm", location.timeZone)
Where risetime and settime are:
riseTime = getSunriseAndSunset().sunrise.time
setTime = getSunriseAndSunset().sunset.time
I added the method for timeOfDayIsBetween that u suggest, and got this error now: No signature of method: java.util.Date.before() is applicable for argument types: (java.lang.String) values: [05:52] Possible solutions: before(java.util.Date), clone(), every(), after(java.util.Date), from(java.time.Instant), parse(java.lang.String) on line 145
Any idea what can be wrong?
Also, about he runEvery1Minute method, could you explain a little how to use the function schedule like that? The ā?ā is the value for X in runEveryXMinute in minutes? Or which other options does this function allowed to set and specific time.
Thanks for the help. The explanation was very usefull. Just one more question to this issue.
The ātimeOfDayIsBetweenā i use them for compare to pre defined times. The options could be sunrise, sunset and selected.
For sunset/sunrise i get the value from āgetSunriseAndSunsetā method. But lets said i want another time, like 3 pm. I ask for that value to the user in preferences like this:
My trouble is that the function timeOfDayIsBetween doesnt work when i select the time. This is because system shows them as different time format. When you select time it prints it like this:
2018-04-10T17:59:00.000-0600
And method that works with sunrise/sunset seems to work only with this format:
Tue Apr 10 05:52:00 CST 2018
This didnt happen with ST, how do i make the last time/date convertion before use the timeOfDayIsBetween method?
timeofdayisbetween(...) still doesnt seem to work:
groovy.lang.MissingMethodException: No signature of method: dev152721162040483663351.timeOfDayIsBetween() is applicable for argument types: (java.util.Date, java.util.Date, java.util.Date, sun.util.calendar.ZoneInfo) values: [Fri May 25 12:50:59 UTC 2018, Fri May 25 20:04:54 UTC 2018, ...] on line 662 (poll)
it was added to Apps exclusively, I'll create an issue to add it to Devices as well if that is what is needed? We did not realize people were using it in drivers.
def between = timeOfDayIsBetween(fromTime, toTime, new Date(), location.timeZone)
if (between) { ... do something }
But I get this error: app:8252018-09-01 11:54:54.195:errorgroovy.lang.MissingMethodException: No signature of method: app15357992884481231495811.timeOfDayIsBetween() is applicable for argument types: (java.lang.String, java.lang.String, java.util.Date, sun.util.calendar.ZoneInfo) values: [2018-09-01T01:00:00.000+0100, 2018-09-01T08:00:00.000+0100, ...]