Betatest - Renault ZE Services Binding

Hi @Pinocchio

Q: Do I need items for the channels?
A: Yes

If you are using openHAB version 3 then adding then “Create Item” from the binding channel should give you the Default Item names that are set in the sitemap called: RenaultCar_* If you use your own item name you will need to update the site map.

hi, is this binding still working for everybody else?

Since a couple days I only get

2022-08-30 17:01:45.936 [WARN ] [lt.internal.api.MyRenaultHttpSession] - Kamereon Response: [502] Bad Gateway <html>

Nothing has changed on my end or the account in use.

Hi @JensA It works on my computer!

Looking at the error the Kamereon server responded with a HTTP 502 response. So I would guess that it has an internal server error. Hopefully this was just a temporary thing?

@Doug_Culnane more like stupid user error - in the end. I still had an old snapshot jar in the local addons folder! I assume that version had an invalid kamereon api key?

The only mystery: why did it not fail much earlier, if it was due to invalid kamereon key?

Now I also have the api key input field in the properies. Thanks for your updates!

Since a couple of days the Renault binding is offline. I get the following error:

COMMUNICATION_ERROR
java.net.UnknownHostException: accounts.eu1.gigya.com: No address associated with hostname

What is wrong, is there something I can do? openHAB 3.3.0 Release with latest updates and the KAMEREON_APIKEY is the latest one.

Hi,

i also face a problem since some days:

2022-09-28 07:07:16.486 [WARN ] [ault.internal.handler.RenaultHandler] - Error My Renault Http Session.
java.util.concurrent.ExecutionException: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[?:?]
	at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[?:?]
	at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:730) ~[?:?]
	at org.eclipse.jetty.client.HttpClient.FORM(HttpClient.java:407) ~[?:?]
	at org.eclipse.jetty.client.HttpClient.FORM(HttpClient.java:392) ~[?:?]
	at org.openhab.binding.renault.internal.api.MyRenaultHttpSession.login(MyRenaultHttpSession.java:91) ~[?:?]
	at org.openhab.binding.renault.internal.api.MyRenaultHttpSession.initSesssion(MyRenaultHttpSession.java:74) ~[?:?]
	at org.openhab.binding.renault.internal.handler.RenaultHandler.getStatus(RenaultHandler.java:217) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.ssl.Alert.createSSLException(Alert.java:131) ~[?:?]
	at sun.security.ssl.TransportContext.fatal(TransportContext.java:353) ~[?:?]
	at sun.security.ssl.TransportContext.fatal(TransportContext.java:296) ~[?:?]
	at sun.security.ssl.TransportContext.fatal(TransportContext.java:291) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1357) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.onConsumeCertificate(CertificateMessage.java:1232) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.consume(CertificateMessage.java:1175) ~[?:?]
	at sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392) ~[?:?]
	at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:443) ~[?:?]
	at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1074) ~[?:?]
	at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1061) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:1008) ~[?:?]
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.fill(SslConnection.java:654) ~[?:?]
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.flush(SslConnection.java:1061) ~[?:?]
	at org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:422) ~[?:?]
	at org.eclipse.jetty.io.WriteFlusher.completeWrite(WriteFlusher.java:378) ~[?:?]
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.lambda$fill$1(SslConnection.java:835) ~[?:?]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[?:?]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[?:?]
	... 1 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:439) ~[?:?]
	at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306) ~[?:?]
	at sun.security.validator.Validator.validate(Validator.java:264) ~[?:?]
	at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:313) ~[?:?]
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:276) ~[?:?]
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:141) ~[?:?]
	at org.openhab.core.io.net.http.internal.ExtensibleTrustManagerImpl.checkServerTrusted(ExtensibleTrustManagerImpl.java:123) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1335) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.onConsumeCertificate(CertificateMessage.java:1232) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.consume(CertificateMessage.java:1175) ~[?:?]
	at sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392) ~[?:?]
	at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:443) ~[?:?]
	at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1074) ~[?:?]
	at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1061) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:1008) ~[?:?]
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.fill(SslConnection.java:654) ~[?:?]
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.flush(SslConnection.java:1061) ~[?:?]
	at org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:422) ~[?:?]
	at org.eclipse.jetty.io.WriteFlusher.completeWrite(WriteFlusher.java:378) ~[?:?]
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.lambda$fill$1(SslConnection.java:835) ~[?:?]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[?:?]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[?:?]
	... 1 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141) ~[?:?]
	at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126) ~[?:?]
	at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297) ~[?:?]
	at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434) ~[?:?]
	at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306) ~[?:?]
	at sun.security.validator.Validator.validate(Validator.java:264) ~[?:?]
	at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:313) ~[?:?]
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:276) ~[?:?]
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:141) ~[?:?]
	at org.openhab.core.io.net.http.internal.ExtensibleTrustManagerImpl.checkServerTrusted(ExtensibleTrustManagerImpl.java:123) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1335) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.onConsumeCertificate(CertificateMessage.java:1232) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.consume(CertificateMessage.java:1175) ~[?:?]
	at sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392) ~[?:?]
	at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:443) ~[?:?]
	at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1074) ~[?:?]
	at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1061) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:1008) ~[?:?]
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.fill(SslConnection.java:654) ~[?:?]
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.flush(SslConnection.java:1061) ~[?:?]
	at org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:422) ~[?:?]
	at org.eclipse.jetty.io.WriteFlusher.completeWrite(WriteFlusher.java:378) ~[?:?]
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.lambda$fill$1(SslConnection.java:835) ~[?:?]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[?:?]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[?:?]
	... 1 more

I changed nothing :frowning:
I unterstand the error, but i dont now what i can do!

