I have a great new experience I’m working on utilizing the SSE Stream and it’s awesome. My question is we also use the event engine provided by Losant to keep track of devices in an Alert state.
An example would be a temperature threshold and a device running too hot. This triggers an Event to log the alert. We pulls these Alerts/Events to the main List dashboard for all devices then if a device is in the list of alerts we flag it red.
When clicking on a device to view, that brings the user to the devices dashboard page (custom HTML) using the SSE Stream. I love the real time data, but how do I update the pages Alert notifications since they are not on the MQTT stream coming from the device state?
Continuing the example, I click the device that’s running hot to monitor it. The device returns to normal temperatures while I’m viewing the page, but there is a red explanation of the alert (“Alert - Break Room Stainless Fridge is above your high threshold of 40°F .”)
The Event/Alert is not part of the SSE, so how do I get updated information from the Events associated with that device in the background to seamlessly update the page that the alert has been lifted?
Obviously this could go the other direction too with the device entering an Alert state and the dashboard page needing to be updated with the Alert message.
I’m open to any ideas. Thanks!