TMC is an independent, primarily volunteer organization that relies on ad revenue to cover its operating costs. Please consider whitelisting TMC on your ad blocker and becoming a Supporting Member. For more info: Support TMC
  1. TMC is currently READ ONLY.
    Click here for more info.

TeslaMate [megathread]

Discussion in 'The UK and Ireland' started by Roy W., Apr 20, 2020.

  1. Blokie

    Blokie Member

    Joined:
    Nov 7, 2020
    Messages:
    122
    Location:
    UK
    On the second set of data there where the car has "woken up", that is something that has been initiated by you for preconditioning by the looks of it, as the inside temperature is 22.5C whilst outside is 1.5C, so heater is definitely on :)
     
  2. init6

    init6 Member

    Joined:
    Oct 16, 2020
    Messages:
    199
    Location:
    Scotland
    The graphing is superb. Shout if you need a hand with any custom queries.
     
  3. Sklith

    Sklith Member

    Joined:
    Jul 23, 2019
    Messages:
    201
    Location:
    GA
    This is nice, thanks. One thing, the data range fields in the GET URLs aren't filling properly.
    "from=${__data.fields.date_from}&to=${__data.fields.date_to}"
     
  4. DaveW

    DaveW Active Member

    Joined:
    May 21, 2019
    Messages:
    1,130
    Location:
    Beds, UK
  5. Medved_77

    Medved_77 TM3 SR+ | MSM+Black | No FSD

    Joined:
    Jan 20, 2020
    Messages:
    1,776
    Location:
    Scotland
    Sorry, I didn't create this dashboard myself.

    Did it not display any data for you until you changed those attributes or was it displaying incorrect data?
     
  6. Sklith

    Sklith Member

    Joined:
    Jul 23, 2019
    Messages:
    201
    Location:
    GA
    It's just looking at my last drive when I click any date.
    The URL appears as this: https://<My vanity URL>/d/FkUpJpQZk/trip?orgId=1&from=${__data.fields.date_from}&to=${__data.fields.date_to}
     
  7. Medved_77

    Medved_77 TM3 SR+ | MSM+Black | No FSD

    Joined:
    Jan 20, 2020
    Messages:
    1,776
    Location:
    Scotland
    Thanks! I can see the issue now. I'd only been looking at the table as a whole, not clicking on the dates in the in the period column.

    If this did work I'm not sure what it should show though? The values in max power/duration/speed/distance are the max recorded for any drive in that month, so each could refer to a different drive. I guess the period shouldn't be a hyperlink and the 4 columns should link to the drive record in which the maximum was recorded or at least the period link could show all drives for that month.

    I'll see if I can work out what to change in the JSON.
     
  8. possum22

    possum22 Member

    Joined:
    Nov 16, 2016
    Messages:
    110
    Location:
    Mt. Isa, Qld
    I'm trying to Teslamate on Google, I keep getting this error.
    "E: Malformed entry 7 in list file /etc/apt/sources.list (Component)E: The list of sources could not be read.E: Malformed entry 7 in list file /etc/apt/sources.list (Component)E: The list of sources could not be read."

    I got it on a raspberryPi, needs rebooting every couple of weeks, unable to access.
     
  9. PR-UK

    PR-UK Member

    Joined:
    Jul 1, 2020
    Messages:
    60
    Location:
    Bedfordshire
    Has anyone noticed that in previous versions you used to be able to run your mouse along the graphs in Drive Details in Grafana and it would put a dot on the map as to where the selected event happened. That now seems to have stopped?
     
    • Like x 1
  10. mvrlogins

    mvrlogins New Member

    Joined:
    Oct 1, 2017
    Messages:
    3
    Location:
    London, UK
    • Informative x 2
  11. frankie666

    frankie666 New Member

    Joined:
    Feb 9, 2021
    Messages:
    4
    Location:
    Switzerland
    Hi, I am new in this group and I discovered Teslmate which looks awsome. I am trying to install it on my unraid server but as I am not a linux pro I don't know how to do it (I have only installed apps from the community app in docker, like plex, netxcloud...). As it seems that some members did install Teslamate with success, I wonder to know if someone would be kind enough to help me ? Thanks a lot for your help.
     
  12. 26ct2143

    26ct2143 Member

    Joined:
    Nov 22, 2020
    Messages:
    175
    Location:
    Burton-on-Trent, UK
    go to page 60 (back 1 page) someone has talked about already.

    Don't know whether you saw that?
     
  13. frankie666

    frankie666 New Member

    Joined:
    Feb 9, 2021
    Messages:
    4
    Location:
    Switzerland
    Oh, sorry I am confused, I did not see these posts... Thanks, I will ask @wayner directly...
     
  14. ParHunter

    ParHunter Member

    Joined:
    Nov 2, 2020
    Messages:
    89
    Location:
    Surrey, UK
    I’ve had it twice now that’s Teslamate tells me that the health check failed and during that period the car appeared to sleep while we actually went for a drive.

    Any idea what is causing this? Restarting the docker image works and it is online again after that. Btw I am running Teslamate on Google Cloud.
     
  15. 26ct2143

    26ct2143 Member

    Joined:
    Nov 22, 2020
    Messages:
    175
    Location:
    Burton-on-Trent, UK
    So if you look here:
    MQTT Integration | TeslaMate
    the docs say under the MQTT section, it's the health of the logger.
    not exactly sure whether that means the in car logger, or a logger on the Tesla api servers for this car, or maybe the teslamate logger.
     
  16. wayner

    wayner Active Member

    Joined:
    Oct 29, 2014
    Messages:
    3,804
    Location:
    Toronto
    #1216 wayner, Feb 20, 2021
    Last edited: Feb 20, 2021
    I got it working and it wasn't too bad but I probably did a lot more manual things than what would be required if I knew what I was doing. I mainly used the instructions in this thread on reddit: https://www.reddit.com/r/unRAID/comments/hdnb6j/teslamate_docker/. Note that these instructions were not 100% correct and I had to play around with a few things. For example, that thread seems to have the wrong info in some instances, like in the Teslamate docker it says to use a database user name of postres but you have to change that to teslamate.

    Here is the document that I started working on. I am not sure it is complete but it should be able to help you a lot:
    TeslaMate Docker on unRAID
    Instructions here https://www.reddit.com/r/unRAID/comments/hdnb6j/teslamate_docker/

    1. Install Grafana docker from apps – set IP address or your unRAID server in key 1 before creating and use secret as key 2

    2. Install postgres11 from apps with Postgres_password=secret, postgres_user=teslamate and postgres_db as teslmate

    3. Install teslamate. Add in Variables and keys – except use teslamate as user. To add in a Variable, ext click on +Add another Path, Port, Variable or Device. For example, click on this button, select Variable and then use name=DATABASE_NAME, key=DATABASE_NAME, value=teslamate and Description="Container Variable:". I can't remember exactly but I think you have to do this for DATABASE_USER, DATABASE_NAME, DATABASE_HOST and DATABASE_PASS. Add whatever other stuff is missing and use this snapshot as your guideline:

    [​IMG]

    Manually install dashboards by copying json files into Grafana. Click Manage, then Import. Go to Github/dashboards and click on a .json file. Click on Raw, copy all and paste back in Grafana. Click load, then import. Repeat for all dashboards (note - there is likely an automated way of doing this)

    SSH into your unraid server and start a bash prompt in the Grafana docker and Manually install Grafana plugins using :

    docker exec -it Grafana /bin/bash
    grafana-cli plugins install pr0ps-trackmap-panel 2.1.0
    grafana-cli plugins install natel-discrete-panel 0.1.0
    grafana-cli plugins install grafana-piechart-panel 1.6.1
    grafana-cli --pluginUrl https://github.com/panodata/grafana-map-panel/releases/download/0.14.0/grafana-map-panel-0.14.0.zip plugins install grafana-worldmap-panel-ng

    Sorry if those instructions are not clear - it was a bit of trial and error for me, but it didn't take too long to get up and running.

    It is worth it as Teslamate is awesome, even though I rarely drive these days due to Covid lockdown so I don't have much data in the system. Let us know if it works, and maybe update my instructions so that it is easier for the next person, and/or you and I if we have to reinstall in the future.

    edit - I now do have Teslamate working. You need to set MQTT_HOST in the Teslamate docker to the IP address of your MQTT broker. I am not sure how to set the MQTT port but that isn't an issue for me, at least not so far.
     
  17. wayner

    wayner Active Member

    Joined:
    Oct 29, 2014
    Messages:
    3,804
    Location:
    Toronto
    I need help with configuring mosquito with Teslamate. I manually installed Teslamate, including postgres and grafana in dockers on my unRAID server last week. The dashboards are working fine.I have had a MQTT docker running for years (although I don't really use it, but it could be useful for some things, like interfacing with my HA system).

    In my container logs it says "2021-02-20 11:24:17.821 [warn] MQTT publishing failed: :timeout"

    In my Teslamate docker settings I have MQTT_HOST set to MQTT. My MQTT docker is called "MQTT". My MQTT docker uses port 1883 and port 9001. What else do I need to configure to allow Teslamate to publish to MQTT?
     
  18. 26ct2143

    26ct2143 Member

    Joined:
    Nov 22, 2020
    Messages:
    175
    Location:
    Burton-on-Trent, UK
    My MQTT server is on a different machine, I just set the IP and the port in the docker file and it worked.
     
  19. wayner

    wayner Active Member

    Joined:
    Oct 29, 2014
    Messages:
    3,804
    Location:
    Toronto
    #1219 wayner, Feb 20, 2021
    Last edited: Feb 20, 2021
    My setting is currently wrong as I imagine that MQTT_HOST should be the IP address of my MQTT server and not "MQTT".

    I changed the MQTT_HOST to the correct IP and it appears that this is working. In the MQTT docker logs I see it has received info from Teslamate. But I still wonder how it knows what port to use, unless the MQTT port is hard coded to a constant port.

    edit - Removed stuff about MQTT port. In the docs for Teslamate I found that there is an env variable for MQTT_PORT but that this is optional. I don't need it as my MQTT broker is using the default entry of 1883 and I guess that is what Teslamate uses unless you specify something else.
     
  20. frankie666

    frankie666 New Member

    Joined:
    Feb 9, 2021
    Messages:
    4
    Location:
    Switzerland
    Here is the document that I started working on. I am not sure it is complete but it should be able to help you a lot:
    TeslaMate Docker on unRAID
    Instructions here https://www.reddit.com/r/unRAID/comments/hdnb6j/teslamate_docker/

    1. Install Grafana docker from apps – set IP address or your unRAID server in key 1 before creating and use secret as key 2

    2. Install postgres11 from apps with Postgres_password=secret, postgres_user=teslamate and postgres_db as teslmate

    3. Install teslamate. Add in Variables and keys – except use teslamate as user. To add in a Variable, ext click on +Add another Path, Port, Variable or Device. For example, click on this button, select Variable and then use name=DATABASE_NAME, key=DATABASE_NAME, value=teslamate and Description="Container Variable:". I can't remember exactly but I think you have to do this for DATABASE_USER, DATABASE_NAME, DATABASE_HOST and DATABASE_PASS. Add whatever other stuff is missing and use this snapshot as your guideline:
    [/QUOTE]

    Hi and thanks for your help. I have installed Grafana, Postgress1 and Teslamate but when I start Teslamate I Have errors in the log of Postgress...

    PostgreSQL Database directory appears to contain a database; Skipping initialization
    2021-02-21 16:01:15.708 CET [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
    2021-02-21 16:01:15.708 CET [1] LOG: listening on IPv6 address "::", port 5432
    2021-02-21 16:01:15.713 CET [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
    2021-02-21 16:01:15.723 CET [24] LOG: database system was shut down at 2021-02-21 16:01:14 CET
    2021-02-21 16:01:15.728 CET [1] LOG: database system is ready to accept connections
    2021-02-21 16:01:37.096 CET [31] LOG: incomplete startup packet
    2021-02-21 16:01:37.503 CET [32] FATAL: password authentication failed for user "teslamate"
    2021-02-21 16:01:37.503 CET [32] DETAIL: Role "teslamate" does not exist.
    Connection matched pg_hba.conf line 95: "host all all all md5"
    2021-02-21 16:01:37.503 CET [33] FATAL: password authentication failed for user "teslamate"
    2021-02-21 16:01:37.503 CET [33] DETAIL: Role "teslamate" does not exist.
    Connection matched pg_hba.conf line 95: "host all all all md5"
    2021-02-21 16:01:39.408 CET [34] FATAL: password authentication failed for user "teslamate"
    2021-02-21 16:01:39.408 CET [34] DETAIL: Role "teslamate" does not exist.
    Connection matched pg_hba.conf line 95: "host all all all md5"
    2021-02-21 16:01:40.359 CET [35] FATAL: password authentication failed for user "teslamate"
    2021-02-21 16:01:40.359 CET [35] DETAIL: Role "teslamate" does not exist.
    Connection matched pg_hba.conf line 95: "host all all all md5"

    and in the Teslamate logs...


    2021-02-21 15:59:24.228 [error] Postgrex.Protocol (#PID<0.167.0>) failed to connect: ** (Postgrex.Error) FATAL 28P01 (invalid_password) password authentication failed for user "teslamate"
    2021-02-21 15:59:24.228 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 28P01 (invalid_password) password authentication failed for user "teslamate"
    2021-02-21 15:59:25.803 [error] Postgrex.Protocol (#PID<0.167.0>) failed to connect: ** (Postgrex.Error) FATAL 28P01 (invalid_password) password authentication failed for user "teslamate"
    2021-02-21 15:59:26.520 [error] Postgrex.Protocol (#PID<0.166.0>) failed to connect: ** (Postgrex.Error) FATAL 28P01 (invalid_password) password authentication failed for user "teslamate"
    2021-02-21 15:59:27.249 [error] Could not create schema migrations table. This error usually happens due to the following:

    * The database does not exist
    * The "schema_migrations" table, which Ecto uses for managing
    migrations, was defined by another library
    * There is a deadlock while migrating (such as using concurrent
    indexes with a migration_lock)

    To fix the first issue, run "mix ecto.create".

    To address the second, you can run "mix ecto.drop" followed by
    "mix ecto.create". Alternatively you may configure Ecto to use
    another table and/or repository for managing migrations:


    config :teslamate, TeslaMate.Repo,
    migration_source: "some_other_table_for_schema_migrations",
    migration_repo: AnotherRepoForSchemaMigrations

    The full error report is shown below.

    ** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2983ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:

    1. Tracking down slow queries and making sure they are running fast enough
    2. Increasing the pool_size (albeit it increases resource consumption)
    3. Allowing requests to wait longer by increasing :queue_target and :queue_interval

    See DBConnection.start_link/2 for more information

    (ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:751: Ecto.Adapters.SQL.raise_sql_call_error/1
    (elixir 1.11.3) lib/enum.ex:1411: Enum."-map/2-lists^map/1-0-"/2
    (ecto_sql 3.5.4) lib/ecto/adapters/sql.ex:838: Ecto.Adapters.SQL.execute_ddl/4
    (ecto_sql 3.5.4) lib/ecto/migrator.ex:669: Ecto.Migrator.verbose_schema_migration/3
    (ecto_sql 3.5.4) lib/ecto/migrator.ex:498: Ecto.Migrator.lock_for_migrations/4
    (ecto_sql 3.5.4) lib/ecto/migrator.ex:413: Ecto.Migrator.run/4
    (ecto_sql 3.5.4) lib/ecto/migrator.ex:145: Ecto.Migrator.with_repo/3
    (teslamate 1.21.5) lib/teslamate/release.ex:9: anonymous fn/2 in TeslaMate.Release.migrate/0

    I am sure to have same password and user in both apps. It seems that there is no database...
    Did you get the same error ? I don't understand what is the fix proposed (in red)?
    Thanks again for your help.
     

Share This Page

  • About Us

    Formed in 2006, Tesla Motors Club (TMC) was the first independent online Tesla community. Today it remains the largest and most dynamic community of Tesla enthusiasts. Learn more.
  • Do you value your experience at TMC? Consider becoming a Supporting Member of Tesla Motors Club. As a thank you for your contribution, you'll get nearly no ads in the Community and Groups sections. Additional perks are available depending on the level of contribution. Please visit the Account Upgrades page for more details.


    SUPPORT TMC