Jump to content

Where to input refresh token


CManson

Recommended Posts

Posted (edited)

I just paid for the node server and am trying to get it up and running but its not clear where to insert the refresh token? Do I create a custom parameter? If so, what goes in the "key" field? I'm assuming that the token goes in "value"?

Edited by CManson
Posted

On the Configuration page of the node server it has a help to tell you how to do it.

teslaEV

Installation

For cloud access through Tesla cloud service one must provide a "refresh token" (REFRESH_TOKEN).
It can be obtained e.g. using Auth for Tesla iPhone app https://apps.apple.com/us/app/auth-app-for-tesla/id1552058613 or Tesla Tokens https://play.google.com/store/apps/details?id=net.leveugle.teslatokens

Posted

Thanks. I have no issue generating the token, my question is where to put it. This is what I see on the configuration page of the node server. I don't see a help section. 

Screen Shot 2022-06-17 at 6.38.06 PM.png

Posted

t looks like you found the place to put it  (at the bottom - REFRESH_TOKEN) - Is the one shown one you entered - if not clear the filed and replace it with your token - make sure that there is not a blank space at the end of the token - I had that issue in the past.  If it does not work, can you post a log file there - I need to know what it is wrong.

Also it the version looks wrong - but it could be related to the node not starting 

 

 

Posted

So I can't actually access the log file (see error in attached screenshot) and when I try and start it says "Node Server Start: automatic update failed"

Screen Shot 2022-06-18 at 10.33.12 AM.png

Posted

@CManson your node server is showing disconnected. I would try restarting and sometimes you have to hit the browser refresh to bring everything in sync.

@Panda88 my token expired at the same time of the recent updates and I am unable to get my car listed again here are the errors I see in the log

2022-06-18 00:01:57,270 Thread-2086 udi_interface DEBUG TeslaEVController:systemPoll: systemPoll 2022-06-18 00:01:57,272 Thread-2086 udi_interface INFO TeslaEVController:longPoll: Tesla EV Controller longPoll - connected = True 2022-06-18 00:01:57,272 Thread-2086 udi_interface ERROR udi_interface:write: Exception in thread 2022-06-18 00:01:57,273 Thread-2086 udi_interface ERROR udi_interface:write: Thread-2086 2022-06-18 00:01:57,274 Thread-2086 udi_interface ERROR udi_interface:write: : 2022-06-18 00:01:57,274 Thread-2086 udi_interface ERROR udi_interface:write: Traceback (most recent call last): 2022-06-18 00:01:57,275 Thread-2086 udi_interface ERROR udi_interface:write: File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner 2022-06-18 00:01:57,279 Thread-2086 udi_interface ERROR udi_interface:write: self.run() 2022-06-18 00:01:57,279 Thread-2086 udi_interface ERROR udi_interface:write: File "/usr/local/lib/python3.8/threading.py", line 870, in run 2022-06-18 00:01:57,283 Thread-2086 udi_interface ERROR udi_interface:write: self._target(*self._args, **self._kwargs) 2022-06-18 00:01:57,284 Thread-2086 udi_interface ERROR udi_interface:write: File "./TeslaEVController.py", line 271, in systemPoll 2022-06-18 00:01:57,286 Thread-2086 udi_interface ERROR udi_interface:write: self.longPoll() 2022-06-18 00:01:57,286 Thread-2086 udi_interface ERROR udi_interface:write: File "./TeslaEVController.py", line 286, in longPoll 2022-06-18 00:01:57,288 Thread-2086 udi_interface ERROR udi_interface:write: for vehicle in range(0,len(self.vehicleList)): 2022-06-18 00:01:57,289 Thread-2086 udi_interface ERROR udi_interface:write: AttributeError 2022-06-18 00:01:57,289 Thread-2086 udi_interface ERROR udi_interface:write: : 2022-06-18 00:01:57,290 Thread-2086 udi_interface ERROR udi_interface:write: 'TeslaEVController' object has no attribute 'vehicleList'

Posted

@CManson it looks like you have a different version than @tazman. Your screen shot is showing version 0.0.0. To update the node server you need to go to the Node Server Store and hit "Refresh Store". image.png

The version showing on the production store currently is 0.1.9

Once you have the new version showing in the store on the right might be an option to "upgrade". Otherwise you can restart the node server and it should pull down and install the new production version automatically. But the first step is to run the "Refresh Store" process. 

image.png

I don't know if that will make much difference as @tazman is having issues that the developer might need to work out. 

 

Posted
4 hours ago, tazman said:

@CManson your node server is showing disconnected. I would try restarting and sometimes you have to hit the browser refresh to bring everything in sync.

@Panda88 my token expired at the same time of the recent updates and I am unable to get my car listed again here are the errors I see in the log

