Looking for a way to change map marker color for events

events

#1

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?


#2

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.


#3

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?


#4

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.


#5

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.


#6

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