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

How does the API report speed when parked?

This site may earn commission on affiliate links.
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?
 
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.
 
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.
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)
 
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)

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.
 
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.
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 :)
 
Wouldn't it be easier just to avoid parking in tow-away zones and to keep car payments current? :)
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!
 
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!

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.
 
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.
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"

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.
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.