Hey guys,
so I’m currently fiddling around with starting OH rules through my Echo devices and I noticed that if the last and the new command are identical (not a common scenario though…), the rule is being executed twice. Not sure if I’m doing something wrong here or if that’s within the binding…
Here’s the output (first line is the last command that changes to “alexa”):
2020-08-02 14:57:13.701 [vent.ItemStateChangedEvent] - Echo_Kitchen_LastVoiceCommand changed from schick staubi in die küche to alexa
2020-08-02 14:57:15.398 [vent.ItemStateChangedEvent] - Echo_Kitchen_LastVoiceCommand changed from alexa to schick staubi in die küche
2020-08-02 14:57:16.301 [ome.event.ItemCommandEvent] - Item 'AlexaDoNothing' received command ON
2020-08-02 14:57:25.009 [ome.event.ItemCommandEvent] - Item 'vacuumActionCommand' received command app_zoned_clean[[32654,24967,35754,30367,1]]
2020-08-02 14:57:25.033 [ome.event.ItemCommandEvent] - Item 'vacuumActionCommand' received command app_zoned_clean[[32654,24967,35754,30367,1]]
2020-08-02 14:57:25.056 [ome.event.ItemCommandEvent] - Item 'Echo_Kitchen_TTS' received command OK, Staubi kommt gleich in die Küche. Stell das Wasserschälchen hoch.
2020-08-02 14:57:25.079 [ome.event.ItemCommandEvent] - Item 'Echo_Kitchen_TTS' received command OK, Staubi kommt gleich in die Küche. Stell das Wasserschälchen hoch.
2020-08-02 14:57:25.083 [nt.ItemStatePredictedEvent] - vacuumActionCommand predicted to become app_zoned_clean[[32654,24967,35754,30367,1]]
2020-08-02 14:57:25.110 [nt.ItemStatePredictedEvent] - vacuumActionCommand predicted to become app_zoned_clean[[32654,24967,35754,30367,1]]
2020-08-02 14:57:25.133 [nt.ItemStatePredictedEvent] - Echo_Kitchen_TTS predicted to become OK, Staubi kommt gleich in die Küche. Stell das Wasserschälchen hoch.
2020-08-02 14:57:25.148 [nt.ItemStatePredictedEvent] - Echo_Kitchen_TTS predicted to become OK, Staubi kommt gleich in die Küche. Stell das Wasserschälchen hoch.
2020-08-02 14:57:25.168 [vent.ItemStateChangedEvent] - vacuumActionCommand changed from {"result":["ok"],"id":3622} to app_zoned_clean[[32654,24967,35754,30367,1]]
2020-08-02 14:57:25.172 [vent.ItemStateChangedEvent] - Echo_Kitchen_TTS changed from to OK, Staubi kommt gleich in die Küche. Stell das Wasserschälchen hoch.
2020-08-02 14:57:25.177 [vent.ItemStateChangedEvent] - vacuumActionCommand changed from app_zoned_clean[[32654,24967,35754,30367,1]] to {"result":["ok"],"id":5480}
2020-08-02 14:57:25.189 [vent.ItemStateChangedEvent] - vacuumActionCommand changed from {"result":["ok"],"id":5480} to {"result":["ok"],"id":5481}
2020-08-02 14:57:27.208 [vent.ItemStateChangedEvent] - Echo_Kitchen_TTS changed from OK, Staubi kommt gleich in die Küche. Stell das Wasserschälchen hoch. to
And here’s the rule for it:
when
Member of gEchoLastCommands changed
then
if ((triggeringItem.state != "alexa") && (triggeringItem.state.toString.contains("staubi"))) {
var alexaResponse =""
var roomCoordinates = ""
if (vacMapOrientation.state == ON)
mapOrientation = "Vert"
else
mapOrientation = "Hor"
if(triggeringItem.state.toString == "schick staubi in die küche") {
alexaResponse = "OK, Staubi kommt gleich in die Küche. Stell das Wasserschälchen hoch."
roomCoordinates = transform("MAP","vacuum.map",("kueche" + mapOrientation))
vacuumActionCommand.sendCommand("app_zoned_clean["+roomCoordinates+"]")
}
else if(triggeringItem.state.toString == "schick staubi ins schlafzimmer") {
alexaResponse = "OK, Staubi kommt gleich ins Schlafzimmer. Halt die Katzen zurück!"
roomCoordinates = transform("MAP","vacuum.map",("schlafzimmer" + mapOrientation))
vacuumActionCommand.sendCommand("app_zoned_clean["+roomCoordinates+"]")
}
if(triggeringItem.getGroupNames.contains("Alexa_Kitchen"))
Echo_Kitchen_TTS.sendCommand(alexaResponse)
}
end
Did you have similiar experiences?