-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time format change request for Energy Plan Data #613
Comments
The "area affected" seems to misunderstand how RFC3339 works. Realistically the whole point of transmitting in these formats is so a recipient does not have to be aware of the holders local timezone. They can alter their presentation layer based on the users location or with other information. A simplistic example here might be a user comparing a plan, in Queensland (no DST), for a rental property in NSW (with DST), having this clearly articulated is more useful than not especially if things like usage charts are aligned with the users local time (which, they are, for a vast number of retailers). It's unclear what the requirement being solved is but I think the idea is that a plan might have a time range of say 5-8pm local time, which means during DST it effectively "shifts" one hour on a UTC basis? That isn't so much a timezone issue as much as a way of describing "local time". I provided an answer to that which remained international standards aligned already without forcing the loss of precision here: #505 (comment) . I also identified inconsistent use of timezones (EST vs. LOCAL) in AER/EME data across plans/retailers which makes forcing it back to an unqualified time potentially also inaccurate, albeit in a different way. I guess repeating what I said in the comment "[...] leaving it as HHMM has the effect of making it impossible to ever have any precision despite the possibility it may be available". I also asked for a copy of the underlying document that defines the data specification EME receives to consider this information but was rejected on two separate occasions (here's the one that's public) essentially because it was commercially important to AER. In summary I think permitting (although I don't think it's excluded now?) |
I believe the issue is that daylight savings changes are not applicable to energy plan times. For e.g. a plan with rates applicable from 07:00 to 15:00 would be applicable for that specific time range regardless if the local time is in AEST or AEDT (@eme-admin please correct me if I've got this wrong). As per my interpretation of RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339#section-4.3), "-00:00" means the time is in UTC as the offset to local time zone is unknown. As a result using -00:00 won't work and can result in incorrect interpretation by the ADR. Using the above example, "07:00:00-00:00" would be interpreted as 5pm AEST or 6pm AEDT and "15:00:00-00:00" would be interpreted as 1am AEST or 2am AEDT. An option to consider could be to update the description of |
This issue seems to stem from a misinterpretation of RFC3339 4.3 (Unknown Local Offset Convention) back in #505 as being a means of representing local time (without a timezone). Reading 4.3 again, the first sentence makes clear that UTC time is known ("If the time in UTC is known, but the offset to local time is unknown...") and it's simply that the user's/client local timezone is unknown. 4.4 (Unqualified Local Time), on the other hand, is actually what we want to convey. However, RFC3339 is not equipped to represent local times (without a timezone). Instead, the RFC suggests means of either synchronising to UTC or requesting timezone from the end user which isn't useful in this context. Despite RFC3339 being a close representation of ISO 8601, it is a subset with its own idiosyncrasies - one of which seems to be that the actual moment in time must be known and unqualified local time is unacceptable. However, ISO 8601 actually has a way of representing local time! Getting a copy of the standard is tricky, however, there are credible references to this on Wikipedia and parser implementations such as Java DateTimeFormatter and Python time.fromisoformat. So in ISO 8601 world, you would have:
So could the solution be to switch from RFC3339 to ISO 8601 for DateTimeString, DateString and TimeString? We already use ISO 8601 for durations. Going back to the separate timezone field as suggested by @HemangCDR also solves the problem, however, I would lean towards an industry-standard way of representing date-time as initially envisaged in #505. Although, the suggested "HH:MM:SSZ" is probably not desirable as the "Z" suffix is used to mean "Zulu time" (i.e. UTC) in both RFC3339 and ISO8601. |
At risk of opening another can of worms, there are also edge cases where the timezone changes can neither be represented as "local" time nor a UTC-offset fixed timezone across the whole year. I suspect the only way to be handle these are by explicit date range definitions of EnergyPlanTariffPeriod. For example, Essential Energy (see last page) has its own "Summer Time" definition for a subset of customers which does not follow the "Summer Time" definition used by the NSW Standard Time Act:
Essential Energy customers in Essential Energy Far West (e.g. Broken Hill) also does not follow the local time as per the NSW Standard Time Act. For Essential Energy's own definition of "Summer Time", you could feasibly represent the applicable periods with separate EnergyPlanTariffPeriods with { // EnergyPlanTariffPeriod
"name": "Essential Energy - Summer Time",
"startDate": "2023-10-29", // in this example, YYYY is provided as day of month changes year to year. e.g. in 2024, the date is 2024-10-27
"endDate": "2024-03-31", // as per above
"timeZone": "AEDT", // explicit timezone to mean UTC+11, could be optionally omitted if ISO 8601 is adopted
"timeOfUseRates": [
{
"timeOfUse": [{
"startTime": "17:00:00+11:00", // if ISO 8601 is adopted. otherwise, "17:00:00" + offset specified in "timeZone" is used
"endTime": "20:00:00+11:00", // as per above
// ... fields omitted ...
}],
// ... fields omitted ...
}
],
// ... fields omitted ...
} For a retailer providing a consumer's actual plan details where the metering equipment, tariff and customer location is known, this is likely the best solution for an accurate representation. However, I suspect it would be unlikely this fidelity of time variation is provided to AER by retailers for generic plan data, especially where the periods when timezones change depends on metering equipment, tariff and location (i.e. qualification step required). |
If there was a way of specifying a plan time with a date range this could be solved.
The issue here is that "local time" isn't a known offset because the sender and receiver may be at indeterminant locations at indeterminant times. If this simply moved to The example provided is accurate because it may be 5pm-1am AEST or 6pm-2am AEDT. This would continue to be a problem if the format specified was HH:MM. It doesn't solve for the ADR guessing what it actually is.
This actually seems like a reasonable suggestion that preserves alignment with an international time format but I note that designating "ignore Z" is really no different to using -00:00 and from an implementers perspective is actually worse (
"LOCAL" isn't a known offset and that's the source data from AER that's problematic. To be clear this is the server presenting a plan related to a location that may not be the same as the client (Recipient) or the user (Consumer). I'm certainly not pitching this as the perfect solution but I don't think creating a time format that doesn't solve for the problem and in fact loses accuracy when it may not need to is the solution. The adoption of RFC3339 in the first place began I believe from the OAuth2 side that baselines on it. I'm pretty wary of confusing two different time formats in a single spec (one of which is ISO which means it's not freely distributable).
I think this solution is probably the most sustainable long term especially if considered in an expansion beyond the NEM. Introducing a start/endDate side by side with a timezoned date is very likely the most consumable thing to do for Recipients. I didn't suggest it in the first place because the "AER format" was being used as the primary reason to not align in a variety of other cases (i.e. it didn't seem likely it'd get traction). From what we have seen most energy billing systems do precisely this so obtaining the data is actually easier. While I accept AER may not be collecting this data I'd also note that such limitations put on the spec have cascading effects into the reused components (i.e. Energy Account Detail) and I question the ecosystem of one entity not being requested to uplift their own systems. Put another way whether AER has it or not is an implementation concern and the rest of the ecosystem is in many cases actually degrading their data set to achieve it. |
Final footnote here, introducing start/endDate would also introduce the ability for Retailers to advertise future price changes. This seems like it could be quite valuable and in fact a feature enhancement the CDR could offer over the current AER data for Recipients. |
Suggestion that would at least use RFC3339 as a foundation would be to describe this format as:
This would mean that existing RFC3339 libraries could be used to validate and parse albeit through some reflection of potentially private methods. Alternatively from RFC3339 |
Following MI call, discussion seemed to be heading towards:
Will leave @HemangCDR to clarify further. |
Setting expectations early here - we've got major milestones between now and May 2024 and a very full backlog. Our preference is that this change carries a FDO of Sept 2024. |
Thank you everyone for your input. Having discussed the feedback, the DSB are proposing the following change to address the time representation issue:
The above change would have no impacts to current DH and EME implementations. As a result, no FDO is being proposed. Feedback on the above proposal is welcome. |
AER would be accepting of this change |
I think the only outstanding clarification would be how the optional If the TimeString is explicitly defined with the timezone with the Could we introduce a third enum (e.g. |
@HemangCDR can you please ensure that this CR applies to all the startTime and endTime fields in the EnergyPlanResponseV2 schema; which is more than the 4 fields that you've nominated above |
@DannyDuong thank you for picking this up. I've updated the proposal with more fields, hopefully including all of them. |
This is a good pickup. An option could be clarify in the description of the time fields that the value of |
That would clarify for specific UTC offset in timestring, but we'll still need to clarify when timeZone is unspecified and the timestring is unqualified local time (e.g.
|
We gave serious consideration to the introduction of an additional time field type for this energy specific change and have decided to move forward with This issue has been staged accordingly and can be reviewed here - ConsumerDataStandardsAustralia/standards-staging@release/1.29.0...maintenance/613 |
Description
Time within energy plan data e.g. Peak period start and end time were defined in a string format HHMM (24HR) (3pm will be defined as "1500"). This representation of time is different to how time was defined in other areas of the CDR standards for energy which was in the timestring format (3pm will be defined as 05:00:00+10:00, where +10 is the time offset to GMT). So Consumer Data Standards body made an update to the CDR standards in a maintenance iteration to align it with other areas of energy data but this introduced an issue
Area Affected
This representation of time introduced an issue when data recipients had to convert them back to the local time during the day light saving period for human readability. For example, 3 pm will be defined as 05:00:00+10:00 during the AEST to GMT conversion but when consumed by data recipient during the AEDT time its converted back to 2pm local time rather than 3pm. So there is no way in the CDS standard to represent the AEDT offset of 05:00:00+11:00 and AEST offset of 05:00:00+10:00 at the same time.
Change Proposed
AER and DEECA propose a CR highlighting this issue and request the time presentation to be reverted back to HHMM (24HR) which doesn't have the offset issue and will always represent the local time. If not CDS can propose a new format that would resolve this issue.
DSB Proposed Solution
The current DSB proposal for this issue is in this comment
The text was updated successfully, but these errors were encountered: