i bought new smoke detectors “frient smoke detector” with zigbee 3.0. I’m using
“Sonoff Zigbee Gateway ZBDongle-E” as gateway with the zigbee-binding in openHAB.
I have auto discovered the smoke detectors and added items “automatically” to my model.
It seems to work, but i cannot switch on the siren: the item “Fire Alarm” was added as “Switch”, but there is only the text “OFF” - no Switch?!
On zigbee2mqtt i found a documentation for this device:
Blockquote
Triggering alarm, Simple
Can be set by publishing to zigbee2mqtt/FRIENDLY_NAME/set with payload {“alarm”: “START”} and {“alarm”: “OFF”} Set max_duration from the Zigbee2MQTT UI or by publishing {“max_duration”: NEW_VALUE} This alarm are preset to highest volume
Since OH recognizes the Fire Alarm channel as a switch (not a string), I’m guessing that the “Triggering alarm, Simple” method in the z2m documentation doesn’t work. OH wouldn’t know how to send START to switch item.
I extended my rules to switch on all sirens when recieving an alarm of one smoke detector. To disable all sirenes i have created another rule. Here i want to check the state of the item. This does not work.
For debugging purposes i tried to log the following:
The first log statement works, but the second not:
2024-02-07 14:19:52.819 [INFO ] [.script.ui.rauchmelderSirenenAlleAus] - Rauchmelder_Wohnzimmer_Warning_Device (Type=StringItem, State=type=warning duration=PT6S, Label=Warning Device, Category=Siren, Tags=[Point], Groups=[RauchmelderWohnzimmer, Gruppe_Rauchmelder_Sirene])
2024-02-07 14:19:52.828 [ERROR] [b.automation.script.javascript.stack] - Failed to execute script:
org.graalvm.polyglot.PolyglotException: TypeError: invokeMember (getItem) on org.openhab.core.internal.items.ItemRegistryImpl@195180a failed due to: Cannot convert '[object Object]'(language: JavaScript, type: W) to Java type 'java.lang.String': Invalid or lossy primitive coercion.
at <js>.l(@openhab-globals.js:2) ~[?:?]
at <js>.:program(<eval>:9) ~[?:?]
at org.graalvm.polyglot.Context.eval(Context.java:399) ~[?:?]
at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.eval(GraalJSScriptEngine.java:458) ~[?:?]