Reputation: 469
I have a system where each device is connected to many sensors which monitors the temperature of different assets. So, I propagate the telemetry from the device to each related asset. That is fine. I also set up an inactivity alarm for the devices (following this). The device inactivity alarm triggers appropriately when a device becomes inactive.
Now, I am looking to establish an alarm for asset inactivity. Specifically, I want to trigger an alarm if a sensor becomes disconnected from its associated device, resulting in no data transmission to the asset for more than 15 minutes. In other words, I want to detect when the asset telemetry is not updated due to a sensor being disconnected. How can I implement this functionality?
Upvotes: 0
Views: 268
Reputation: 81
You could use a Generator node as a pulse clock and then compare timestamps. The algoritm would be as follows:
Generator
with your Asset as the originator and a short trigger period.OriginatorTelemetry
node to load the last telemetry of that asset as a string in the metadata
object.TransformationScript
and/or a yellow FilterScript
node.ts
in the metadata
, take the difference with JS Date.now()
and compare it with your desired time threshold (15min=900000ms)By the way, because it would be great to implement a more deep solution for this 'non-signals' events, in our company we have plans to include some hardware trigger for disconections in the future. This way, in case of a shut down in energy, a capacitor/battery/cell would release enough energy to send a msg with {isDisconected : true}
.
Hope being of help.
Upvotes: 0