Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tesla OAuth Error #111

Closed
S3b4st1an-git opened this issue May 7, 2020 · 4 comments · Fixed by #113
Closed

Tesla OAuth Error #111

S3b4st1an-git opened this issue May 7, 2020 · 4 comments · Fixed by #113
Labels
bug Something isn't working

Comments

@S3b4st1an-git
Copy link

Trying to setup evcc in a docker container on a synology 918+ for Tesla Model3, Wallbe eco2s and Solaredge PV (installation due), data going through mqtt/Home Assistant.

Pasted the client key and id from pastebin link in wiki but still getting
"https://owner-api.teslamotors.com/oauth/token": x509: certificate signed by unknown authority"

Didi anyone get a connection to the tesla mothership?

@andig
Copy link
Member

andig commented May 8, 2020

Moin @S3b4st1an-git das Tesla API erfordert zusätzlich noch Email und Passwort, siehe https://github.com/andig/evcc/blob/master/evcc.dist.yaml#L168. Wenn das nicht hilft würde es sich lohnen bei der verwendeten Library anzufragen: https://github.com/jsgoecke/tesla.

Danke dass Du EVCC ausprobierst!

@andig andig added the bug Something isn't working label May 8, 2020
@S3b4st1an-git
Copy link
Author

S3b4st1an-git commented May 8, 2020 via email

@andig
Copy link
Member

andig commented May 8, 2020

Hier ist der Code- an welcher Stelle steigst Du aus- ist das eine der "cannot create Tesla Meldungen"?:

cc := struct {
	Title                  string
	Capacity               int64
	ClientID, ClientSecret string
	Email, Password        string
	VIN                    string
	Cache                  time.Duration
}{}
util.DecodeOther(log, other, &cc)

client, err := tesla.NewClient(&tesla.Auth{
	ClientID:     cc.ClientID,
	ClientSecret: cc.ClientSecret,
	Email:        cc.Email,
	Password:     cc.Password,
})
if err != nil {
	log.FATAL.Fatalf("cannot create tesla: %v", err)
}

vehicles, err := client.Vehicles()
if err != nil {
	log.FATAL.Fatalf("cannot create tesla: %v", err)
}

v := &Tesla{
	embed: &embed{cc.Title, cc.Capacity},
}

for _, vehicle := range vehicles {
	if vehicle.Vin == cc.VIN {
		v.vehicle = vehicle.Vehicle
	}
}

if v.vehicle == nil {
	log.FATAL.Fatal("cannot create tesla: vin not found")
}

@andig
Copy link
Member

andig commented May 8, 2020

Du kannst auch direkt nur das Car API testen:

evcc -c config.yaml vehicle

Falls Du Hilfe beim Testen brauchst schick mir gerne PM (cpuidle@gmx.de).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants