Looking for a way to change map marker color for events

I am looking for a way to change the color for a device that currently has an unacknowledged event tied to it. I see where I could do this in the Point Configuration script but am having trouble finding a way to tie the events to the device to do a check at that point. Is this possible?

Events and devices do not have a direct relationship within Losant. You can tie devices to events using either the event description or the “extra data” in the Record Event Node, but if you want to represent the unacknowledged state of the event on a dashboard (in a GPS History Block’s pin color in your case), you’ll have to store that status in a state attribute.

Thank you Dylan! I have that working as expected. My question is now how to get the color back to a normal status after the event is acknowledged or deleted. I see we have an event trigger but I dont think I have any way to look up the device outside of having the device ID in the subject. Would that be right?

Yes, you can use the Event Trigger and hook into all events that are being acknowledged or resolved. You could take the device ID off of the subject, or if you have the device ID in the context of the separate workflow that is actually changing the event status (using a Modify Event Node), you can pass its value through the “Extra Event Data Path”, which you will then have on your payload when the acknowledgment trigger fires.

I have the same problem as the initial post but I can’t store the status in a state attribute since the device doesn’t know about the events so he can’t report the status. And with a workflow, I can’t really change a state attribute without declaring a second device state.

Hello,

Currently, there is not a way to accomplish this without being able to send state to a device, but I will request this feature from our dev team.

Thanks!
Julia

A great feature addition would be to have ability to easily summarize open events by device and have that data available for use on dashboards. For example, with map markers it would be great to be able to change the marker color based on open events and their severity, open critical = red, open warning = yellow, no open events = green. I believe we can only accomplish this today by developing an event triggered workflow dedicated to creating and managing this type of summary data.

1 Like