Simple rule:
rule "Lights"
when
Item VoiceCommand received command
then
var String command = VoiceCommand.state.toString.toLowerCase
logInfo("Voice.Rec","VoiceCommand received "+command)
if (command.contains("christmas lights off")) {
gXmas.sendCommand(OFF)}
else if (command.contains("christmas lights on")) {
gXmas.sendCommand(ON)}
if (command.contains("all lights off")) {
gLight.sendCommand(OFF)}
else if (command.contains("all lights on")) {
gLight.sendCommand(ON)}
end
What’s wrong?
2017-12-27 00:15:06.076 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'voice.rules' is either empty or cannot be parsed correctly!
2017-12-27 00:15:08.416 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'voice.rules'