Betatest - Renault ZE Services Binding

Yes I would like the batterystatusupdated timestamp. I think its usefull.

Another idea is to have a channel (for a switch for example) to make a poll to the MyRenault App from inside an openhab-rule. to promptly update the informations.
In my Usecase:
Now that we have 2 cars and only one wallbox, I’d like to know which of the car is plugged to the charger.
With the automated polling I will receive this information after at least 5 minutes (in my case), that could be to long.

I have a workaround for this, but its also a little complicated.
I disable the car Thing with an HttpPutRequest - wait for 1 second - and enable the car thing again with the HttpPutRequest.

So a Channel to poll the car and update the informations will be very usefull.
If my wallbox recognize a plugged car, I can poll the cars and receive the information which is plugged within a few seconds and dont have to wait until the next automatic poll is done.

Now to the locate function. Yes, you are right, thats a way and I receive the GPS data and are able to locate my car on a map.
But this “new” functionality is not to locate the car on a map. If this functionality is used, you can turn on the cars horn or light.

  • I think it’s there to find the car in a crowded parking spot.

If you need any help for testing, let me know.

Hi @NikM

Thanks for explaining your use case and your idea I think it is very good. Reducing the polling interval and adding a update now trigger will reduce the load on the Renault servers and reduce lockouts… while improving data usefulness when needed. I will implement this with the batterystatusupdated.

However I am not sure if it will work because getting the data from the Renault servers is not the same as getting the data from the car. However it is easy to implement this and trigger the same thing that you do with your dis-able and enable of the thing. We (you) will have to test it to see if the data it up to date.

Looking at this there is no information about HVAC services for new cars yet:
https://renault-api.readthedocs.io/en/latest/endpoints.html#hvac-status

Maybe if this becomes available (meaning someone with reverse engineering stills and a new car documents and contributes it) we can then implement it.

The function to locate your car is also not documented yet. I am not sure how useful it is for home automation. You would need a very large home and garage full of cars to “need” this I guess…

The car locking status might be useful for home security type openHAB integrations…???
https://renault-api.readthedocs.io/en/latest/endpoints.html#lock-status

Hey @Doug_Culnane
The thanks goes to you, for your effort and time.
→ I would really like to test that :smiley:

The function to locate your car is also not documented yet. I am not sure how useful it is for home automation. You would need a very large home and garage full of cars to “need” this I guess…

:joy: Maybe a usefull feature for the home automation of Jay Leno’s garage… :crazy_face:
But I usually don’t have to search long for the Megane in our garage… Thats true.

Indeed the locking status is very interesting. But I cannot view the information in the MyRenault app. So I’m not sure if Renault is giving the information out. But → I would really like to test that :wink:

Here is a new experimental version please test:
https://drive.google.com/file/d/1E32pyz8Lwl8B-wSlAtMSFte5LIo-rcth/view?usp=sharing

New Channels

Channel ID Type Description Read Only
batterystatusupdated DateTime Timestamp of the last battery status update Yes
lockstatus String Lock status of the car Yes
updatenow Switch Switch to force an immediate update of channels No

Lock status does not work on our Zoe. Maybe it works on other cars?

You have to re-create a thing to get the new channels…

1 Like

Seems like the lockstatus doesn’t work for other cars either.

batterystatusupdated is working for both, the Zoe and the Megane.

updatenow seems to work, but actually I have no connection to the cars. The cars status wouldn’t refresh in the MyRenault App. Sometimes the cars don’t have a cellular connection. I will test this in a few hours again.

I noticed that the status is not mapped. For example I receive an NOT_IN_CHARGE for the chargingstatus in the sitemap und UNPLUGGED for the plug state.
I’m really sure that there wasn’t the “raw” information in previous versions of the binding?!
Not a big thing, but i noticed it.

1 Like

Hi @Doug_Culnane ,

another short feedback from me. I tested the UpdateNow functionality with our Zoe and it works well.

I dont know why, but the Megane’s communication to the server is disrupted. It wont update the status of the plug.
But I think it will also work with the Megane if its communication to the server is back again.

Thanks to you! If there is any help needed for further tests, contact me.

I have “fixed” the site map problem. Items do not display properly if there have old invalid unknown channel links. You can click on these links and remove them to fix the display.

Does anyone have a working lock status? Maybe I will remove this if it does not work for anyone?

I have opened a Pull request for the new version here:

Thanks a lot! :slight_smile:
From my understanding the binding polls the server for each car seperatly?
Would it be possible to make one poll for the both cars?
I don’t know the architecture or other limitations for that, but in my case I’m really near to the polling limit of the server with two cars.

Yes

Yes probably.

I guess I should implement a “bridge” and a car thing. The bridge might be re-usable for both cars… I will have to investigate and see if and how this works.

That will be really great. :slight_smile:

In the meantime I can also confirm the poll function for the Megane. It works great!

Let me know, if there is some testing to do.

@NikM and anyone else. There is a new version that I need help testing. It is for openhab 3.4.0-SNAPSHOT it incorporates our work and some great feedback from the pull request.

