Any advise would be appreciated.
I have developed some very simple time based rules to assist with keeping pace with our busy lives. Each weekday morning, a set of audio messages play to keep the kids on time.
Children it is time eat breakfast.
Children you have 15 minutes remaining.
Children you have 5 minutes remaining.
Children it is time to find your shoes and jackets.
Children it is time to leave for school.
Much like a school bell, they have adapted quite well to the sequence, and Mom and Dad no longer are the ones giving these repeating directions. We have named our audio prompt voice Charles, he also reminds the children to feed the dog, and when bedtime is approaching. Visitors are amazed when Charles speaks.
I have recently developed a couple of new rules, one for each child that similar to spelling quiz, announce their weekly spelling words. So with a simple switch phrase to Alexa, they can simulate a practice test on command, “Alexa turn on Joey’s spelling test.” The kids seem to like it and it generally pronounces the words well enough for recognition. Below is the Rule that I’m using. Here’s my design question. How can I automate the changing of the words on a weekly basis for each child. I’m thinking of things like emailing the list to OH, or using a MQTT message approach. Other ideas going through my head are copy paste into a HABPanel element, but I’m really just looking for how to inject 10 to 20 elements into an ArrayList so I don’t have to edit two rules each week.
TIA,
Tony
var boolean exitFlag = false
rule "Joeys Spelling Test"
when
Item JoeySpell changed to ON
then
logInfo("logSpellingTest","Rule playSound Test")
val myList = newArrayList(
'agreed','thirteen','dream','sneaky','teeth',
'foresee','peach','easterly','cheese',
'greeting','bleachers','beneath','sleeveless',
'proceed','wheat','pleading','fleece',
'clean','squealed','peaceful'
)
logInfo("logSpellingTest","Trying to Speak")
myList.forEach[ str |
logInfo("logSpellingTest","The word is " + str )
say("Spell the word. " + str)
Thread::sleep(8000)
say("" + str)
Thread::sleep(6000)
if(JoeySpell.state == OFF) {
logInfo("Spelling Test turned OFF, exiting.")
return
}
]
JoeySpell.sendCommand(OFF)
end