sounds like a problem with a certificate. Did they change a certificate ?
To debug instructions at

may help

Found the error
COMMUNICATION_ERROR
java.net.UnknownHostException: accounts.eu1.gigya.com: No address associated with hostname

Of course a DNS problem, my PiHole blocked the name resolution, I added accounts.eu1.gigya.com to the white list.

2 Likes

Maybe you need to do a system update to get the latest Certificate Authority Certs?

I thought the same thing, but as if by magic, the problem has been solved…

So it was the API after all :frowning:

1 Like

Hello everybody,

with our new car (Renault Megane E-Tech EV60) the binding is working fine, but there is a warning with every poll to the car shown in the log-Viewer.

2022-12-12 15:20:38.495 [WARN ] [lt.internal.api.MyRenaultHttpSession] - Kamereon Response: [404] Not Found {“type”:“FUNCTIONAL”,“messages”:[{“code”:“err.func.404”,“message”:“{"errors":[{"status":"Not Found","code":"404 NOT_FOUND","detail":"vnext error http_code=404"}]}”}],“errors”:[{“errorCode”:“err.func.404”,“errorMessage”:“{"errors":[{"status":"Not Found","code":"404 NOT_FOUND","detail":"vnext error http_code=404"}]}”}],“error_reference”:“FUNCTIONAL”}

Hi @NikM I am not sure which HTTP call is returning this “Not found” response… (I should improve the logging.) If the binding is working then maybe some things are not working or enabled for your car or account. If you can test it for me I will l publish a debug version and we can try to debug this.

Great! Yes of course I can try to help you figure out what’s wrong.

I think using the console is the easiest way to debug. Can you access the console to set the debug mode for the binding?

This is a how for my openhab running in docker but maybe you can use the instructions in the link above.

$ docker exec -it openhab /openhab/runtime/bin/client
Password:  # (The default password for the login is: `habopen`)

                           _   _     _     ____  
   ___   ___   ___   ___  | | | |   / \   | __ ) 
  / _ \ / _ \ / _ \ / _ \ | |_| |  / _ \  |  _ \ 
 | (_) | (_) |  __/| | | ||  _  | / ___ \ | |_) )
  \___/|  __/ \___/|_| |_||_| |_|/_/   \_\|____/ 
       |_|       3.4.0.M5 - Milestone Build

Use '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
To exit, use '<ctrl-d>' or 'logout'.

openhab> log:set DEBUG org.openhab.binding.renault
openhab> log:tail 
...
...
'<ctrl-c>' # to stop
openhab> log:set WARN org.openhab.binding.renault  # to set logging back to normal
'<ctrl-d>' # to logout

If you use the openhab web UI go to the “Things → “My Renault” → disable → enable” then you will see all the requests in the log, or wait for the next polling interval.

You should see the requests and responses in the log and you can tell us which are failing. If you post any log snippets here make sure you do not include any personal information or access tokens!!!

Thank you for the explanation.
Hopefully there is everything you need in the output.

Maybe the hvacStatus could be the problem?

Haven’t looked at the DEBUG output yet, it’s possible that you also provide the car’s lastUpdate timestamp as a thing channel. So far there is only the last update of the cars location.

@NikM Thanks for the info. That is interesting. I think you are right the HVAC status is probably the issue. There is a disable HVAC flag if HttpStatus.NOT_IMPLEMENTED_501 is returned which handles this better. However maybe the 404 is also something to catch for the same situation…

Looking at the code I have tidied up the logging. This will help us debug your situation and handle it better. Please un-install the official binding (using the web UI) and copy this one to your addons folder to install this “experimental version”… The logs should help us pin point the problem and I can then create a push request for an improved version.

https://drive.google.com/file/d/1prvhxd9axVwB1bLsla1m_RuisMAHibGj/view?usp=sharing

Thanks for the help.

Thanks to you for your work.
Now it looks like this, I think its the hvac-status:

For our 2nd and older car, the Renault Zoe its working fine, without any warnings oder errors.
Think it depends on the car.

1 Like

Thanks for testing.

It would be great if you could test this version, It should work better for you and give you a better logging experience.
https://drive.google.com/file/d/1CfeRL1-yw9GuAXXh6k_yG81Ud_nsaqO0/view?usp=sharing

I think it will disable the HVAC updates on initialise after the first error and then not bother trying to update it.

So the binding works when configuring multiple cars in openHAB? (I have not tested this)

Does the HVAC status and pre-Heat function work for your Megane in the MyRenault App.? (Maybe the data is available in another interface…)

I’m happy to help and it helps me too.

Yes, I linked 2 cars with the binding and it works very well.
I have set a refresh intervall of 5 min for each car, I’m a little bit afraid to reach the poll-limit of the server, but it works so far.

Yes, the pre-conditioning works from the MYRenault app.
The app also has the function of locating the car. (with another button)

Works as expected! Great job!

If you want me to help with other testings, I’m happy to do so.

It would be great if the following timestamp was also available as a channel. As it is the time that is also displayed in the MyRenault app.

Thanks for the feedback and testing @NikM It helps me improve this binding for everyone.

I suspect the pre-conditioning will not work with openHAB now if the HVAC is disabled. It might work with the official binding version.

I will see if the python project has discovered a new service for the HVAC status… (maybe I can reverse engineer this.) If the data is available in the app it should be possible.

Just to confirm you would like the batterystatusupdated timestamp like the locationupdated timestamp channel? I can add this.

You mention there is a locate my car function in the app. You should get the location (GPS) of the car from the binding and be able to display it on a map in the web UI. I assume this is working for your new car too?