Units incorrect in meterread API

Hi,I've just received my CAD (and very nice it is too) meaning that I can now retrieve actual meter readings via the API but I notice that the readings are not in the units specified, when read from any of the various resources

GET: https://api.glowmarkt.com/api/v0-1/resource/[...]/meterread

{'status': 'OK', 'name': 'Smart Meter, gas consumption', 'resourceTypeId': '[...]', 'resourceId': [...]', 'data': [[1753520321, 92316]], 'units': 'm3', 'classifier': 'gas.consumption'}

This seems to report 92316 cubic meters of gas where the actual figure in 92.316 (as reported on the CAD and with my provider etc) so is out by a factor of 1000

GET: https://api.glowmarkt.com/api/v0-1/resource/[...]/meterread

{'status': 'OK', 'name': 'Smart Meter, electricity consumption', 'resourceTypeId': '[...]', 'resourceId': '[...]', 'data': [[1753520321, 15019494]], 'units': 'Wh', 'classifier': 'electricity.consumption'}

And this seems to report 15019494 Wh of electricity, or 15,019.494 kWh where the correct figure (again from provider and your CAD and my existing smart meter) is 1,501.9494 kWh so is out by a factor of 10

I've put a fudge factor in my script to retrieve these for now, but thought you might want to correct the units and/or numbers

Comments

  • I was interested to see that you are receiving data for a meterread request to the API - last time that I tried, admittedly a while ago, it was returning 'Not implemented'. I have just tried again myself, and am now seeing valid data, with the same order-of-magnitude errors as you.

    The values that are being returned are actually derived from the data that the DCC receives directly from the smart meter, completely independently of the CAD. You will see the following in the data returned when requesting the resources - "electicity consumption DCC SM profile reads" and "gas consumption DCC SM profile reads" (the typo is theirs, not mine!). The units are defined in the messages from the smart meter, but there should also be a pair of scaling factors - a multiplier and a divisor. This suggests to me that 'meterread' has been added to the API relatively recently, and may need a bit of tweaking to provide the correct values.

  • Agreed.. the python module I'm using (https://github.com/cybermaggedon/pyglowmarkt) needed tweaking as it was written expecting electricity units "kWh" where "Wh" is specified and a couple of other tweaks but yeah, these are all via the "DCC Sourced" entity in the API but different resources hence script (with my corrections) produces output shown where I suspect the "cost" as opposed to "consumption" API calls are supposed to supply values in "pence" but are returning the same consumption figures

    --------- script ----------

    from glowmarkt import *

    cli = BrightClient(username, password)

    ents = cli.get_virtual_entities()

    for ent in ents:

      print("Entity:", ent.name)

      for res in ent.get_resources():

        print(" %s:" % res.name)

        try:

          cur = res.get_meter_reading()

          print("  meter (%s): %s" % ( cur[0][0].astimezone().replace(tzinfo=None), cur[0][1] ))

        except Exception as e:

          print("  meter reading: %s" % str(e))

    --------- output ----------

    Entity: DCC Sourced

    gas cost:

    meter (2025-07-26 14:48:26): 92.430 m3

    gas consumption:

    meter (2025-07-26 14:48:26): 92.430 m3

    electricity consumption:

    meter (2025-07-26 14:48:26): 1506.2537 kWh

    electricity cost:

    meter (2025-07-26 14:48:26): 1506.2537 kWh

    Smart Meter, gas cost:

    meter (2025-07-26 14:48:26): 92.430 m3

    Smart Meter, gas consumption:

    meter (2025-07-26 14:48:26): 92.430 m3

    Smart Meter, electricity consumption:

    meter (2025-07-26 14:48:26): 1506.2537 kWh

    Smart Meter, electricity cost:

    meter (2025-07-26 14:48:26): 1506.2537 kWh

Sign In or Register to comment.