This repository has been archived by the owner on Apr 30, 2022. It is now read-only.
Getting Readings when using Smart Meter DCC reads (rather than the IHD) #28
Labels
duplicate
This issue or pull request already exists
Annoyingly, the
/current
endpoint doesn't actually provide readings when you don't have an IHD or GlowStick, you have to get them via the/readings
endpoint which is half-hourly.And... I don't think MQTT is available for users using this method either, I'll find out soon enough but seeing as everything talks about MAC addresses for MQTT I'm not sure people who don't invest in the IHD can actually get data from MQTT at all.
With that in mind, some form of polling would be ideal to keep around, here's the endpoint that would need to be polled:
https://api.glowmarkt.com/api/v0-1/resource/<snip>/readings?from=2021-06-05T00:00:00&to=2021-06-05T23:59:59&period=PT30M&function=sum&nulls=1
As it's half-hourly reads I've used
PT30M
,nulls
is set to 1 so that the last actual reading can be found by looping through the data results in reverse until a value is found.While it's got midnight to midnight on that query, a better solution would be to start from a few hours ago until a few minutes after the current timestamp in UTC (just to be extra safe), and finding the last actual reading from the data array
I'm currently tinkering with this myself to see what I can pull together, as the main codebase is eventually moving to MQTT I may just fork a "legacy" version unless Hildebrand come back and say there's MQTT access for DCC users (in which case this is all moot)
The text was updated successfully, but these errors were encountered: