question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sensors created for old meters

See original GitHub issue

Describe the bug

Sensors are created for meters which have been replaced at the same property.

To Reproduce

Have a property which returns these kind of API responses 😅

Get account REST API response
{
  "number": "A-BCD123EF",
  "properties": [
    {
      "id": 1234567,
      // redacted for brevity
      "electricity_meter_points": [
        {
          "mpan": "0123456789",
          "profile_class": 1,
          "consumption_standard": 5720,
          "meters": [
            {
              "serial_number": "XXXXXXXXX",
              "registers": [
                {
                  "identifier": "00",
                  "rate": "STANDARD",
                  "is_settlement_register": true
                }
              ]
            },
            {
              "serial_number": "YYYYYYYYY",
              "registers": [
                {
                  "identifier": "1",
                  "rate": "STANDARD",
                  "is_settlement_register": true
                }
              ]
            }
          ],
          "agreements": [
            {
              "tariff_code": "E-1R-SUPER-GREEN-24M-21-05-29-E",
              "valid_from": "2021-06-30T00:00:00+01:00",
              "valid_to": "2023-06-30T00:00:00+01:00"
            }
          ],
          "is_export": false
        }
      ],
      "gas_meter_points": [
        {
          "mprn": "12345678",
          "consumption_standard": 47722,
          "meters": [
            {
              "serial_number": "AAAAAAAAAAAAAA"
            },
            {
              "serial_number": "BBBBBBBBBBBBBB"
            }
          ],
          "agreements": [
            {
              "tariff_code": "G-1R-SUPER-GREEN-24M-21-05-29-E",
              "valid_from": "2021-06-30T00:00:00+01:00",
              "valid_to": "2023-06-30T00:00:00+01:00"
            }
          ]
        }
      ]
    }
  ]
}

YYYYYYYYY is the currently active electricity meter, and AAAAAAAAAAAAAA the gas - it doesn’t look like the ordering matters, which is a shame as there’s very little extra info for the gas mater in particular.

Consumption API for the old meters is completely blank:

{"count":0,"next":null,"previous":null,"results":[]}

Expected behavior

No sensors are created for the old meters.

Misc

Background here: moved into property with old style meters, which where shortly thereafter replaced by smart meters. Sensors are created for the new meters just fine, but also for the meters which were removed, and have no data.

This might be a bug in the rest API - the old meters don’t show in the UI, and don’t appear in the graphql API afaict:

Screenshot 2022-01-03 at 15 04 38

Using the REST API this might be tricky to handle cleanly because the sensors are created based on the data in the account API, which then go on to have no data in the consumption API but they have already been created at that point. I have disabled the entities for now so it’s no big deal to me, but wanted to document the issue here while I had all the info in my head.

Thanks for creating this - I wanted to get some price sensors and started to look at building a small component based on the GraphQL api, this component saved me the effort 🙂

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
BottlecapDavecommented, Jan 3, 2022

Thanks for raising this. I’ll contact Octopus to see what they suggest.

0reactions
BottlecapDavecommented, Aug 28, 2022

Glad to hear. Closing the issue as this appears to be fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make your existing analog meters smart - Sensorfact
Sensorfact's sensors work for many existing pulse sensors, even meters of 30 years or older. No downtime during installation, you only need to ......
Read more >
Electricity meter sensor technologies
Commonly used current sensors fall into two categories – low-resistance 'shunts' that sit in line with the current, and those that depend on...
Read more >
Achieving the Potential of Sensors in Smart Meters
Today's smart meters need sensors to help perform several useful and needed functions, driven by the meters' ever-increasing complexity.
Read more >
Old Gas Meter Gets Smart With The ESP8266 - Hackaday
If you are unfortunate enough to have an even older meter which doesn't use optical or magnetic rotation sensing, you can use a...
Read more >
Power and Energy Meters: From Sensors to Displays
There was one type of display that you could plug into one type of sensor: pyroelectric, thermopile, or photodiode. This was well before...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found