2022-06-18 00:01:57,270 Thread-2086 udi_interface DEBUG TeslaEVController:systemPoll: systemPoll 2022-06-18 00:01:57,272 Thread-2086 udi_interface INFO TeslaEVController:longPoll: Tesla EV Controller longPoll - connected = True 2022-06-18 00:01:57,272 Thread-2086 udi_interface ERROR udi_interface:write: Exception in thread 2022-06-18 00:01:57,273 Thread-2086 udi_interface ERROR udi_interface:write: Thread-2086 2022-06-18 00:01:57,274 Thread-2086 udi_interface ERROR udi_interface:write: : 2022-06-18 00:01:57,274 Thread-2086 udi_interface ERROR udi_interface:write: Traceback (most recent call last): 2022-06-18 00:01:57,275 Thread-2086 udi_interface ERROR udi_interface:write: File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner 2022-06-18 00:01:57,279 Thread-2086 udi_interface ERROR udi_interface:write: self.run() 2022-06-18 00:01:57,279 Thread-2086 udi_interface ERROR udi_interface:write: File "/usr/local/lib/python3.8/threading.py", line 870, in run 2022-06-18 00:01:57,283 Thread-2086 udi_interface ERROR udi_interface:write: self._target(*self._args, **self._kwargs) 2022-06-18 00:01:57,284 Thread-2086 udi_interface ERROR udi_interface:write: File "./TeslaEVController.py", line 271, in systemPoll 2022-06-18 00:01:57,286 Thread-2086 udi_interface ERROR udi_interface:write: self.longPoll() 2022-06-18 00:01:57,286 Thread-2086 udi_interface ERROR udi_interface:write: File "./TeslaEVController.py", line 286, in longPoll 2022-06-18 00:01:57,288 Thread-2086 udi_interface ERROR udi_interface:write: for vehicle in range(0,len(self.vehicleList)): 2022-06-18 00:01:57,289 Thread-2086 udi_interface ERROR udi_interface:write: AttributeError 2022-06-18 00:01:57,289 Thread-2086 udi_interface ERROR udi_interface:write: : 2022-06-18 00:01:57,290 Thread-2086 udi_interface ERROR udi_interface:write: 'TeslaEVController' object has no attribute 'vehicleList'

ny chance you can provide a full log - the error happens earlier - but it does look like the token did not refresh corectly

Tesla does change their API once in a while and as there is no official API it takes a little while to get it updated

It can also happen they log you out if you poll too often so try to log in at website to see if that works 

I am travelling now so there will be some delay on support 

 

Posted
5 hours ago, CManson said:

So I can't actually access the log file (see error in attached screenshot) and when I try and start it says "Node Server Start: automatic update failed"

Screen Shot 2022-06-18 at 10.33.12 AM.png

try to start again but get the log from upper right corner - it looks like the node server does not start at all 

Posted

