fanavity
(Patrik)
January 17, 2021, 11:18am
1
Hello,
i use oh3 and search a generic method to send a telegram message if a thing goes offline. I don’t want create a rule for every thing manually. Is it possible to automatically it? With oh2 I was not able to do it. Maybe it was possible, but I couldn’t get it to work.
I hope you can help me
rossko57
(Rossko57)
January 17, 2021, 1:40pm
2
There’s an OH2 method in here for responding to Thing status changes. It should be possible to adapt this for OH3, and probably make it slicker.
You can achieve that by being creative with the next-gen rule engine (NGRE) and the core.GenericEventTrigger module type and listen to a certain type of event, here ThingStatusInfoChangedEvent.
Unfortunately the trick is, this module type is “internal” so you can’t see it in Paper UI.
But you can use the Karaf console to add the rule anyway.
Create a file somewhere on your filesystem, for instance /tmp/thingstatus.json with this content:
[
{
"uid": "thingStatusChanged",
…
fanavity
(Patrik)
January 17, 2021, 1:45pm
3
Do you have an example for me? I’m not able to adapt it from your text