Are you sure the rule is working as intended?
Where does hour get its value?
I would expect the rule only to trigger once, as the Level would either rise from 74 to 75 and then from 75 to 76 or the level would fall from 76 to 75 and then from 75 to 74. If the Item value changes multiple times to 75 (e.g. because of measuring inaccuracy) maybe you should create a hysteresis.
Further create a counter and a timer to send the say command only between 8:00 and 22:00 and only 3 times:
var Boolean bPelletLow = false // signal for low level
var Timer tPelletAlert = null // timer for low level
var Number nCount = 0 // counter for low level
rule "set level low"
when
Item Pellet_Level changed
then
if(bPelletLow) { // already low
if((Pellet_Level.state as Number) > 80) { // received pellets
bPelletLow = false
tPelletAlert?.cancel
nCount = 0
}
} else { // not low
if((Pellet_Level.state as Number) < 75) { // and pellets low
bPelletLow = true
tPelletAlert?.cancel
nCount = 0
tPelletAlert = createTimer(now, [| // create a timer
if(now.getHourOfDay < 8) // too early, reschedule later
tPelletAlert.reschedule(now.withTimeAtStartOfDay.plusHours(8))
else if(now.getHourOfDay > 21) // too late, reschedule tomorrow
tPelletAlert.reschedule(now.withTimeAtStartOfDay.plusHours(32))
else { // correct time...
say("pellet level low", "voicerss:enUS", "chromecast:chromecast:c6443168cc4e99efe89a0ff0de161587")
if(nCount < 2) { // how many times?
nCount += 1 // count up and reschedule
tPelletAlert.reschedule(now.plusMinutes(60))
}
}
])
}
}
end