So i´m trying to get a Alarm Setting working on Openhab.
I have two Groups which are definied as CONTACT Groups
Group:Contact:OR(OPEN, CLOSED) Fensterdummy "Dummy Fenster Kontakt [(%d)]"
Group:Contact:OR(OPEN, CLOSED) Griffdummy "Dummy Fenster Griff [(%d)]"
I have a rule which checks if there is a State OPEN and send those Items via TTS to Alexa, so she tells me which Window(s) i have to close before leaving the House.
rule "alarm + fenster abfrage"
when
Item Testswitch3 received command ON
then
val OffeneFenster = Fensterdummy.members.filter[ i | i.state == OPEN ].map[ label ].reduce[ s, label | s + ", " + label ]
val AngekippteFenster = Griffdummy.members.filter[ i | i.state == OPEN ].map[ label ].reduce[ s, label | s + ", " + label ]
if( Fensterdummy.state == "OPEN" || Griffdummy.state == OPEN) {
Testswitch3.postUpdate(OFF)
EchoWohnzimmerTextToSpeech.sendCommand("Achtung, der Alarm wurde nicht aktiviert, da folgende Fenster noch geöffnet sind. " + AngekippteFenster + ", " + OffeneFenster)
}
end
so now when both Groups are OPEN and i trigger the Rule
estswitch3 changed from OFF to ON
2019-10-18 13:17:42.500 [vent.ItemStateChangedEvent] - Testswitch3 changed from ON to OFF
2019-10-18 13:17:42.504 [ome.event.ItemCommandEvent] - Item 'EchoWohnzimmerTextToSpeech' received command Achtung, der Alarm wurde nicht aktiviert, da folgende Fenster noch geöffnet sind. Griff Wohnzimmer, Küchenfenster
everything is fine ( bothe Windows which are opened are correctly recognized via TTS)
When i close the Windows so my Group
Group:Contact:OR(OPEN, CLOSED) Fensterdummy "Dummy Fenster Kontakt [(%d)]"
switches to CLOSED (LOG)
Fensterdummy changed from OPEN to CLOSED through Fenster_Kuechedummy
and i trigger the rule again, i got some error in the TTS
Item 'Testswitch3' received command ON
2019-10-18 13:21:34.250 [ome.event.ItemCommandEvent] - Item 'EchoWohnzimmerTextToSpeech' received command Achtung, der Alarm wurde nicht aktiviert, da folgende Fenster noch geöffnet sind. Griff Wohnzimmer, null
i cant figure out why the hell she is always telling null...seems like my group is undef but it
s not
The group which is closed always end up in a NULL TTS…
Can somone help here pls ?