Here is the main log:

 

 
6/18/2022, 16:03:43 [pg3] debug: [PUBLISH: udi/pg3/ns/clients/00:21:b9:02:54:be_2] {"shortPoll":{}} 6/18/2022, 16:03:43 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_6 to broker pg3_broker 6/18/2022, 16:03:43 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_2 to broker pg3_broker 6/18/2022, 16:03:45 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3frontend_DF0Q3 has published message on udi/pg3/frontend/ns/admin to broker pg3_broker 6/18/2022, 16:03:45 [pg3] info: [TeslaEV(5)]: Restarting Node server 6/18/2022, 16:03:45 [pg3] warn: [TeslaEV(5)]: Was not running. Starting... 6/18/2022, 16:03:48 [pg3] debug: [PUBLISH: udi/pg3/ns/clients/00:21:b9:02:54:be_6] {"shortPoll":{}} 6/18/2022, 16:03:48 [pg3] debug: [PUBLISH: udi/pg3/ns/clients/00:21:b9:02:54:be_2] {"shortPoll":{}} 6/18/2022, 16:03:48 [pg3] info: startNs:: TeslaEV 6/18/2022, 16:03:48 [pg3] info: startNs:: TeslaEV is valid 6/18/2022, 16:03:48 [pg3] error: store get requires a nsid 6/18/2022, 16:03:48 [pg3] error: Node server TeslaEV has no store entry. 6/18/2022, 16:03:48 [pg3] error: TeslaEV automatic update failed 6/18/2022, 16:03:48 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_6 to broker pg3_broker 6/18/2022, 16:03:48 [pg3] debug: MQTT Results: [frontend/ns/admin] :: {"restartNs":{"success":false,"error":"automatic update failed"}} 6/18/2022, 16:03:48 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_2 to broker pg3_broker 6/18/2022, 16:03:48 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/frontend/clients/d207e2a7-1484-4ed1-9613-8d2d1e1e88fd to broker pg3_broker 6/18/2022, 16:03:48 [pg3] debug: [PUBLISH: udi/pg3/ns/clients/00:21:b9:02:54:be_5] {"longPoll":{}} 6/18/2022, 16:03:48 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_5 to broker pg3_broker 6/18/2022, 16:03:50 [pg3] debug: [PUBLISH: udi/pg3/ns/clients/00:21:b9:02:54:be_6] {"longPoll":{}} 6/18/2022, 16:03:50 [pg3] debug: [PUBLISH: udi/pg3/ns/clients/00:21:b9:02:54:be_4] {"shortPoll":{}} 6/18/2022, 16:03:50 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_6 to broker pg3_broker 6/18/2022, 16:03:50 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_4 to broker pg3_broker 6/18/2022, 16:03:53 [pg3] debug: [PUBLISH: udi/pg3/ns/clients/00:21:b9:02:54:be_6] {"shortPoll":{}} 6/18/2022, 16:03:53 [pg3] debug: [PUBLISH: udi/pg3/ns/clients/00:21:b9:02:54:be_2] {"shortPoll":{}} 6/18/2022, 16:03:53 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_6 to broker pg3_broker 6/18/2022, 16:03:53 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_2 to broker pg3_broker 6/18/2022, 16:03:53 [pg3] debug: Client pg3frontend_DF0Q3 unsubscribed from udi/pg3/frontend/clients/d207e2a7-1484-4ed1-9613-8d2d1e1e88fd/log/00:21:b9:02:54:be_5 6/18/2022, 16:03:53 [pg3] debug: Stopping log stream for pg3frontend_DF0Q3 6/18/2022, 16:03:53 [pg3] debug: Sending logfile to frontend :: /var/polyglot/pg3/logs/pg3-current.log 6/18/2022, 16:03:53 [pg3] error: MQTTS: connectionError: null connect did not arrive in time
6/18/2022, 16:03:54 [pg3] debug: Starting log stream for pg3frontend_DF0Q3 :: /var/polyglot/pg3/logs/pg3-current.log
6/18/2022, 16:03:57 [pg3] error: MQTTS: clientError: 00:21:b9:02:54:be_5 Auth Error
6/18/2022, 16:03:58 [pg3] debug: [PUBLISH: udi/pg3/ns/clients/00:21:b9:02:54:be_6] {"shortPoll":{}}
6/18/2022, 16:03:58 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_6 to broker pg3_broker
6/18/2022, 16:03:58 [pg3] debug: [PUBLISH: udi/pg3/ns/clients/00:21:b9:02:54:be_2] {"shortPoll":{}}
6/18/2022, 16:03:58 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_2 to broker pg3_broker
6/18/2022, 16:04:03 [pg3] debug: [PUBLISH: udi/pg3/ns/clients/00:21:b9:02:54:be_6] {"shortPoll":{}}
6/18/2022, 16:04:03 [pg3] debug: [PUBLISH: udi/pg3/ns/clients/00:21:b9:02:54:be_2] {"shortPoll":{}}
6/18/2022, 16:04:03 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_6 to broker pg3_broker
6/18/2022, 16:04:03 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_2 to broker pg3_broker
6/18/2022, 16:04:05 [pg3] debug: [PUBLISH: udi/pg3/ns/clients/00:21:b9:02:54:be_4] {"shortPoll":{}}
6/18/2022, 16:04:05 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_4 to broker pg3_broker
6/18/2022, 16:04:06 [pg3] debug: [PUBLISH: udi/pg3/ns/clients/00:21:b9:02:54:be_5] {"shortPoll":{}}
6/18/2022, 16:04:06 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_5 to broker pg3_broker
6/18/2022, 16:04:08 [pg3] debug: [PUBLISH: udi/pg3/ns/clients/00:21:b9:02:54:be_6] {"shortPoll":{}}
6/18/2022, 16:04:08 [pg3] debug: [PUBLISH: udi/pg3/ns/clients/00:21:b9:02:54:be_2] {"shortPoll":{}}
6/18/2022, 16:04:08 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_6 to broker pg3_broker
6/18/2022, 16:04:08 [pg3] debug: [MESSAGE_PUBLISHED] Client pg3_client has published message on udi/pg3/ns/clients/00:21:b9:02:54:be_2 to broker pg3_broker
Posted

looks like something went wrong during installation - Can you try to remove it (fully) and install again - it is like it is not registered correctly in the node store 

 

Posted
1 hour ago, Panda88 said:

ny chance you can provide a full log - the error happens earlier - but it does look like the token did not refresh corectly

Tesla does change their API once in a while and as there is no official API it takes a little while to get it updated

It can also happen they log you out if you poll too often so try to log in at website to see if that works 

I am travelling now so there will be some delay on support 

 

I attached the log from a restart so I could edit out the token because I don't want to post that. The new token was created with the Tesla Tokens app again.

Tesla.txt

Posted
1 hour ago, Panda88 said:

looks like something went wrong during installation - Can you try to remove it (fully) and install again - it is like it is not registered correctly in the node store 

 

Reinstalling did the trick in getting the latest version downloaded and starting the node server. For a minute or two the car appeared as a node but then disappeared? Any thoughts from the attached log?

Log.rtf

Posted
46 minutes ago, tazman said:

I attached the log from a restart so I could edit out the token because I don't want to post that. The new token was created with the Tesla Tokens app again.

Tesla.txt 20.42 kB · 1 download

Can you try to erase the REFRESH_TOKEN key save (not just the  value but the key)- and then restart?  It seems to old token is somehow stuck in polyglots database

 

Posted
8 minutes ago, CManson said:

