snicker / zwift_hass

Zwift Sensor Integration for HomeAssistant
52 stars 13 forks source link

What is my_zwift_username ? #33

Closed sebascha closed 3 months ago

sebascha commented 2 years ago

Hy, this maybe a stupid question, but what exactly is my username to put into the config file? Is it the Zwift ID, or is it my login mail adress or sth completely different?

tylerwmarrs commented 1 year ago

Sorry for the late response on this, but the core developer(s) hasn't responded yet. Your username is your email address. As an aside, if you want your power metrics, you must use your credentials as they are not public. I first created an "api" account using the gmail + trick and noticed this.

So my config looks something like this:

secrets.yaml file:

# zwift id tyler
zwift_tyler_user_id: XXXXXX

# dummy zwift API account
zwift_user: email+ha@gmail.com
zwift_password: redacted

You get your ID by going to:

C:/Users/USERNAME/Documents/Zwift/cp

There you will see a folder with "userXXXXXX". The number should be your id. If you have multiple users, you'll have to figure out what the corresponding ID is.

configuration.yaml file:

sensor: !include sensors.yaml

sensors.yaml file:

- platform: zwift
  username: !secret zwift_user
  password: !secret zwift_password
  players:
    - !secret zwift_tyler_user_id

Once your configuration is set, you'll most likely have to restart home assistant - I did.