Consume external SSE

Hey - I’m trying to build a workflow that will consume events from the Miele API, specifically their event stream. (https://www.miele.com/developer/eventing.html). According to the docs, a request to their events API will get a response whenever one of the devices changes state.

My question is this - how do I configure a Losant flow to consume an external SSE stream? If I do a normal HTTP GET it will timeout. I’m sure there is an easy answer, just can’t find it!

-Dave

Hi @Dave_Banthorpe,

Welcome to the Losant Forums! Happy to assist with your application development.

Could you provide some additional details on the purpose behind accessing these events from the Miele API? Are you looking to present a listing of device events (i.e. device disconnect/connect) information through an experience (web application) for your users, or are you looking to store information from the Miele endpoint for other uses? Any screenshots of your current workflow configuration will be helpful as well.

From our review of the Miele documentation, the eventing API can be accessed in Losant using a Timer Node and an HTTP node, configured as a GET request with the Miele API URL as part of the configuration. Once that data has been accessed, you can use a Device: State output node to store the information on your device’s payload.

I’ve built a very straightforward workflow using these nodes for your reference (see attached below). See the linked docs for information on importing a workflow into your application.

We have a few walkthroughs and documentation around the development of workflows accessing 3rd party APIs, including accessing streaming endpoints for SSE. Your best example for guidance will be our Losant Walkthrough, which provides step by step instructions for accessing a 3rd party API service (DarkSky) and using that data to develop a dashboard for displaying real-time weather information.

miele-3rd-party-api-test-develop.flow (3.2 KB)

Thanks,
@Aidan_Zebertavage

@Dave_Banthorpe,

We’ve done a bit more digging on this topic this morning since my last post, and I want to clarify a few points for you:

Apologies if I caused any confusion with my earlier post.

Thanks,
@Aidan_Zebertavage

Thanks - I looked at the Losant SSE endpoints but that seemed to be around creating an SSE endpoint as opposed to consuming one.

The way I understand the Miele API to work is that you make the GET call to the events SSE endpoint and whenever the state changes of the device (e.g. wash program changes or finishes), it will send back and event/alert that you can consume.

@Dave_Banthorpe,

Yes, you’re correct, and I think we had posts come through at almost the same time. Take a look at my response above regarding accessing device state information.

Because Losant does not have the ability to consume SSE, rather than relying on the streaming endpoint around events, you’ll need to have a way to access the device state data itself and use that information within Losant when developing your application.

Thanks,
@Aidan_Zebertavage