webCoRE - Sensor unavailable status

Hi there,

I am trying to create a piston that will warn me whenever a sensor changes it’s status to “unavailable” in order to fix these kind of issue quickly.
I am not sure how to use this attribute and what exactly its code should be.

Does someone has experience with this?

Thank you in advance,
Florin

Yeah, there is a pseudo attribute in webCoRE called $status - just be aware that there is no way right now to get events when the values change, like you would with regular attributes. So you’d need a timer

define
   device devs;
end define;

every 5 minutes do
   if
      any of (add many devices here)’s $status is not ‘ONLINE’ (save matching list to variable devs)
   then
      Send notification “{devs} are offline”
   end if;
end every;

This is a very basic solution - you probably want a notification when the list changes, not every five minutes, but that’s good enough to get you started.

Mult succes

Hello,

Thank you for the quick reply. The example you sent is very useful.

Multumesc mult!

Hey @ady624

I tried your example but it is not always working fine as some of devices doesn’t use “ONLINE” status, but “ACTIVE”

Is that modification correct:

$status is not any of 'ONLINE|ACTIVE'

Basically or should it be "is not any of ‘ONLINE&ACTIVE’ " ??

You need to use a comma separated list. 'ONLINE,ACTIVE'

1 Like

Thanks man.