Suggestions for collecting event stream

Recently I’ve started to experiment with sleep modes on units that are battery and solar-powered, and it seems that capturing the event stream is the way to go (instead of calling variables via the web API).

I’ve have a working method via invoke-webrequest and writing that to a file, which in turn read and write to mssql. But I’d like to move to something more robust (and learn something new).

I’ve been looking at the JS API, would this be the way to go when the intention is to read the event stream and then write the data to a local mssql database? Advise appreciated!

Subscribing to the Server Sent Events (SSE) from the Javascript API works quite well in my opinion. There are a number of examples here:

1 Like

Thank Rickkas! This was exactly what I was looking for.