Skip to content
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

Closed
BenWoodford opened this issue Jun 5, 2021 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@BenWoodford
Copy link

BenWoodford commented Jun 5, 2021

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)

@unlobito
Copy link
Owner

unlobito commented Jun 5, 2021

Hey @BenWoodford, I really appreciate you writing this up and sharing the relevant endpoints for pure DCC access. :)

Just to keep things tidy, I'm going to merge this issue into #26 since both seem to be covering the same DCC access issue.

@unlobito unlobito closed this as completed Jun 5, 2021
@unlobito unlobito added the duplicate This issue or pull request already exists label Jun 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants