We have sensor readings coming into losant as attributes and a workflow triggered by a device state block, which creates an event if the reading is beyond a limit (using a latch block to prevent creating new events each time state is reported). An example of this would be a temperature sensor creating a HI Temp event, which works as expected. We would like to only allow a new event to be created for this specific sensor/condition if the user has acknowledged or resolved the previously created event. Currently when we have a process that ‘cycles’ up and down there can be multiple events created. Could you recommend a way to accomplish this?
We do something very similar in the recently released Asset Tracker template. There, we base whether to create a new event based not on whether a previous one was resolved, but whether there has been an event logged per shipment (which is tracked on the device).
In your case, I would forget about the Latch Node and use an Event: Get Node instead. Prior to deciding whether to log a new event, use the Event: Get Node to see if there exists a matching event in the “new” state, and only create the event if none are found.
I know this was a long time ago but I am trying to do something similar and it looks like the asset tracker template has changed because there is no more latch or event get node. What can I do to replicate?
I don’t think the Asset Tracker template ever utilized a Latch Node; the OP described using one in their solution and our advice was to use an Event: Get Node instead, and the template does still utilize one of those. Screenshot from one of its workflows is attached.
If you can describe your use case in more detail, I may be able to provide some guidance if this is not working for you.
@Dylan_Schuster
Yes so my problem is I have an alert go off every time the payload comes in and certain sensors are activated. The problem is that technicians cannot go fix it immediately and so the events start getting spammed in our events tab. Instead I would like to have one event get created for each device and then have it update with the number of times that the alert has triggered and add that information to the event instead of creating a brand new one each time
Having access to the event logger template you screenshot above would be helpful but I am not seeing it.
The screenshot is from the Asset Tracker template, which is an application template - as in, you would access this by creating a new application starting from a template. It looks like you are trying to find it in the Template Library within an application, which adds smaller components and demonstrations to existing applications.
I’ve attached an export of the specific workflow here so you don’t have to create a new application from that template.
event-logger-develop.flow (9.9 KB)