A little clunky, but it’s working for now… thanks!!
rule "ac timer"
when
Item LastVoiceCommand_Everywhere received update
then
if (LastVoiceCommand_Everywhere.state.toString.startsWith ("turn on the upstairs den ac for")) {
val actimer1 = LastVoiceCommand_Everywhere.state.toString().replace("turn on the upstairs den ac for ", "").replace("minute","").replace("s","").replace("one", "1").replace("two", "2").replace("three", "3").replace("four", "4").replace("five", "5").replace("six", "6").replace("seven", "7").replace("eight", "8").replace("nine", "9").replace("ten", "10").replace("eleven", "11").replace("twelve", "12").replace("thirteen", "13").replace("fourteen", "14").replace("fifteen", "15").replace("sixteen", "16").replace("seventeen", "17").replace("eightteen", "18").replace("nineteen", "19").replace("twenty", "20").replace("twenty one", "21").replace("twenty two", "22").replace("twenty three", "23").replace("twenty four", "24").replace("twenty five", "25").replace("twenty six", "26").replace("twenty seven", "27").replace("twenty eight", "28").replace("twenty nine", "29").replace("thirty", "30").replace("thirty one", "31").replace("thirty two", "32").replace("thirty three", "33").replace("thirty four", "34").replace("thirty five", "35").replace("thirty six", "36").replace("thirty seven", "37").replace("thirty eight", "38").replace("thirty nine", "39").replace("fourty", "40").replace("fourty one", "41").replace("fourty two", "42").replace("fourty three", "43").replace("fourty four", "44").replace("fourty five", "45").replace("fourty six", "46").replace("fourty seven", "47").replace("fourty eight", "48").replace("fourty nine", "49").replace("fifty", "50").replace("fifty one", "51").replace("fifty two", "52").replace("fifty three", "53").replace("fifty four", "54").replace("fifty five", "55").replace("fifty six", "56").replace("fifty seven", "57").replace("fifty eight", "58").replace("fifty nine", "59").replace("sixty", "60").replace(" ","")
sendCommand(actimer,actimer1)
sendCommand(Speak_Everywhere_Final,"Ok, upstairs den AC will turn off in " + actimer1 + " minutes")
if (actimer1 == "1"){createTimer(now.plusMinutes(1), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "2"){createTimer(now.plusMinutes(2), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "3"){createTimer(now.plusMinutes(3), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "4"){createTimer(now.plusMinutes(4), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "5"){createTimer(now.plusMinutes(5), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "6"){createTimer(now.plusMinutes(6), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "7"){createTimer(now.plusMinutes(7), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "8"){createTimer(now.plusMinutes(8), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "9"){createTimer(now.plusMinutes(9), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "10"){createTimer(now.plusMinutes(10), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "11"){createTimer(now.plusMinutes(11), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "12"){createTimer(now.plusMinutes(12), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "13"){createTimer(now.plusMinutes(13), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "14"){createTimer(now.plusMinutes(14), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "15"){createTimer(now.plusMinutes(15), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "16"){createTimer(now.plusMinutes(16), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "17"){createTimer(now.plusMinutes(17), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "18"){createTimer(now.plusMinutes(18), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "19"){createTimer(now.plusMinutes(19), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "20"){createTimer(now.plusMinutes(20), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "21"){createTimer(now.plusMinutes(21), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "22"){createTimer(now.plusMinutes(22), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "23"){createTimer(now.plusMinutes(23), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "24"){createTimer(now.plusMinutes(24), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "25"){createTimer(now.plusMinutes(25), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "26"){createTimer(now.plusMinutes(26), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "27"){createTimer(now.plusMinutes(27), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "28"){createTimer(now.plusMinutes(28), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "29"){createTimer(now.plusMinutes(29), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "30"){createTimer(now.plusMinutes(30), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "31"){createTimer(now.plusMinutes(31), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "32"){createTimer(now.plusMinutes(32), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "33"){createTimer(now.plusMinutes(33), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "34"){createTimer(now.plusMinutes(34), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "35"){createTimer(now.plusMinutes(35), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "36"){createTimer(now.plusMinutes(36), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "37"){createTimer(now.plusMinutes(37), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "38"){createTimer(now.plusMinutes(38), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "39"){createTimer(now.plusMinutes(39), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "40"){createTimer(now.plusMinutes(40), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "41"){createTimer(now.plusMinutes(41), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "42"){createTimer(now.plusMinutes(42), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "43"){createTimer(now.plusMinutes(43), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "44"){createTimer(now.plusMinutes(44), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "45"){createTimer(now.plusMinutes(45), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "46"){createTimer(now.plusMinutes(46), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "47"){createTimer(now.plusMinutes(47), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "48"){createTimer(now.plusMinutes(48), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "49"){createTimer(now.plusMinutes(49), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "50"){createTimer(now.plusMinutes(50), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "51"){createTimer(now.plusMinutes(51), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "52"){createTimer(now.plusMinutes(52), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "53"){createTimer(now.plusMinutes(53), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "54"){createTimer(now.plusMinutes(54), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "55"){createTimer(now.plusMinutes(55), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "56"){createTimer(now.plusMinutes(56), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "57"){createTimer(now.plusMinutes(57), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "58"){createTimer(now.plusMinutes(58), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "59"){createTimer(now.plusMinutes(59), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
if (actimer1 == "60"){createTimer(now.plusMinutes(60), [ | sendCommand(Upstairs_Den_AC,"OFF")])}
}
end