In ST (SmartThings) I could enter in times (t1, t2) and that would work in
timeOfDayIsBetween command as shown in def ST below. However, in Hubitat, I have to add "toDateTime" (see def HE below) to get the timeOfDayIsBetween
command to work. Can someone explain this to me or am I setting up my t1 and t2 inputs incorrectly?
BTW, I added the error msg I get from HE if I don't use "toDateTime".
def main(){
dynamicPage(name: "main", title: "Send Hub Events", uninstall: true, install: true){
section("Define Monitoring Time") {
input "t1", "time", title: "From", required: true
input "t1", "time", title: "To", required: true
}
}
}
....stuff......
def ST(evt){
def run_time = timeOfDayIsBetween(t1, t2, new Date(), location.timeZone)
}
def HE(evt){
def run_time = timeOfDayIsBetween(toDateTime(t1), toDateTime(t2), new Date(), location.timeZone)
}
The error is on the def run_time line in HE if I don't use "toDateTime(t1)" and "toDateTime(t2)"
errorgroovy.lang.MissingMethodException: No signature of method: user_app_wrj54_Test3_225.timeOfDayIsBetween() is applicable for argument types:
(java.lang.String, java.lang.String, java.util.Date, sun.util.calendar.ZoneInfo)
values: [2019-05-22T09:00:00.000-0500, 2019-05-22T11:30:00.000-0500, ...] on line 165 (BillsSwitchHandler)