Glad to hear you got it all working. That sounds like a really neat setup.
Is the goal of pulling directly from WebCoRE reducing the lag? I would think the lag would primarily be related to the refresh interval that’s chosen for Media Tile.
As far as I’m aware, WebCoRE doesn’t expose an API, but even if they did we would still likely have to poll periodically, so I don’t know if that would solve the lag.
Instead of using WebCoRE variables, another approach is to use an attribute on a custom virtual device. When device values are changed, those subscribed events are immediately pushed over to SharpTools and down to your browser.
The HTTP stuff all happens directly in your browser, so it won’t work with Alexa… but if you are using a Virtual Device then you could definitely use that in Alexa (as long as it’s a supported type like a switch, etc.)
In this particular setup, I’m wondering if a Virtual Thermostat doesn’t make more sense? It would show up in SharpTools like a thermostat control meaning you’d see the temperature in the center and the ability to directly adjust the temperature up and down quickly and easily (a much smoother user experience).
You could still use the
temperature attribute in WebCoRE like a variable and would still have direct access to reading and changing the temperature as if it were your target temperature.