Page 11 of 15
Re: Tesla hardware module
Posted: Friday 05 February 2021 12:34
by MrHobbes74
dyter wrote:MrHobbes74 wrote: ↑Thursday 04 February 2021 23:51
All, I have added the option to specify a API key (a.k.a. access token) in the tesla configuration.
This allows you to use another app to generate the API key / access token
(e.g. via
https://registration.teslatasks.com/generateTokens, or download a python script like
https://github.com/enode-engineering/te ... n/tesla.py which worked for me)
A token usually works for about a month.
That will give me some time to consider a solution, and meanwhile the tesla module can be used again.
The pull request into domoticz is active, hopefully integration is tomorrow.
Good job !
I have a Jahadl compiled and there are no new version for my synology, I copy the new hardware folder and I show the new tesla plugin but not work again, I show Error: TeslaApi: Received token is zero length. Is there another folder to copy ?
Do you see the manual API key entry in the Tesla hardware configuration?
Sent from my iPhone using Tapatalk
Re: Tesla hardware module
Posted: Friday 05 February 2021 12:42
by waaren
dyter wrote: ↑Friday 05 February 2021 11:41
I have a Jahadl compiled and there are no new version for my synology, I copy the new hardware folder and I show the new tesla plugin but not work again, I show Error: TeslaApi: Received token is zero length. Is there another folder to copy ?
You need the latest build (12917) for the fixed Tesla hardware module and there is no way you can workaround that with an earlier build. Now that @Jadahl stopped building new Synology packages you will have to wait until someone else will take over that role.
Other options are to move to another platform or to docker on Synology for your domoticz system.
Re: Tesla hardware module
Posted: Friday 05 February 2021 12:57
by dyter
MrHobbes74 wrote: ↑Friday 05 February 2021 12:34
Do you see the manual API key entry in the Tesla hardware configuration?
Sent from my iPhone using Tapatalk
Yes I show the new API case but I think a file is missing somewhere. I try with a docker version for test
Re: Tesla hardware module
Posted: Friday 05 February 2021 13:10
by MrHobbes74
dyter wrote:MrHobbes74 wrote: ↑Friday 05 February 2021 12:34
Do you see the manual API key entry in the Tesla hardware configuration?
Sent from my iPhone using Tapatalk
Yes I show the new API case but I think a file is missing somewhere. I try with a docker version for test
File missing? You need to fill in the API key yourself. There is no other file
Sent from my iPhone using Tapatalk
Re: Tesla hardware module
Posted: Friday 05 February 2021 13:31
by dyter
MrHobbes74 wrote: ↑Friday 05 February 2021 13:10
Yes I show the new API case but I think a file is missing somewhere. I try with a docker version for test
File missing? You need to fill in the API key yourself. There is no other file
Sent from my iPhone using Tapatalk
[/quote]
I move hardware folder binaries with winSCP to my synology folder !
Tesla hardware module
Posted: Friday 05 February 2021 13:40
by MrHobbes74
dyter wrote:MrHobbes74 wrote: ↑Friday 05 February 2021 13:10
Yes I show the new API case but I think a file is missing somewhere. I try with a docker version for test
File missing? You need to fill in the API key yourself. There is no other file
Sent from my iPhone using Tapatalk
I move hardware folder binaries with winSCP to my synology folder ![/quote]
You also need the new Domoticz executable else it won’t work.
Sent from my iPhone using Tapatalk
Re: Tesla hardware module
Posted: Friday 05 February 2021 13:54
by dyter
Ok thanks MrHobbes
It's work in docker, so I make a bridge from my two domoticz
Re: Tesla hardware module
Posted: Friday 05 February 2021 18:38
by hamster
MrHobbes74 wrote: ↑Friday 05 February 2021 8:57
It’s integrated! If you download the latest beta, you can fill in a manual API key (access token).
working here on beta 12917, thanks!
Re: Tesla hardware module
Posted: Saturday 06 February 2021 13:23
by JPSke
@ MrHobbes74: is there any chance to incorporate the API key box in the release version of domoticz? I have updated to the beta version get a key from Tesla and now the Tesla plugin is OK, but some other functions are not working anymore. Or sometimes the browser displays an empty screen and must be shut down and restarted to get it working again. Thanks in advance!
Re: Tesla hardware module
Posted: Monday 08 February 2021 18:34
by dyter
MrHobbes74 wrote: ↑Friday 05 February 2021 12:34
All, I have added the option to specify a API key (a.k.a. access token) in the tesla configuration.
This allows you to use another app to generate the API key / access token
(e.g. via
https://registration.teslatasks.com/generateTokens, or download a python script like
https://github.com/enode-engineering/te ... n/tesla.py which worked for me)
A token usually works for about a month.
That will give me some time to consider a solution, and meanwhile the tesla module can be used again.
The pull request into domoticz is active, hopefully integration is tomorrow.
My Tesla don't want to sleep, I disable tesla plugin, but api-prd.vn.tesla.services continuouly, I think
https://registration.teslatasks.com/generateTokens use my API
Do you know how to terminate the API generated by this site ?
Re: Tesla hardware module
Posted: Monday 08 February 2021 19:14
by MrHobbes74
dyter wrote:MrHobbes74 wrote: ↑Friday 05 February 2021 12:34
All, I have added the option to specify a API key (a.k.a. access token) in the tesla configuration.
This allows you to use another app to generate the API key / access token
(e.g. via
https://registration.teslatasks.com/generateTokens, or download a python script like
https://github.com/enode-engineering/te ... n/tesla.py which worked for me)
A token usually works for about a month.
That will give me some time to consider a solution, and meanwhile the tesla module can be used again.
The pull request into domoticz is active, hopefully integration is tomorrow.
My Tesla don't want to sleep, I disable tesla plugin, but api-prd.vn.tesla.services continuouly, I think
https://registration.teslatasks.com/generateTokens use my API
Do you know how to terminate the API generated by this site ?
If you want to be sure of that, change your password

. But I can’t imagine it. I have never used Teslatasks. However, I also notice my Tesla doesn’t sleep anymore, already for a while. I haven’t figure out the reason yet.
Sent from my iPhone using Tapatalk
Re: Tesla hardware module
Posted: Monday 08 February 2021 19:27
by dyter
MrHobbes74 wrote: ↑Monday 08 February 2021 19:14
If you want to be sure of that, change your password

. But I can’t imagine it. I have never used Teslatasks. However, I also notice my Tesla doesn’t sleep anymore, already for a while. I haven’t figure out the reason yet.
Sent from my iPhone using Tapatalk
I changed my tesla account password but API work always in domoticz
I found in IP trace on my Adguard docker, that api-prd.vn.tesla.services requests don't sleep the vehicule, sure it use by
https://registration.teslatasks.com/generateTokens for calendar
When I block DNS api-prd.vn.tesla.services with Adguard, the car go to sleep ...
Re: Tesla hardware module
Posted: Monday 08 February 2021 19:57
by MrHobbes74
dyter wrote:MrHobbes74 wrote: ↑Monday 08 February 2021 19:14
If you want to be sure of that, change your password

. But I can’t imagine it. I have never used Teslatasks. However, I also notice my Tesla doesn’t sleep anymore, already for a while. I haven’t figure out the reason yet.
Sent from my iPhone using Tapatalk
I changed my tesla account password but API work always in domoticz
I found in IP trace on my Adguard docker, that api-prd.vn.tesla.services requests don't sleep the vehicule, sure it use by
https://registration.teslatasks.com/generateTokens for calendar
When I block DNS api-prd.vn.tesla.services with Adguard, the car go to sleep ...
Ah interesting, so when password is changed the current token remains valid until it expires. Didn’t know that.
If I were you I would contact teslatask that this should not happen!
Sent from my iPhone using Tapatalk
Re: Tesla hardware module
Posted: Monday 08 February 2021 20:56
by dyter
I deleted my second account autorisation, use revoke token with postman
https://owner-api.teslamotors.com/oauth/revoke
... and token work again ! very good security on tesla servers

Re: Tesla hardware module
Posted: Tuesday 09 February 2021 17:03
by dyter
After 24h, it's good, token revoked ! Please don't use teslatasks for generate token

Re: Tesla hardware module
Posted: Wednesday 10 February 2021 17:04
by dyter
MrHobbes74 wrote: ↑Tuesday 12 May 2020 18:38
cr1cr1 wrote: ↑Tuesday 12 May 2020 18:14
Hi @MrHobbes74,
Well done for that Tesla module, congrats!
I just migrated my Domoticz Pi server from a good old Pi 2 to a Pï 4 running Buster & Domoticz 2020.2 and I discovered it.
I have a couple of Questions before configuring the module :
- Is there a way to just enter the Tesla token and not the full user id / pwd ?
- I have installed the excellent TeslaMate docker on the same Pi 4 server. It runs great and provides awesome reports. Would it be possible to integrate TeslaMate date into Domoticz using MQTT as an option? See:
https://docs.teslamate.org/docs/integrations/mqtt
By the way, Tesla Mate uses now the streaming API that does not wake up the car when polling. (see :
https://github.com/adriankumpf/teslamate/issues/417)
Hi, thanks for the compliment!
Regarding your questions: currently you can only enter the user name and password, just like in the app. If you are afraid of security, please check the code in GitHub

.
I think the purpose of Teslamate exceeds the purpose of the domoticz module. The domoticz module is meant for automation only (e.g. start/stop charging based on various conditions, warning when the car is open etc, warming or de freezing the car when you get up) just like the other sensors and switches in the house. I do not intend to make it a full tracking system for the Tesla. That’s what apps like teslamate is for.
I don’t know about mqtt, it may be possible but it’s not my expertise.
The streaming interface of the Tesla therefor also is not needed. Polling as I implemented in domoticz also doesn’t wake up the car so there is no issue in that regard.
I tested teslamate, and geofence is a very fast and good solution for automation of doors, house gate ...
MQTT command is "teslamate/cars/$car_id/geofence" but need to be integrate in json format of domoticz

Re: Tesla hardware module
Posted: Friday 12 February 2021 15:11
by chrispazz
I got my token using this script:
https://github.com/teslascope/tokens
but adding to domoticz Tesla module it logs that the token is no longer valid.....
Re: Tesla hardware module
Posted: Friday 12 February 2021 15:18
by MrHobbes74
The script you mentions only generates the refresh token. That is not the one that is needed. You need the API token.
If you look into the GitHub, it is based on the one I mentioned earlier. That one is working for me.
Sent from my iPhone using Tapatalk
Re: Tesla hardware module
Posted: Friday 12 February 2021 15:22
by chrispazz
Just tried but that script is giving me the following error:
ValueError: Can't find device `Device #1`
Re: Tesla hardware module
Posted: Friday 12 February 2021 15:26
by MrHobbes74
chrispazz wrote:Just tried but that script is giving me the following error:
ValueError: Can't find device `Device #1`
I have only used it without MFA enabled. Do you have MFA enabled?
Sent from my iPhone using Tapatalk