Reinstalling did the trick in getting the latest version downloaded and starting the node server. For a minute or two the car appeared as a node but then disappeared? Any thoughts from the attached log?

Log.rtf 17.2 kB · 0 downloads

Looks like the return structure from Tesla has changed a little  - need to look through the changes and make appropriate modifications 

Posted
27 minutes ago, Panda88 said:

Can you try to erase the REFRESH_TOKEN key save (not just the  value but the key)- and then restart?  It seems to old token is somehow stuck in polyglots database

 

That worked and mine is back online.

Posted (edited)
9 hours ago, CManson said:

Reinstalling did the trick in getting the latest version downloaded and starting the node server. For a minute or two the car appeared as a node but then disappeared? Any thoughts from the attached log?

Log.rtf 17.2 kB · 3 downloads

Are you running on stand alone ISY or IoP (ISY on Polisy)  - my guess it is what is happening is the ISY is slower than my setup so it is not ready when the code starts querying the nodes

Can I get you to try again with login set to debug.  - it is info now - but you previous screen shot showed debug

I made some changes to ensure the node is ready before querying data from it - I hope it works as I cannot test as I am travelling (It is a minor change - no other functionality)

Edited by Panda88
Posted

This sounds like the same thing happened to me when installing the ecobee app. I installed the code into ecobee. It registered OK. I rebooted polisy and the admin console but no go. Then I deleted the app code in the ecobee app and reinstalled it and then the ecobee NS installed all the nodes into my IoP. The first time would not perform no matter what I tried to jog.

@bpwwer @JimboAutomatesPerhaps something is being stubborn inside PG3 when you first install a NS. Pin code early time out on initialisation, maybe?

Posted
16 hours ago, Panda88 said:

Are you running on stand alone ISY or IoP (ISY on Polisy)  - my guess it is what is happening is the ISY is slower than my setup so it is not ready when the code starts querying the nodes

Can I get you to try again with login set to debug.  - it is info now - but you previous screen shot showed debug

I made some changes to ensure the node is ready before querying data from it - I hope it works as I cannot test as I am travelling (It is a minor change - no other functionality)

Running stand alone ISY.

