Skip to content
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

GetBatteryStatus is not working #55

Closed
MCP-KC opened this issue Apr 27, 2024 · 9 comments
Closed

GetBatteryStatus is not working #55

MCP-KC opened this issue Apr 27, 2024 · 9 comments

Comments

@MCP-KC
Copy link

MCP-KC commented Apr 27, 2024

Dear fungus75,

The JSON data format has been changed for battery-status (like in GetLocation).
it is now on a ZOE R135 Z.E.50 (2020)
non charging:
{"data":{"id":"VF1AG000365xxxxxx","attributes":{"timestamp":"2024-04-26T19:34:00Z","batteryLevel":87,"batteryAutonomy":275,"plugStatus":0,"chargingStatus":0,"chargingRemainingTime":2555}}}
charging:
getBatteryStatus:{"data":{"id":"VF1AG000365xxxxxx","attributes":{"timestamp":"2024-04-27T07:24:05Z","batteryLevel":87,"batteryAutonomy":274,"plugStatus":1,"chargingStatus":1,"chargingRemainingTime":135}}}

Therefore, these rows have to be adjusted to:
var charge_level =attributes.data.attributes.batteryLevel;
var plugged =attributes.data.attributes.plugStatus==1;
var charging =attributes.data.attributes.chargingStatus==1;
var remaining_range=attributes.data.attributes.batteryAutonomy;
var remaining_time =attributes.data.attributes.chargingRemainingTime;

I don't get values for battery temperature, charging power, battery capacity and battery available energy.

I have changed and tested it on my iobroker, but this info is for the benefit of the community.

Thanks!

@gik007
Copy link

gik007 commented Apr 27, 2024

I confirm that I'm observing the same issue. Applied the change proposed by @MCP-KC (thanks for your post!) and see the same outcome -> missing some (very important!) values.

My car is charging now, I get this response:
getBatteryStatus:{"data":{"id":"VF1AGVYF057xxxxxx","attributes":{"timestamp":"2024-04-27T13:23:23Z","batteryAutonomy":93,"plugStatus":1,"chargingStatus":-1.1,"chargingRemainingTime":755}}}

@gik007
Copy link

gik007 commented Apr 27, 2024

An additional info. Just checked the My Renault app and I only see the value for "batteryAutonomy" but not battery level.
image

@MCP-KC
Copy link
Author

MCP-KC commented Apr 27, 2024

This my view in the Renault app.
Screenshot_20240427_181634

@fungus75
Copy link
Owner

Hi you both,
thank you for your analysis. I've just implemented your suggestions and created v0.2.8.

Please update to the most recent version.

cu
Fungus75

@gik007
Copy link

gik007 commented May 6, 2024

Thank you @fungus75 for your quick reaction. I have been observing this issue for the last few days.

My issue was that I stopped getting batteryStatus information even through the My Renault App (I posted that before). The system was sending me a JSON which was correctly parsed using the change provided by @MCP-KC but some values were not sent by the API. So I decided to write to Renault and ask them why my app was not working.

Two things happened today:

  1. I got a reply from customer service (asking for more information) and
  2. the change in the JSON format was reversed (at least for me) and now I see the values through the API (and in the APP)

Now, I don't know if this is only affecting me (or some limited group of users) now. Would be interesting to hear if others observe the same.

@MCP-KC
Copy link
Author

MCP-KC commented May 6, 2024

Hi gik007,
the new (old) json format is now:
getBatteryStatus:{"id":"VF1AG000365xxxxxx","timestamp":"2024-05-06T12:48:13Z","batteryLevel":93,"batteryTemperature":20,"batteryAutonomy":337,"batteryCapacity":0,"batteryAvailableEnergy":45,"plugStatus":1,"chargingStatus":1,"chargingRemainingTime":90,"chargingInstantaneousPower":19.5}
Consequently, the iobroker adapter zoe2 has to be changed again, as it leads to errors now.

@gik007
Copy link

gik007 commented May 6, 2024

I don't have much experience about how Renaults APIs work and how (un)stable they are. Is this a common phenomenon? Do they often change things back and forth? If GetBatteryStatus is now changed back, how high is the chance that we'll end in a never-ending cycle of changing it?

@MCP-KC
Copy link
Author

MCP-KC commented May 6, 2024

This was quite stable so far. Let's see, if the step back has no disadvantages for Renault. Then it will stay.

@fungus75
Copy link
Owner

fungus75 commented May 7, 2024

Ok, Hopefully fixed by now. I check if the node data.attribute is present. If so, use that value otherwise try to read old values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants