Closed james-siteclick closed 7 months ago
Hi @james-siteclick, Thanks for checking out this tool!
You've run in to a strange aspect of the OCPI tariff module. Namely the producer of a CDR (normally a CPO) is responsible for creating at least distinct charging_periods
for each period in the session where a different tariff element is active. The tool only tries to define a price for each charging period in the CDR. it cannot on it's own start subdividing charging periods into smaller pieces since it (usually) doesn't have enough information to accurately do this.
Since the only restriction in your tariff is min_duration
, there should be at least a charging period before this restriction applies and when it actually applies. Then the tool will be able to evaluate the restrictions separately for each of those periods.
So in practice, with separate periods (I randomly distributed the energy component) it looks like this. Which should work as you expected, if it does or doesn't not please let me know!
{
"charging_periods": [
{
"start_date_time": "2015-06-29T13:00:00Z",
"dimensions": [
{
"type": "TIME",
"volume": 3
},
{
"type": "ENERGY",
"volume": 12.342
}
],
"tariff_id": "12"
},
{
"start_date_time": "2015-06-29T16:00:00Z",
"dimensions": [
{
"type": "TIME",
"volume": 1
},
{
"type": "ENERGY",
"volume": 3
}
],
"tariff_id": "12"
}
]
}
Additionally It is on our roadmap to detect when a CDR is obviously not upholding this guarantee and show some warnings to the user.
@remkop22 thanks so much for your quick reply, that makes complete sense now 👍
@james-siteclick No worries, I'll close the issue.
I defined the tariff and CDR below. Based on my understanding of OCPI, the
min_duration
restriction below should mean I am charged after 3 hours, so for the last hour of my 4 hour session.However the tool only shows a cost for
FLAT
andENERGY
.Only if I change
min_duration
to0
do I then receive a charge forTIME
.And the following CDR: