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

Tesla Winds and Elevation Web Browser App

This site may earn commission on affiliate links.
Naturally, my calendar is not syncing this morning.... so I again painstakingly keyed it in manually.... and success! Now working on my Model 3. Thanks for the great product SomeJoe, and for all the other helpful comments.

Now we need to swap the image from the Model S. :)
 
I've been a fan of mochouinard's Tesla Headwind Estimator for a long time. However, a problem is that the app relies on another web site to obtain the wind data, and that web site (and all others like it) will charge you if you obtain weather information from them too often. mochouinard ran into this problem (because his app is quite popular) and had to disable it.

I've come up with a replacement web app to estimate winds (and elevation) for the Tesla while driving, and I'm using a method that can get around this limitation. Each person who wants to use the app can obtain their own API keys from OpenWeatherMap.org (for winds) and Geonames.org (for elevation). That way, no one API key will run into the limitations and the app can be free.

I believe the app is ready for use, and it is now live at http://teslawinds.com. When you first browse to the app, it will ask you to type in the two API keys you can register for and obtain for free from OpenWeatherMap.org and Geonames.org. I recommend you obtain the API keys on a desktop or laptop browser rather than in the car.

Once you have obtained the API keys (the Geonames site calls it the "username" or "handle"), bring up the web site in the car, type in the API keys, click the Verify button and the app will verify that both API keys work properly. If they do, you'll be redirected to the app, if not you can correct your keys and hit Verify again.

Once you are redirected to the app, bookmark it to save the API keys, that way you will not have to enter them again.

The main app looks like this:

TWE-screenshot.png



Center Pane (Course): Your course is shown at the top of the rotating compass both in degrees (0-360), and a 16-compass-point direction. Your ground speed (computed by GPS) is at the bottom. The air speed is the ground speed with the headwind or tailwind added in. This is the equivalent speed at which the car will use energy. Tailwinds reduce the air speed, headwinds increase it. The blue arrow in the compass is the wind direction for your area. The compass and wind arrow will rotate as you drive. The cars position, and therefore the course, compass, and speeds are updated every 30 seconds.

Left Pane (Winds): The direction that the local winds are coming from and their speed is shown at the top in blue. This direction is shown on the compass in the center pane as well by the blue arrow. The weather station that reported the winds is also shown above the wind direction and speed. The components of the wind (crosswind and head/tail wind) are shown surrounding your car. Crosswinds appear with a yellow arrow, headwinds appear with an orange arrow (they cause increased energy usage), and tailwinds appear with a green arrow (they reduce energy usage). The crosswind and head/tailwind speeds are also shown. The arrows size themselves dynamically, so stronger winds will appear with larger arrows. Winds under 1 MPH are not shown. Also at the bottom of this pane are the position, wind, and elevation update timers. WInds are updated every 5 minutes.

Right Pane (Elevation): The current elevation based on your location is shown at the top in feet, and is updated every 1 minute. The graphic in the middle will show your Model S on an incline if there is a measurable grade that you are driving on. If the model S is climbing, the grade is shown in orange (climbing increases energy use), if the model S is descending, the grade is shown in green (descents decrease energy use). Your ground speed must average at least 30 MPH over a 1 minute interval for the app to compute the grade and elevation change rate. This is to ensure that noise and minor errors in the elevation mapping database are smoothed out. Note that the incline that your model S is shown on is exaggerated for visibility. At the bottom of this pane is the current version of the app, which as of this writing is 1.0.0.197.


Current Limitations:

- I've made considerable effort to reduce the required CPU power for this app, but as we all know, sometimes the Tesla browser is just slow. I haven't had any real trouble but please let me know if you do.
- Right now, the app displays imperial units only. I will work on allowing the switch to SI units in a future version.
- Elevation is from a mapping database, thus it represents the ground level. Elevation is not altitude, and will not take into account bridges, overpasses, or tunnels.
- All computations other than course and speed rely on the API calls, which require Internet connectivity. If you are driving in an area where you do not have a data connection, errors will appear in the app that say "No wind/elevation data obtained". These errors will clear when Internet connectivity returns.


I hope this app helps you on any driving trips where winds and elevation can be a consideration for energy use. I appreciate any feedback you have.




Thanks! It works pretty well, except it gets the direction wrong sometimes. Perhaps you have to keep going in the same direction for a pretty long time to lock in. Some screenshots from my Model S: first pic is going almost due west, yet it says east, then when I turned around it settle down and seemed to get it right, including when I got home.
 

Attachments

  • 00388567-A4A3-4D39-9476-35F84838A7EF.jpeg
    00388567-A4A3-4D39-9476-35F84838A7EF.jpeg
    408.1 KB · Views: 83
  • 501B8C91-C839-444A-BC95-B398A4512545.jpeg
    501B8C91-C839-444A-BC95-B398A4512545.jpeg
    293.4 KB · Views: 134
  • D4B68FE5-BDC1-41CB-88C2-F686C41A32C8.jpeg
    D4B68FE5-BDC1-41CB-88C2-F686C41A32C8.jpeg
    361.4 KB · Views: 73
Awesome, thanks. The 1158x710 inner screen size is what I needed to see. This is the available pixel dimensions that the content needs to fit in. However, I'd like to get one more test to confirm this size to make sure. Try:

resizeMyBrowser

And you are on version 9, correct?
Hi all

Great work, congratulations !
Could install it in 10 min following your first page instructions

I have v9 (v42.3) on my model S dec 2017
Same slightly reduced screen so will be glad one day to have a slightly reduced size screen for your App, as suggested above (same numbers)

Great work, thank you
 
I have v9 (v42.3) on my model S dec 2017
Same slightly reduced screen so will be glad one day to have a slightly reduced size screen for your App, as suggested above (same numbers)

Awesome, thanks. Under software version 9 on the Model 3, we just got the 42.x versions that appear to make the browser more stable and usable, so I might be able to start debugging now.
 
Hi Superendo, I will be working on it as soon as I can.

In the meantime, please add the following to the end of your URL in the browser:

Code:
&units=2

Then re-bookmark the page. This will get you metric readings until I can fix the settings page.

Thnx for your reply. I added the string to the url. Did not work for me or I didn’t do it correctly. I will try again soon.
 
This is not actually true. However the real answer has too many variables for a useful 2D graph. Ideally the car would be calculating the optimal speed for you in real time.

I think what is really being asked is how much wind and grade impacts range. The
best speed to drive to maxamize range
as EVnut points out the slower the more efficient. But no one is going to drive 20 mph just to be the most efficient. However, we want the most accurate range calculation so we can better plan recharge stops. In this case these two variables (wind and grade) could be used in a more precise range calculation especially during navigation.
 
Thnx for your reply. I added the string to the url. Did not work for me or I didn’t do it correctly. I will try again soon.

The final URL should look like this:

Code:
https://teslawinds.com/?owmAPIK=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&gnUN=xxxxxxxxxxxx&units=2

Obviously, the xxx's should be replaced with your particular OpenWeatherMap API key, and Geonames username, respectively.
 
This is not actually true. However the real answer has too many variables for a useful 2D graph. Ideally the car would be calculating the optimal speed for you in real time.
This has been an obsession of mine for years. It seems like it would be so obvious, just track the MPG and the MPH with an OBD2 reader and there should be a best speed you can derive for any car.

Tesla probably does know the best rate as we can see in the Energy Consumption app. It's a shame they don't add the smarts this site gives the car. When I open the browser it covers the map, would be great if wind and elevation could just be displayed on the map.

-Randy
 
Last edited: