Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Search results

  1. dirkvm

    Model S REST API

    Correct, use only the token returned by the oauth/token endpoint and not base64 encoded. Dirk
  2. dirkvm

    Model S REST API

    https://github.com/timdorr/tesla-api/issues/97#issuecomment-549613978 does the trick for me, at least for now :) msg_type: "data:subscribe_oauth", token: options.authToken, ...
  3. dirkvm

    Model S REST API

    Model S here. No idea why it behaves differently on your model 3 :(
  4. dirkvm

    Model S REST API

    I'm getting `data:error vehicle_disconnected` when the car state is not `online`. Is your model 3 `asleep` when you open the websocket?
  5. dirkvm

    Model S REST API

    As far as I can tell, you only need the token and vehicle_id to authenticate a new websocket connection. Streaming remains active until the connection is closed due to an error or because it's closed by the client app.
  6. dirkvm

    Model S REST API

    Note that logging of the messages to the console is disabled. Remove the // from line 290 in your copy of dirkvm/teslams if you want the messages listed. Otherwise use "examples/streamws.js -z --file" to list them to the file "streaming.out".
  7. dirkvm

    Model S REST API

    This is what I get with this websocket test, copy to examples/streamws.js simple test (id's and location data removed or edited, only vehicle_id and tokens[0] are used) { ... vehicle_id: NNNNNNNNN, tokens: [ 'XXXXXXXXXXXXXX', 'YYYYYYYYYYY' ], state: 'asleep', in_service: false...
  8. dirkvm

    Model S REST API

    I've added a webocket based version of streaming.js, dirkvm/teslams
  9. dirkvm

    Model S REST API

    Are you using sleep/nap checking? If not, or you don't mind turning that off, then I can adapt the original streaming.js to use the websocket streaming.
  10. dirkvm

    Model S REST API

    The problem is that I removed all "nap" code from streaming.js because I synchronize my local state with TeslaFi. If TeslaFi says the car is sleeping or is trying to sleep, then I close the websocket and stop asking for new tokens. To me, TeslaFi is perfect as an archive solution but I wanted...
  11. dirkvm

    Model S REST API

    Streaming API Broken after Model 3 updated to 2018.18.3 04dfd3c · Issue #68 · timdorr/tesla-api suggests that there's also a websocket based streaming api. I experimented a bit with this and it seems to work much better than the long-polling api (using a european MS75D 2019.5.14 53ca475). See...