-
-
Notifications
You must be signed in to change notification settings - Fork 706
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
404 when posting Charge Plan to Rest API and using UTC+X offset #16827
Comments
You'll need to follow
|
Whats the curl? |
a shown on Postman: curl --location --request POST 'https://demo.evcc.io/api/vehicles/vehicle_1/plan/soc/100/2006-01-02T15:04:05Z07:00' |
|
This PR should make it easier to work with the API, at least for local users. |
@andig :
Sorry, but I think, Z followed by a Number is not RFC3339 and as @Laith-Budairi showed, is not working, results is: When reading the examples in the RFC3339 definition https://datatracker.ietf.org/doc/html/rfc3339#section-5.8 I would understand that RFC3339 allows 2024-10-25T05:30:00Z (if Zulu aka UTC) which is exactly what I tested and what did not work! I tried in your go playground, and + and - are working, see here: https://play.golang.com/p/DaEVAVHnTgJ So, as (time.Parse(time.RFC3339 can handle Z, + and - but EVCC can’t, the problem is maybe in receiving the + character, i tried URLencoding, but that didn’t help neither. |
It can (in principle). You just can‘t use Z and +/- together. And maybe the regex is missing the +, need to check.
It does, see the play. |
Yeah in play it is working, but with curl and the actual EVCC API it is not. Have you tried? in go play: -> 2006-01-02 15:04:05 +0700 +0700 but in curl: curl -X POST "http://192.168.XX.XX:7070/api/vehicles/Tesla_Y/plan/soc/90/**2006-01-02T15:04:05+07:00**" And of course you can’t use Z and +/- together. I never did, but you in your comment: #16827 (comment) thats why Laith and I tested it. |
|
I tested URLencoding (see initial bug report at the top) was not working. |
Tested with the new nightly build and its working now. |
Describe the bug
I just tried the evcc Rest api while debugging a openhab EVCC Binding problem (link) and i think the API its not working correct:
I also tried URLencoding, but doesn’t work neither.
so positive offsets from Zulu time (aka UTC ) don’t work.
Steps to reproduce
Configuration details
Version 0.131.1 on Debian 11.8
Log details
What type of operating system are you running?
Linux
Nightly build
Version
0.131.1
The text was updated successfully, but these errors were encountered: