Detecting offline Things in a less stupid way

I just want to clarify, because I am not sure everybody knows it.

This is the standard approach to monitor the status of a thing. Right?

rule "Onkyo offline"
when
    Thing 'onkyo:onkyoAVR:avr1' changed from ONLINE to OFFLINE
then
    logInfo("OnkyoOffline", "Onkyo is offline!")
    sendNotification("me@example.comt", "Onkyo is offline!")
end

rule "Onkyo online"
when
    Thing 'onkyo:onkyoAVR:avr1' changed from OFFLINE to ONLINE
then
    logInfo("OnkyoOnline", "Onkyo is online!")
    sendNotification("me@example.com", "Onkyo is online!")
end

But @dan12345 is right.
There should be an easier way instead of creating these two rules for every thing.
But then again, it is not that hard to copy&paste these rules for new things. :thinking:

4 Likes