Debug log below (with characters removed from the refresh_token for security)

 

 
2022-06-19 19:30:18,433 Thread-6 udi_interface INFO TeslaEVController:handleLevelChange: New log level: {'name': 'DEBUG', 'level': 10}
2022-06-19 19:30:31,843 MQTT udi_interface.interface DEBUG interface:_message: QUEUING incoming message stop
2022-06-19 19:30:31,844 Command udi_interface.interface DEBUG interface:_parseInput: DEQUEING stop
2022-06-19 19:30:31,845 Command udi_interface.interface INFO interface:_handleInput: Received stop from Polyglot... Shutting Down.
2022-06-19 19:30:31,846 Command udi_interface.interface INFO interface:stop: Disconnecting from MQTT... localhost:1888
2022-06-19 19:30:31,847 Command udi_interface.interface INFO interface:_disconnect: MQTT Graceful disconnection.
2022-06-19 19:30:31,849 MQTT udi_interface.interface DEBUG interface:_startMqtt: MQTT: Done
2022-06-19 19:30:39,511 MainThread udi_interface INFO polylogger:set_basic_config: set_basic_config: enable=True level=30
2022-06-19 19:30:42,088 MainThread udi_interface INFO __init__:<module>: UDI Python Interface for Polyglot version 3 3.0.46 Starting...
2022-06-19 19:30:42,106 MainThread udi_interface INFO TeslaEVController:<module>: Starting TeslaEV Controller
2022-06-19 19:30:42,115 MainThread udi_interface.interface INFO interface:__init__: Initialization received from Polyglot V3 3.0.63 [ISY: 5.3.4, Slot: 5]
2022-06-19 19:30:42,117 MainThread udi_interface.interface INFO interface:__init__: Connect: Network Interface: {'addr': '192.168.7.146', 'netmask': '255.255.255.0', 'broadcast': '192.168.7.255'}
2022-06-19 19:30:42,119 Interface udi_interface.interface INFO interface:_startMqtt: Connecting to MQTT... localhost:1888
2022-06-19 19:30:42,125 MainThread udi_interface.interface INFO interface:updateProfile: Sending Install Profile command to Polyglot.
2022-06-19 19:30:42,127 MainThread udi_interface.interface WARNING interface:send: MQTT Send waiting on connection :: {'installprofile': {'reboot': False}}
2022-06-19 19:30:42,165 MQTT udi_interface.interface INFO interface:_connect: MQTT Connected with result code 0 (Success)
2022-06-19 19:30:42,166 MQTT udi_interface.interface INFO interface:_connect: MQTT Subscribing to topic: udi/pg3/ns/clients/00:21:b9:02:54:be_5 - MID: 1 Result: 0
2022-06-19 19:30:42,178 MQTT udi_interface.interface INFO interface:_subscribe: MQTT Subscribed Succesfully for Message ID: 1 - QoS: (0,)
2022-06-19 19:30:45,268 MainThread udi_interface.interface WARNING interface:db_getNodeDrivers: controller not found in database.
2022-06-19 19:30:45,269 MainThread udi_interface INFO TeslaEVController:__init__: _init_ Tesla EV Controller
2022-06-19 19:30:45,270 MainThread udi_interface.interface INFO interface:updateProfile: Sending Install Profile command to Polyglot.
2022-06-19 19:30:45,274 MainThread udi_interface.interface INFO interface:addNode: Adding node Tesla EV Info(controller) [None]
2022-06-19 19:30:45,371 MQTT udi_interface.interface INFO interface:_message: custom data response {'customparamsdoc': '<h1>teslaEV</h1>\n\n<h2>Installation</h2>\n\n<p>For cloud access through Tesla cloud service one must provide a "refresh token" (REFRESH_TOKEN). <br />\nIt can be obtained e.g. using Auth for Tesla iPhone app \nhttps://apps.apple.com/us/app/auth-app-for-tesla/id1552058613 or Tesla Tokens https://play.google.com/store/apps/details?id=net.leveugle.teslatokens</p>\n\n<p>Once the token is accepted the node server will try to keep the token refreshed. </p>\n\n<p>Once installed a status node for each EV registered in the user account is created with sub-nodes for each EV addressing charging and climate control.</p>\n\n<p>If additional functionality is desired contact the author through github - https://github.com/Panda88CO/udi-TeslaEV</p>\n\n<p>Enjoy</p>\n'}
2022-06-19 19:30:45,414 MQTT udi_interface.interface INFO interface:_message: Successfully set key = customparamsdoc
2022-06-19 19:30:45,557 Thread-1 udi_interface INFO TeslaEVController:handleLevelChange: New log level: {'name': 'DEBUG', 'level': 10}
2022-06-19 19:30:45,593 MQTT udi_interface.interface DEBUG interface:_message: QUEUING incoming message getAll
2022-06-19 19:30:45,595 Command udi_interface.interface DEBUG interface:_parseInput: DEQUEING getAll
2022-06-19 19:30:45,597 Thread-2 udi_interface DEBUG TeslaEVController:handleParams: handleParams
2022-06-19 19:30:45,599 Command udi_interface.custom DEBUG custom:load: CUSTOM: load {}
2022-06-19 19:30:45,599 Thread-2 udi_interface.custom DEBUG custom:load: CUSTOM: load {'REFRESH_TOKEN': 'eyGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlR3bjV2bmNQUHhYNmprc2w5SUYyNnF4VVFfdyJ9.eyJpc3MiOiJodHRwczovL2F1dGgudGVzbGEuY29tL29hdXRoMi92MyIsImF1ZCI6Imh0dHBzOi8vYXV0aC50ZXNsYS5jb20vb2F1dGgyL3YzL3Rva2VuIiwiaWF0IjoxNjU1NDk0NjIwLCJzY3AiOlsib3BlbmlkIiwib2ZmbGluZV9hY2Nlc3MiXSwiZGF0YSI6eyJ2IjoiMSIsImF1ZCI6Imh0dHBzOi8vb3duZXItYXBpLnRlc2xhbW90b3JzLmNvbS8iLCJzdWIiOiJhMjQ5ZTI3OS02Nzc1LTQzODYtYjI2ZS04YjNhMjdiNTMxZTciLCJzY3AiOlsib3BlbmlkIiwiZW1haWwiLCJvZmZsaW5lX2FjY2VzcyJdLCJhenAiOiJvd25lcmFwaSIsImFtciI6WyJwd2QiXSwiYXV0aF90aW1lIjoxNjU1NDk0NjE2fX0.a9GUCplNYatb-fJANUb-qyrdRljHGY-f_2Jpkbgx_IQaRjR90Y3iDmblwsjBZZeP8H5coBxgA1PnO5YR1y9K_qfn2dxjdJ7fZ2UdrdmNN6YB_kgcsT-pwr_6hKy12SAS69XwbZhixVJxlP9V4x8PUwoa5lFCJ9-T_0wUYBWcGX-M4t9gvSaBFwGY7oQHt7eiWSnki0xQTIWAQyK4sc2exR0oMtEdWogfhbR-TrS29YQnccbJJ-JYt6dLQXoIixnoiRbWuSROAxzzZYs5OSzXjCDY7Q2FqCZnOyEnPmD0LxAn9uDXftTxkL3JSDKNDHfHdIUEmLD0nmIy3S_dcQP9Cw'}
2022-06-19 19:30:45,601 Command udi_interface.interface DEBUG interface:_handleInput: Key nsdata should be passed to node server.
2022-06-19 19:30:45,602 Thread-2 udi_interface.custom DEBUG custom:load: CUSTOM: -- checking REFRESH_TOKEN / eyGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlR3bjV2bmNQUHhYNmprc2w5SUYyNnF4VVFfdyJ9.eyJpc3MiOiJodHRwczovL2F1dGgudGVzbGEuY29tL29hdXRoMi92MyIsImF1ZCI6Imh0dHBzOi8vYXV0aC50ZXNsYS5jb20vb2F1dGgyL3YzL3Rva2VuIiwiaWF0IjoxNjU1NDk0NjIwLCJzY3AiOlsib3BlbmlkIiwib2ZmbGluZV9hY2Nlc3MiXSwiZGF0YSI6eyJ2IjoiMSIsImF1ZCI6Imh0dHBzOi8vb3duZXItYXBpLnRlc2xhbW90b3JzLmNvbS8iLCJzdWIiOiJhMjQ5ZTI3OS02Nzc1LTQzODYtYjI2ZS04YjNhMjdiNTMxZTciLCJzY3AiOlsib3BlbmlkIiwiZW1haWwiLCJvZmZsaW5lX2FjY2VzcyJdLCJhenAiOiJvd25lcmFwaSIsImFtciI6WyJwd2QiXSwiYXV0aF90aW1lIjoxNjU1NDk0NjE2fX0.a9GUCplNYatb-fJANUb-qyrdRljHGY-f_2Jpkbgx_IQaRjR90Y3iDmblwsjBZZeP8H5coBxgA1PnO5YR1y9K_qfn2dxjdJ7fZ2UdrdmNN6YB_kgcsT-pwr_6hKy12SAS69XwbZhixVJxlP9V4x8PUwoa5lFCJ9-T_0wUYBWcGX-M4t9gvSaBFwGY7oQHt7eiWSnki0xQTIWAQyK4sc2exR0oMtEdWogfhbR-TrS29YQnccbJJ-JYt6dLQXoIixnoiRbWuSROAxzzZYs5OSzXjCDY7Q2FqCZnOyEnPmD0LxAn9uDXftTxkL3JSDKNDHfHdIUEmLD0nmIy3S_dcQP9Cw
2022-06-19 19:30:45,605 MQTT udi_interface.interface DEBUG interface:_message: QUEUING incoming message getNsInfo
2022-06-19 19:30:45,605 Command udi_interface.interface DEBUG interface:_handleInput: Key oauth should be passed to node server.
2022-06-19 19:30:45,607 Thread-2 udi_interface DEBUG TeslaEVController:handleParams: handleParams load - {'REFRESH_TOKEN': 'eyGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlR3bjV2bmNQUHhYNmprc2w5SUYyNnF4VVFfdyJ9.eyJpc3MiOiJodHRwczovL2F1dGgudGVzbGEuY29tL29hdXRoMi92MyIsImF1ZCI6Imh0dHBzOi8vYXV0aC50ZXNsYS5jb20vb2F1dGgyL3YzL3Rva2VuIiwiaWF0IjoxNjU1NDk0NjIwLCJzY3AiOlsib3BlbmlkIiwib2ZmbGluZV9hY2Nlc3MiXSwiZGF0YSI6eyJ2IjoiMSIsImF1ZCI6Imh0dHBzOi8vb3duZXItYXBpLnRlc2xhbW90b3JzLmNvbS8iLCJzdWIiOiJhMjQ5ZTI3OS02Nzc1LTQzODYtYjI2ZS04YjNhMjdiNTMxZTciLCJzY3AiOlsib3BlbmlkIiwiZW1haWwiLCJvZmZsaW5lX2FjY2VzcyJdLCJhenAiOiJvd25lcmFwaSIsImFtciI6WyJwd2QiXSwiYXV0aF90aW1lIjoxNjU1NDk0NjE2fX0.a9GUCplNYatb-fJANUb-qyrdRljHGY-f_2Jpkbgx_IQaRjR90Y3iDmblwsjBZZeP8H5coBxgA1PnO5YR1y9K_qfn2dxjdJ7fZ2UdrdmNN6YB_kgcsT-pwr_6hKy12SAS69XwbZhixVJxlP9V4x8PUwoa5lFCJ9-T_0wUYBWcGX-M4t9gvSaBFwGY7oQHt7eiWSnki0xQTIWAQyK4sc2exR0oMtEdWogfhbR-TrS29YQnccbJJ-JYt6dLQXoIixnoiRbWuSROAxzzZYs5OSzXjCDY7Q2FqCZnOyEnPmD0LxAn9uDXftTxkL3JSDKNDHfHdIUEmLD0nmIy3S_dcQP9Cw'}
2022-06-19 19:30:45,609 Command udi_interface.interface DEBUG interface:_parseInput: DEQUEING getNsInfo
2022-06-19 19:30:45,609 Thread-2 udi_interface.custom DEBUG custom:clear: CUSTOM: Clear ...saving
2022-06-19 19:30:45,611 Thread-2 udi_interface.custom INFO custom:_save: Sending data notices to Polyglot.
2022-06-19 19:30:45,612 Thread-2 udi_interface.interface DEBUG interface:send: PUBLISHING {'set': [{'key': 'notices', 'value': {}}]}
2022-06-19 19:30:45,614 Thread-2 udi_interface INFO TeslaEVController:tesla_initialize: starting Login process
2022-06-19 19:30:45,615 Thread-2 udi_interface DEBUG TeslaCloudEVapi:__init__: teslaCloudEVapi
2022-06-19 19:30:45,615 Thread-2 udi_interface DEBUG TeslaCloudApi:__init__: teslaCloudApi
2022-06-19 19:30:45,661 MQTT udi_interface.interface DEBUG interface:_message: QUEUING incoming message notices
2022-06-19 19:30:45,663 Command udi_interface.interface DEBUG interface:_parseInput: DEQUEING notices
2022-06-19 19:30:45,664 Command udi_interface.custom DEBUG custom:load: CUSTOM: load {}
2022-06-19 19:30:45,710 MQTT udi_interface.interface INFO interface:_message: Successfully set key = notices
2022-06-19 19:30:45,750 MQTT udi_interface.interface INFO interface:_message: Profile installation finished
2022-06-19 19:30:46,298 MQTT udi_interface.interface INFO interface:_message: Profile installation finished
2022-06-19 19:30:46,594 Thread-2 udi_interface.node DEBUG node:setDriver: controller:Tesla EV Info Reporting set GV0 to 1 to Polyglot
2022-06-19 19:30:46,595 Thread-2 udi_interface.node DEBUG node:reportDriver: Updating value to 1
2022-06-19 19:30:46,595 Thread-2 udi_interface.interface DEBUG interface:send: PUBLISHING {'set': [{'address': 'controller', 'driver': 'GV0', 'value': '1', 'uom': 25}]}
2022-06-19 19:30:46,597 Thread-2 udi_interface DEBUG TeslaEVController:tesla_initialize: Controller - initialization done
2022-06-19 19:30:46,598 Thread-2 udi_interface DEBUG TeslaEVController:handleParams: done with parameter processing
2022-06-19 19:30:47,888 MQTT udi_interface.interface DEBUG interface:_message: QUEUING incoming message addnode
2022-06-19 19:30:47,889 Command udi_interface.interface DEBUG interface:_parseInput: DEQUEING addnode
2022-06-19 19:30:47,892 Command udi_interface.interface DEBUG interface:_handleResult: add node response: {'id': '2ac49930-e90f-499d-8281-0afd5fec4d1f', 'uuid': '00:21:b9:02:54:be', 'profileNum': 5, 'address': 'controller', 'name': 'Tesla EV Info', 'nodeDefId': 'controller', 'nls': None, 'hint': '0x00000000', 'controller': 0, 'primaryNode': 'controller', 'private': None, 'isPrimary': 1, 'enabled': 1, 'timeAdded': 1655583162646, 'timeModified': 1655583162646, 'dbVersion': 1}
2022-06-19 19:30:47,893 Thread-4 udi_interface INFO TeslaEVController:start: start
2022-06-19 19:30:47,896 Thread-4 udi_interface.interface INFO interface:updateProfile: Sending Install Profile command to Polyglot.
2022-06-19 19:30:47,897 Thread-4 udi_interface.interface DEBUG interface:send: PUBLISHING {'installprofile': {'reboot': False}}
2022-06-19 19:30:47,929 MainThread udi_interface.node DEBUG node:setDriver: controller:Tesla EV Info Reporting set ST to 1 to Polyglot
2022-06-19 19:30:47,930 MainThread udi_interface.node DEBUG node:reportDriver: Updating value to 1
2022-06-19 19:30:47,931 MainThread udi_interface.interface DEBUG interface:send: PUBLISHING {'set': [{'address': 'controller', 'driver': 'ST', 'value': '1', 'uom': 2}]}
2022-06-19 19:30:47,932 MainThread udi_interface INFO TeslaEVController:__init__: Controller init DONE
2022-06-19 19:30:47,964 Thread-4 udi_interface.interface DEBUG interface:setCustomParamsDoc: Sending customparamsdoc to Polyglot.
2022-06-19 19:30:47,965 Thread-4 udi_interface.interface DEBUG interface:send: PUBLISHING {'set': [{'key': 'customparamsdoc', 'value': '<h1>teslaEV</h1>\n\n<h2>Installation</h2>\n\n<p>For cloud access through Tesla cloud service one must provide a "refresh token" (REFRESH_TOKEN). <br />\nIt can be obtained e.g. using Auth for Tesla iPhone app \nhttps://apps.apple.com/us/app/auth-app-for-tesla/id1552058613 or Tesla Tokens https://play.google.com/store/apps/details?id=net.leveugle.teslatokens</p>\n\n<p>Once the token is accepted the node server will try to keep the token refreshed. </p>\n\n<p>Once installed a status node for each EV registered in the user account is created with sub-nodes for each EV addressing charging and climate control.</p>\n\n<p>If additional functionality is desired contact the author through github - https://github.com/Panda88CO/udi-TeslaEV</p>\n\n<p>Enjoy</p>\n'}]}
2022-06-19 19:30:47,967 Thread-4 udi_interface INFO TeslaEVController:tesla_initialize: starting Login process
2022-06-19 19:30:47,968 Thread-4 udi_interface DEBUG TeslaCloudEVapi:__init__: teslaCloudEVapi
2022-06-19 19:30:47,968 Thread-4 udi_interface DEBUG TeslaCloudApi:__init__: teslaCloudApi
2022-06-19 19:30:48,073 MQTT udi_interface.interface INFO interface:_message: custom data response {'customparamsdoc': '<h1>teslaEV</h1>\n\n<h2>Installation</h2>\n\n<p>For cloud access through Tesla cloud service one must provide a "refresh token" (REFRESH_TOKEN). <br />\nIt can be obtained e.g. using Auth for Tesla iPhone app \nhttps://apps.apple.com/us/app/auth-app-for-tesla/id1552058613 or Tesla Tokens https://play.google.com/store/apps/details?id=net.leveugle.teslatokens</p>\n\n<p>Once the token is accepted the node server will try to keep the token refreshed. </p>\n\n<p>Once installed a status node for each EV registered in the user account is created with sub-nodes for each EV addressing charging and climate control.</p>\n\n<p>If additional functionality is desired contact the author through github - https://github.com/Panda88CO/udi-TeslaEV</p>\n\n<p>Enjoy</p>\n'}
2022-06-19 19:30:48,115 MQTT udi_interface.interface INFO interface:_message: Successfully set key = customparamsdoc
2022-06-19 19:30:48,221 MQTT udi_interface.interface INFO interface:_message: Successfully set controller :: GV0 to 1 UOM 25
2022-06-19 19:30:48,373 MQTT udi_interface.interface INFO interface:_message: Successfully set controller :: ST to 1 UOM 2
2022-06-19 19:30:48,489 MQTT udi_interface.interface INFO interface:_message: Profile installation finished
2022-06-19 19:30:48,663 Thread-4 udi_interface.node DEBUG node:setDriver: controller:Tesla EV Info Reporting set GV0 to 1 to Polyglot
2022-06-19 19:30:48,664 Thread-4 udi_interface.node DEBUG node:reportDriver: Updating value to 1
2022-06-19 19:30:48,665 Thread-4 udi_interface.interface DEBUG interface:send: PUBLISHING {'set': [{'address': 'controller', 'driver': 'GV0', 'value': '1', 'uom': 25}]}
2022-06-19 19:30:48,667 Thread-4 udi_interface DEBUG TeslaEVController:tesla_initialize: Controller - initialization done
2022-06-19 19:30:48,667 Thread-4 udi_interface DEBUG TeslaCloudEVapi:teslaEV_GetIdList: teslaEV_GetVehicleIdList:
2022-06-19 19:30:48,787 MQTT udi_interface.interface INFO interface:_message: Successfully set controller :: GV0 to 1 UOM 25
2022-06-19 19:31:40,105 MQTT udi_interface.interface DEBUG interface:_message: QUEUING incoming message shortPoll
2022-06-19 19:31:40,107 Command udi_interface.interface DEBUG interface:_parseInput: DEQUEING shortPoll
2022-06-19 19:31:40,108 Thread-6 udi_interface DEBUG TeslaEVController:systemPoll: systemPoll
2022-06-19 19:31:40,110 Thread-6 udi_interface INFO TeslaEVController:shortPoll: Tesla EV Controller shortPoll(HeartBeat)
2022-06-19 19:31:40,110 Thread-6 udi_interface DEBUG TeslaEVController:heartbeat: heartbeat: 0
2022-06-19 19:31:40,111 Thread-6 udi_interface.interface DEBUG interface:send: PUBLISHING {'command': [{'address': 'controller', 'cmd': 'DON'}]}
2022-06-19 19:31:40,199 MQTT udi_interface.interface DEBUG interface:_message: QUEUING incoming message command
2022-06-19 19:31:40,201 Command udi_interface.interface DEBUG interface:_parseInput: DEQUEING command
2022-06-19 19:31:48,378 Thread-4 udi_interface DEBUG TeslaCloudEVapi:teslaEV_GetIdList: Exception teslaEV_GetVehicleIdList: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2022-06-19 19:31:48,379 Thread-4 udi_interface ERROR TeslaCloudEVapi:teslaEV_GetIdList: Error getting vehicle list
2022-06-19 19:31:48,380 Thread-4 udi_interface ERROR TeslaCloudEVapi:teslaEV_GetIdList: Trying to reconnect
2022-06-19 19:31:49,084 Thread-4 udi_interface DEBUG TeslaEVController:createNodes: vehicleList: None
2022-06-19 19:31:49,085 Thread-4 udi_interface ERROR TeslaEVController:createNodes: Exception Controller start: object of type 'NoneType' has no len()
2022-06-19 19:31:49,085 Thread-4 udi_interface INFO TeslaEVController:createNodes: Did not obtain data from EV
Posted

It looks like the token does not work correctly - it could be the API has locked you out (go to www.tesla.com and try to log in) - if that is ok try to generate another refresh token.  If not recreate your credentials 

You can also try to erase the REFRESH_TOKEN entry under config - both key and token and  then restart  node server - it should auto generate the entry again.   

I think I did change the code to handle a car with no name, but we are not even getting that far here.  

Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

    • There are no registered users currently online
  • Forum Statistics

    • Total Topics
      37.2k
    • Total Posts
      372.4k
×
×
  • Create New...