steve icon indicating copy to clipboard operation
steve copied to clipboard

ID/OCPP Tag expiry

Open UBT-FJ opened this issue 2 years ago • 12 comments

Hello,

Can someone please explain how this works? I tried in the expiry date/time but it doesn't work!

UBT-FJ avatar May 29 '23 08:05 UBT-FJ

hey @UBT-FJ did you look at the ocpp spec?

goekay avatar May 30 '23 05:05 goekay

hello @goekay , thanks for the quick reply, can you point me to the right direction here, which ocpp specs?

UBT-FJ avatar May 30 '23 06:05 UBT-FJ

Hi @UBT-FJ

@goekay refers to ocpp specification Section 3.5. Local Authorization & Offline Behavior (page 12).

The question is more: what do you expect with the tag expiry?

juherr avatar May 30 '23 11:05 juherr

Hello,

thanks for the replies.

What I testes is that the charger will read the RFID and I can see it in SteVe and then allow it, but how can I set the expiry for example to make it work for a period of time? and then set to expired or delete, I know I can do this with API and tried it, it works.

UBT-FJ avatar May 30 '23 12:05 UBT-FJ

It is not a feature provided by Steve out of the box but you can fork and propose an update.

But why not do it by the API if it works? It looks like the best approach.

juherr avatar May 30 '23 19:05 juherr

the details page of an ocpp tag has the field "Expiry Date/Time" which you can set.

Screenshot 2023-05-30 at 23 38 38

goekay avatar May 30 '23 21:05 goekay

the details page of an ocpp tag has the field "Expiry Date/Time" which you can set.

Screenshot 2023-05-30 at 23 38 38

Helo @goekay this is my point, it doesn't work!

UBT-FJ avatar May 31 '23 05:05 UBT-FJ

What "doesn't work" means? Do you see in the logs that Steve authorizes the transaction when the station asks for it?

Please, explain and share logs that show the issue.

juherr avatar May 31 '23 07:05 juherr

if I set the expiry I should see that ID Tag as expired but it doesn't work, I was thinking maybe the problem is the TZ as I'm in CEST and SteVe is in UTC?

UBT-FJ avatar May 31 '23 08:05 UBT-FJ

I was thinking maybe the problem is the TZ as I'm in CEST and SteVe is in UTC?

you found the reason. database, backend, frontend are using UTC for all types of timestamps/datetimes.

goekay avatar May 31 '23 13:05 goekay

Ok, I confirm that is the reason, TZ, I just needed to add in the expiry -2hrs and it worked :)

[3,"AOsjbFZwq31HispDqXHRBhKDOpsoZlR9kyDX",{"idTagInfo":{"status":"Expired","expiryDate":"2023-06-01T06:10:00.000Z"}}]

P.S. one thing I didnt understand, when you pick the datetime from the browser for expiry in the "now" button I think that syncs with the browser time and not the actual server!

UBT-FJ avatar Jun 01 '23 06:06 UBT-FJ

sorry one more issue here with ID Tag api, when I use the TZ to change the expiry with method PUT I get this:

{ "timestamp": "2023-06-02T10:41:33.902Z", "status": 500, "error": "Internal Server Error", "message": "JSON parse error: Invalid format: \"2023-06-02T10:40:12.456Z\" is malformed at \"Z\"; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Invalid format: \"2023-06-02T10:40:12.456Z\" is malformed at \"Z\" (through reference chain: de.rwth.idsg.steve.web.dto.OcppTagForm[\"expiryDate\"])", "path": "http://ip/steve/api/v1/ocppTags/2" }

when I remove the TZ like this "expiryDate": "2023-06-02T10:40" as it is suggested in the schema expiryDate | string($date-time)A date/time without timezone. Example: 2022-10-10T09:00

I get this { "timestamp": "2023-06-02T10:50:33.031Z", "status": 400, "error": "Bad Request", "message": "Error understanding the request", "path": "http://ip/steve/api/v1/ocppTags/2" }

UBT-FJ avatar Jun 02 '23 10:06 UBT-FJ

after this PR, your TZ-related issues should be resolved, since we support full ISO 8601 with timezones now.

goekay avatar Aug 29 '25 22:08 goekay