Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Octopus API s are using different date format #3

@MikeHenley

Description

@MikeHenley

This is a great script - the only one I've found that does exactly what I was looking for - I am an Octopus Agile user.
Problem I found was Agile rates are displayed same as Go rate. After investigation, issue is due to different date formats being used for usage (meter) API and price API (the script defaults to Go rate if if can't find a match for date).
In https://api.octopus.energy/v1/electricity-meter-points "interval_end":"2019-05-18T20:00:00+01:00"
In https://api.octopus.energy/v1/products/AGILE-18-02-21/electricity-tariffs "valid_to":"2019-05-20T17:00:00Z"
I patched it like this, but Python is not my language, so I'm sure it can be fixed much better!!!!
period = maya.parse(measurement['interval_end'])
time = period.datetime().strftime('%Y-%m-%dT%H:%M:%SZ')
agile_standing_charge = rate_data['agile_standing_charge'] / 48
agile_unit_rate = agile_rates.get(
time,
rate_data[rate] # cludge, use Go rate during DST changeover
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions