openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.58k forks source link

Tesla - passwordless authentification not working , lots of errors #2275

Closed petzlux closed 7 years ago

petzlux commented 7 years ago

Hi,

I have followed the instructions for adding my Tesla as a thing, and it works. Unfortunately, cant remove the username and password parameters, after first auth, from my thing definition as described in the doc. Also the smarthome:tesa command is not found in the karaf console.

In paralell, I have the following errors a lot in my logs:

2017-05-17 22:42:24.941 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:42:35.670 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:42:37.343 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:42:39.669 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:42:39.669 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:42:40.569 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:42:40.647 [ItemCommandEvent          ] - Item 'TeslaCar_AutoConditioning' received command OFF
2017-05-17 22:42:40.656 [INFO ] [ome.core.thing.internal.ThingManager] - Not delegating command 'OFF' for item 'TeslaCar_AutoConditioning' to handler for channel 'tesla:models:1:autoconditioning', because handler is not initialized (thing must be in status UNKNOWN, ONLINE or OFFLINE).
2017-05-17 22:42:40.661 [INFO ] [ome.core.thing.internal.ThingManager] - Not delegating update 'OFF' for item 'TeslaCar_AutoConditioning' to handler for channel 'tesla:models:1:autoconditioning', because handler is not initialized (thing must be in status UNKNOWN, ONLINE or OFFLINE).
2017-05-17 22:42:40.669 [ItemStateChangedEvent     ] - TeslaCar_AutoConditioning changed from ON to OFF
2017-05-17 22:42:51.319 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:42:52.970 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:42:56.198 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:42:56.449 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:42:56.485 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:43:02.217 [ItemStateChangedEvent     ] - TeslaCar_AutoConditioning changed from OFF to UNDEF
2017-05-17 22:43:06.969 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:43:08.575 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:43:11.904 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:43:14.184 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:43:14.399 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:43:22.583 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:43:24.179 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:43:27.548 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:43:31.146 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:43:31.248 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:43:38.269 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:43:39.840 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:43:43.154 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
2017-05-17 22:43:47.839 [ERROR] [b.binding.tesla.handler.TeslaHandler] - An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing'
kaikreuzer commented 7 years ago

@kgoderis Could you have a look?

kgoderis commented 7 years ago

@ngrodum Nicolai, I pass this one as you authored that piece of code.

@petzlux Patrick, do these errors happen to occur after you manually start and stop the binding on that Karaf console?

petzlux commented 7 years ago

Nope they happen constantly.

ngrodum commented 7 years ago

You ran smarthome:tesla logon 1 and not "smarthome:tesa" as you wrote here, right? Can you post your attempt here?

Could you elaborate a bit on "cant remove the username and password parameters"? Is the UI preventing you? The params are set to required="false".

Is there a reason to believe the errors (An exception occurred while connecting to the Tesla back-end: 'Could not update status, because callback is missing') are linked to using passwordless config?

petzlux commented 7 years ago

Yes, I tried running smarthome:tesla logon 1 sorry for the typo here ... but came back with Command not found

No I defined my thing through a .things file ... . If I put in blank for username and password , leaving my vin then the thing doesnt work anymore.

The errors occur continously even when I leave the username and password parameters set (but the binding still works as you can see my log the updates to TeslaCar_AutoConditioning happening ... )

petzlux commented 7 years ago

PS: I get a Keba P30c charging station installed in a weeks time, so I am sure to report on that integration as well 😃

ngrodum commented 7 years ago

What build are you running? The symptoms match running an older version. Do you build yourself or download a release?

then the thing doesnt work anymore.

Can you describe what "doesnt work anymore" means?

petzlux commented 7 years ago

latest openhabian release .

Doesnt work means for example I cant get the Battery Percentage ... ie. the tesla thing goes from online where the connection works, to error

ngrodum commented 7 years ago

I'm not familiar with openhabian. What OpenHAB version/build does it install?

petzlux commented 7 years ago

0.9.0.b4

ngrodum commented 7 years ago

Sorry, I mean openhab2-addons. https://github.com/openhab/openhab2-addons/releases

petzlux commented 7 years ago

Sorry for the noob questions, can I update just the tesla binding on its own ?

ngrodum commented 7 years ago

I'm a developer and build the whole thing myself. Unfortunately, that leaves me nothing short of a noob when it comes to support, and I don't have any experience with OpenHAB releases or OpenHABian at all. I think you should be able to dl a new jar and start/stop the binding.

@kgoderis I have a broken collarbone and left-hand typing here - Could you help @petzlux verify he has a recent enough build of the Tesla binding? The other error comes from BaseThinghandler: https://github.com/eclipse/smarthome/blob/master/bundles/core/org.eclipse.smarthome.core.thing/src/main/java/org/eclipse/smarthome/core/thing/binding/BaseThingHandler.java and is caught in TeslaHandler.java. Could it be an old fixed bug?

kgoderis commented 7 years ago

@petzlux You should follow the instructions at http://docs.openhab.org/installation/linux.html#changing-versions and get the latest snapshot release of openHAB instead of the 2.0.0 that currently comes with openhabian.

petzlux commented 7 years ago

Okay seems all my problems are gone with the recent snapshots. thanks everyone for your help !