Sensors created for old meters
See original GitHub issueDescribe 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:
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:
- Created 2 years ago
- Comments:15 (10 by maintainers)
Top GitHub Comments
Thanks for raising this. I’ll contact Octopus to see what they suggest.
Glad to hear. Closing the issue as this appears to be fixed.