TMC is an independent, primarily volunteer organization that relies on ad revenue to cover its operating costs. Please consider whitelisting TMC on your ad blocker or making a Paypal contribution here: paypal.me/SupportTMC

How does the API report speed when parked?

Discussion in 'Model S: User Interface' started by green1, Jan 3, 2016.

  1. green1

    green1 Active Member

    Joined:
    Mar 25, 2014
    Messages:
    4,111
    Location:
    Calgary, Alberta, Canada
    A question for anyone who has used visibletesla, or other API tools while the Tesla has been on a ferry, train, truck, etc.

    Is the speed reported by the API from the wheel sensors? or the GPS?

    I'm thinking of putting together a quick script in Octoblu to warn me if my car has been towed, I can look for changes to the GPS location, but it involves math with GPS coordinates, and GPS can jump around a bit on it's own anyway, seems it might be easier to check for speed, and basically have it notify me any time the car reports a speed while in park. Obviously this will only work if the speed is from GPS, not wheel sensors, and will give false positives on a ferry, but I think it would still be a useful little thing.

    So, does anyone know how the car behaves in situations where it's moving, but in park?
     
  2. FlasherZ

    FlasherZ Sig Model S + Sig Model X + Model 3 Resv

    Joined:
    Jun 21, 2012
    Messages:
    7,019
    It's based on wheel speed, from what I can tell. I have no records in my database with gear selector in "P" and speeds in excess of 3 mph. I believe those records >0 mph are where I put the car in park while rolling. I'm sure I would have caught some records from the valet service traveling > 3 mph.

    However, the streaming API does report GPS locations - so in theory you should be able to detect location changes by comparing long/lat movement while in P. You could set a mathematical threshold to trigger only with a significant shift, that would dampen the GPS jumping.
     
  3. green1

    green1 Active Member

    Joined:
    Mar 25, 2014
    Messages:
    4,111
    Location:
    Calgary, Alberta, Canada
    Yeah, that was plan B, I'm sure I can do it, it's just a lot more work than checking the speed, (speed is simple, pick a threshold number, say 5-10km/hr, and notify if it exceeds that in park, coordinates involve more arithmetic, of course I may have to do that anyway for a different notification I was thinking of where it would alert any time the car unlocks and I am more than a set distance from the car)
     
  4. FlasherZ

    FlasherZ Sig Model S + Sig Model X + Model 3 Resv

    Joined:
    Jun 21, 2012
    Messages:
    7,019
    I was thinking something very simple, like a latitude or longitude change greater than a certain amount (say .0001, which is about 70 feet or so I think). Even if the truck is driving NW or SE, it'll still trigger. The biggest complexity compared to speed is that you have to compare values from multiple records, versus just looking at the speed in a single record.
     
  5. green1

    green1 Active Member

    Joined:
    Mar 25, 2014
    Messages:
    4,111
    Location:
    Calgary, Alberta, Canada
    It's certainly do-able, just not as easy, it's not just about measuring the change in 2 variables, it's about measuring the starting location, with speed it's simple, non-zero while in park is bad. with lat-long you have to figure out where it was that you parked, and then figure out what the correct margin for error is (GPS can jump around a fair bit, especially if parked somewhere like an underground parkade)

    Not sayin' I won't do it, just that I have to do more work this way :)
     
  6. brucet999

    brucet999 Active Member

    Joined:
    Mar 12, 2015
    Messages:
    1,302
    Location:
    Huntington Beach, CA
    Wouldn't it be easier just to avoid parking in tow-away zones and to keep car payments current? :)
     
  7. green1

    green1 Active Member

    Joined:
    Mar 25, 2014
    Messages:
    4,111
    Location:
    Calgary, Alberta, Canada
    I do, and I have in fact never been towed. The purpose to this exercise is 2 fold:
    1) This is me learning, I'm playing with Octoblu, and the Tesla API, and other things to expand my knowledge of how various systems work. I don't "need" to do any of this, but it's a neat project to practice on.
    2) With a car like this, the easiest way to steal it is with a tow-truck, and while I don't anticipate it as likely, it's more likely than any other theft vector. finding out when it happens is a whole lot better than finding out hours later, and heck, it's free to build the method of tracking it!
     
  8. brucet999

    brucet999 Active Member

    Joined:
    Mar 12, 2015
    Messages:
    1,302
    Location:
    Huntington Beach, CA
    I was just joking, of course.

    Don't you already have a way to track the car's movements using the Tesla App? Granted, it won't notify you at the moment of theft, but if the car is gone you will know exactly where it is.

    I wonder, though, how unlikely theft of a Model S must be. Since mechanical repairs are only possible at Tesla service centers and body repairs only at Tesla certified body shops, I would imagine that there would not be a ready market for chop shop thieves. Similarly, I would expect the market for intact cars to be nil, since the car is readily traceable by Tesla and by the owner using the Tesla App and can be shut down remotely by Tesla. Thieves with the wherewithal to flatbed tow the car would have no real expectation of profit, especially not outside North America (where lots of expensive ICE vehicles go) because the charge port would be useless.
     
  9. green1

    green1 Active Member

    Joined:
    Mar 25, 2014
    Messages:
    4,111
    Location:
    Calgary, Alberta, Canada
    See point 1 "I don't 'need' to do any of this, but it's a neat project to practice on" and point 2 "finding out when it happens is a whole lot better than finding out hours later"

    It could be argued that Tesla's refusal to sell many parts drastically increases their value through supply and demand. There'd be a high risk of getting caught, but that's no different than chopping any other type of car, but the parts are worth a LOT, a battery pack alone has a market value of about $20,000, other parts that people need to fix cars where Tesla refuses to sell them the parts could also be worth a lot. Tesla is likely creating the demand themselves. It's like the "war on drugs" it doesn't prevent people doing drugs, it only increases the criminal involvement in the whole process.
     

Share This Page