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

TeslaMate [megathread]

This site may earn commission on affiliate links.
@DaveW

Are you working on a bulk import for Superchargers in the USA?

@MMcKay

Here you go, USA Superchargers to import :)

dropbox.com/sh/1huca8nqvtlj6rh/AACZFQ4FafI3tNC0-CVU1BAMa?dl=0(opens in a new tab)

PLEASE sanity check that these look to be genuine Tesla supercharger locations before importing, they should be, but hard for me to know (data all comes from openchargemap.io so should be good)

You might have to break these down into batches, as there are a lot to import!
 
@DaveW

The USA supercharger has false in all of the KW fields so the script will error out.

INSERT INTO public.geofences (name, latitude, longitude, radius, inserted_at, updated_at, cost_per_kwh, session_fee) VALUES ('Great Barrington, Ma Supercharger', 42.180949, -73.364744, 35, '2020-09-27 05:28:00 ', '2020-09-27 05:28:00 ', FALSE, NULL);
 
  • Like
Reactions: Roy W.
@DaveW

The USA supercharger has false in all of the KW fields so the script will error out.

INSERT INTO public.geofences (name, latitude, longitude, radius, inserted_at, updated_at, cost_per_kwh, session_fee) VALUES ('Great Barrington, Ma Supercharger', 42.180949, -73.364744, 35, '2020-09-27 05:28:00 ', '2020-09-27 05:28:00 ', FALSE, NULL);

Fixed this and re-uploaded the file, but with a workaround for now of a default value of 0.24, turns out the USA supercharger costs are a bit more variable than over here, I'll work on that now by trying to read in characters 2,3,4 and 5 from the field with costs in as there is also text in there.

@DaveW

Looks great to me, also I was looking at the open charge map and wondering how you get the data and then format it into excel I assume and then use formulas to create the script.

Are you using this call?

https://api.openchargemap.io/v3/poi/?output=json&countrycode=US&maxresults=9999999&compact=False&verbose=false&key=XXXXXXXX&connectiontypeid=27

Was wondering your process so I can then pull destination chargers and also pull in the future without having to ask.

Thanks Again,
Mike

To do it, I'm using an ImportJSON script for Google Sheets, I pull down the specific URL, do some data fixing on some of the tables to make them compatible then concatenate the string at the end to get the output.

Sometimes differs per country / locale though, so with the USA one, you have different prices per location / car type (from reading the comments) and also there were a lot more fields to import.

For USA Superchargers, I used this URL (but replacing my unique ID with mmckay so you can use it):
https://api.openchargemap.io/v3/poi...s=3000&operatorid=23&levelid=3&countrycode=US

For destination chargers, I replace the levelid with 2 :)
 
So I managed to get TM working no problems thanks to @DaveW guide - Really great thanks.

Wanted to go on to make some tweaks however it keeps rejecting my password, 99% sure its right. I did initially have problems with the username i've tried,

SSH:
pi
[email protected]
[email protected] (got from router no problem)

All new to me, I guess I will end up with a fresh install, unless anyone has any advice? Is it case sensitive ?
On Linux, *everything* is case-sensitive: username, password, file and directory names, the commands you type from the command line, the flags you add to some commands... all case-sensitive.
 
  • Informative
Reactions: Godsense
Fixed this and re-uploaded the file, but with a workaround for now of a default value of 0.24, turns out the USA supercharger costs are a bit more variable than over here, I'll work on that now by trying to read in characters 2,3,4 and 5 from the field with costs in as there is also text in there.



To do it, I'm using an ImportJSON script for Google Sheets, I pull down the specific URL, do some data fixing on some of the tables to make them compatible then concatenate the string at the end to get the output.

Sometimes differs per country / locale though, so with the USA one, you have different prices per location / car type (from reading the comments) and also there were a lot more fields to import.

For USA Superchargers, I used this URL (but replacing my unique ID with mmckay so you can use it):
https://api.openchargemap.io/v3/poi...s=3000&operatorid=23&levelid=3&countrycode=US

For destination chargers, I replace the levelid with 2 :)

Hey Dave,

Most of the lines are missing the radius entry.
 
Last edited:
I've had a shocker here, haven't I! - In my defence, I was a little hung over this morning :)

I've no idea how that issue happened, somehow the contact was totally different to the working ones. Sorted now and re-uploaded, 3 times the charm I hope

Thanks Dave,

I updated the formatting on the script since there are a lot of US supercharger names that have apostrophes in them... so nice to use a postgres SQL editor like Postico so you can quickly see any scripting issues. Attached is the updated script.
 

Attachments

  • USA Superchargers-Updated Formatting.txt
    225.3 KB · Views: 53
  • Like
Reactions: Utahken and DaveW
I upgraded to v1.20.0 and then tried to import the UK Superchargers today but was hitting an error due to the change to cost_per_kwh table you mentioned DaveW.

I've attached the updated file I used to import successfully.

Thanks for putting together the list, very helpful.
 

Attachments

  • UK Supercharger Location - for v1.20.0.txt
    16.4 KB · Views: 39
  • Like
Reactions: DaveW