Please test this latest version:
https://drive.google.com/file/d/1x40etWApZDdOBQX0b9AFsmywcuLk7bs_/view?usp=sharing

The updatenow channel has gone because I have improved the handler. You can REFRESH data in a rule like this:

RenaultCar_Location.sendCommand("REFRESH")

All items that get a REFRESH command will trigger a poll and update all channels. So use it wisely or you will trip the API request count circuit breaker which locks you out for a while.

Hey @Doug_Culnane ,

sorry for my late response. I was very busy last week and not at home.
But I try to test the new version today or tomorrow.
My feedback will come soon…

Thanks, greetings and a happy new year!

@Doug_Culnane

I’m not able to run the binding with my OH3.4.0 release installation.
Could you build it for OH 3.4.0?

2023-01-02 10:00:14.132 [ERROR] [Events.Framework                    ] - FrameworkEvent ERROR

org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.renault [237]

  Unresolved requirement: Import-Package: com.google.gson; version="[2.9.0,3.0.0)"

	at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.17.200.jar:?]

	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847) ~[org.eclipse.osgi-3.17.200.jar:?]

	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136) ~[org.eclipse.osgi-3.17.200.jar:?]

	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840) ~[org.eclipse.osgi-3.17.200.jar:?]

	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1783) ~[org.eclipse.osgi-3.17.200.jar:?]

	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745) ~[org.eclipse.osgi-3.17.200.jar:?]

	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667) ~[org.eclipse.osgi-3.17.200.jar:?]

	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) ~[org.eclipse.osgi-3.17.200.jar:?]

	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) [org.eclipse.osgi-3.17.200.jar:?]

	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345) [org.eclipse.osgi-3.17.200.jar:?]

2023-01-02 10:00:17.976 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.renault-4.0.0-SNAPSHOT.jar

org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.renault [237]

  Unresolved requirement: Import-Package: com.google.gson; version="[2.9.0,3.0.0)"

	at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.17.200.jar:?]

	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) ~[org.eclipse.osgi-3.17.200.jar:?]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.7.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.7.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [bundleFile:3.7.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [bundleFile:3.7.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.7.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.7.4]

Same here.

Thanks for trying to test @sihui and @NikM. I have got the changes merged into the the main branch which is now on openHAB version 4.0.0-SNAPSHOT. I have been testing and running it myself and I think it is OK.

The new version has 2 new channels for the battery update timestamp, and locked. The logging is improved and you can force a poll using a rule and REFRESH command:

RenaultCar_BatteryLevel.sendCommand("REFRESH")

Thanks for the suggestions an help improving this binding.

A future improvement would be to add a bridge and reuse the session (for multiple cars) to try and avoid the request limit circuit breaker. However I am not sure how the API measures usage and so I would need to experiment to find out how it counts usage and if this idea would actually improve things… This would be time consuming and require a 2nd car account… So this will have to go in the backlog for a possible future project for now.

2 Likes

@Doug_Culnane , as discussed yesterday, you will find another PR in order to add the Pause / Resume endpoint.
As I said, some vehicule like Dacia Spring that use the same Renault API do not support the Charge Mode endpoint.

Let me know if I can help.
Vincent.

1 Like

The key changed again, new one is:

YjkKtHmGfaceeuExUDKGxrLZGGvtVS0J

5 Likes

Could this logging message be set to DEBUG instead of WARN? Or surpressed at all for cars where the lock status is not available? (Renault ZOE 10/2020)

2023-07-20 18:27:13.561 [WARN ] [lt.internal.api.MyRenaultHttpSession] - Kamereon Request: https://api-wired-prod-1-euw1.wrd-aws.com/commerce/v1/accounts/12345678-1f00-234e-56e7-c890aecc1234/kamereon/kca/car-adapter/v1/cars/VF123456789/lock-status?country=DE Response: [502] Bad Gateway
{"type":"TECHNICAL","messages":[{"code":"err.tech.502","message":"{\"errors\":[{\"status\":\"502\",\"code\":\"gateway.processing\",\"title\":\"VNEXT\",\"detail\":\"an internal error occured while processing request : 403 FORBIDDEN\"}]}"}],"errors":[{"errorCode":"err.tech.502","errorMessage":"{\"errors\":[{\"status\":\"502\",\"code\":\"gateway.processing\",\"title\":\"VNEXT\",\"detail\":\"an internal error occured while processing request : 403 FORBIDDEN\"}]}"}],"error_reference":"TECHNICAL"}
2023-07-20 18:27:13.562 [WARN ] [ault.internal.handler.RenaultHandler] - Disabling unsupported lock status update.

openHAB 4.0.0 Build #3544 (17.07.23)
Binding version: 4.0.0.202307190402

Apart from that the binding works great, another big thanks to @Doug_Culnane

Is someone having a working widget code for the ZOE binding?
@sihui You did a very nice sitemap incl. a map. Have you translated something similar as OH4 widget?

I tried this one, but always getting errors in OH4

thank you in advance, Christian