Tesla hardware module

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

MrHobbes74
Posts: 115
Joined: Sunday 19 January 2020 22:29
Target OS: Raspberry Pi / ODroid
Domoticz version: latest B
Location: Netherlands
Contact:

Re: Tesla hardware module

Post 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
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Tesla hardware module

Post 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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
dyter
Posts: 40
Joined: Thursday 08 February 2018 15:48
Target OS: NAS (Synology & others)
Domoticz version: 8841
Location: Lyon
Contact:

Re: Tesla hardware module

Post 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
Domoticz v2024.1 on Synology Docker host, RFLink, ESPEasy wemos D1, Ecodevices, relays x8, dahua doorbell, reolink cameras ....
MrHobbes74
Posts: 115
Joined: Sunday 19 January 2020 22:29
Target OS: Raspberry Pi / ODroid
Domoticz version: latest B
Location: Netherlands
Contact:

Re: Tesla hardware module

Post 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 Image


Sent from my iPhone using Tapatalk
User avatar
dyter
Posts: 40
Joined: Thursday 08 February 2018 15:48
Target OS: NAS (Synology & others)
Domoticz version: 8841
Location: Lyon
Contact:

Re: Tesla hardware module

Post 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 Image


Sent from my iPhone using Tapatalk
[/quote]

I move hardware folder binaries with winSCP to my synology folder !
Domoticz v2024.1 on Synology Docker host, RFLink, ESPEasy wemos D1, Ecodevices, relays x8, dahua doorbell, reolink cameras ....
MrHobbes74
Posts: 115
Joined: Sunday 19 January 2020 22:29
Target OS: Raspberry Pi / ODroid
Domoticz version: latest B
Location: Netherlands
Contact:

Tesla hardware module

Post 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 Image


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
User avatar
dyter
Posts: 40
Joined: Thursday 08 February 2018 15:48
Target OS: NAS (Synology & others)
Domoticz version: 8841
Location: Lyon
Contact:

Re: Tesla hardware module

Post by dyter »

Ok thanks MrHobbes ;)

It's work in docker, so I make a bridge from my two domoticz
Domoticz v2024.1 on Synology Docker host, RFLink, ESPEasy wemos D1, Ecodevices, relays x8, dahua doorbell, reolink cameras ....
hamster
Posts: 42
Joined: Friday 28 April 2017 19:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: USA
Contact:

Re: Tesla hardware module

Post 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!
JPSke
Posts: 32
Joined: Wednesday 11 November 2020 11:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Sint-Gillis-Waas, Belgium
Contact:

Re: Tesla hardware module

Post 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!
User avatar
dyter
Posts: 40
Joined: Thursday 08 February 2018 15:48
Target OS: NAS (Synology & others)
Domoticz version: 8841
Location: Lyon
Contact:

Re: Tesla hardware module

Post 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 :evil:

Do you know how to terminate the API generated by this site ?
Domoticz v2024.1 on Synology Docker host, RFLink, ESPEasy wemos D1, Ecodevices, relays x8, dahua doorbell, reolink cameras ....
MrHobbes74
Posts: 115
Joined: Sunday 19 January 2020 22:29
Target OS: Raspberry Pi / ODroid
Domoticz version: latest B
Location: Netherlands
Contact:

Re: Tesla hardware module

Post 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 :evil:

Do you know how to terminate the API generated by this site ?
If you want to be sure of that, change your password Image. 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
User avatar
dyter
Posts: 40
Joined: Thursday 08 February 2018 15:48
Target OS: NAS (Synology & others)
Domoticz version: 8841
Location: Lyon
Contact:

Re: Tesla hardware module

Post by dyter »

MrHobbes74 wrote: Monday 08 February 2021 19:14 If you want to be sure of that, change your password Image. 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 :roll:

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 :evil:

When I block DNS api-prd.vn.tesla.services with Adguard, the car go to sleep ...
Domoticz v2024.1 on Synology Docker host, RFLink, ESPEasy wemos D1, Ecodevices, relays x8, dahua doorbell, reolink cameras ....
MrHobbes74
Posts: 115
Joined: Sunday 19 January 2020 22:29
Target OS: Raspberry Pi / ODroid
Domoticz version: latest B
Location: Netherlands
Contact:

Re: Tesla hardware module

Post by MrHobbes74 »

dyter wrote:
MrHobbes74 wrote: Monday 08 February 2021 19:14 If you want to be sure of that, change your password Image. 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 :roll:

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 :evil:

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
User avatar
dyter
Posts: 40
Joined: Thursday 08 February 2018 15:48
Target OS: NAS (Synology & others)
Domoticz version: 8841
Location: Lyon
Contact:

Re: Tesla hardware module

Post 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 :lol:
Domoticz v2024.1 on Synology Docker host, RFLink, ESPEasy wemos D1, Ecodevices, relays x8, dahua doorbell, reolink cameras ....
User avatar
dyter
Posts: 40
Joined: Thursday 08 February 2018 15:48
Target OS: NAS (Synology & others)
Domoticz version: 8841
Location: Lyon
Contact:

Re: Tesla hardware module

Post by dyter »

After 24h, it's good, token revoked ! Please don't use teslatasks for generate token :)
Domoticz v2024.1 on Synology Docker host, RFLink, ESPEasy wemos D1, Ecodevices, relays x8, dahua doorbell, reolink cameras ....
User avatar
dyter
Posts: 40
Joined: Thursday 08 February 2018 15:48
Target OS: NAS (Synology & others)
Domoticz version: 8841
Location: Lyon
Contact:

Re: Tesla hardware module

Post 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 :roll:
Domoticz v2024.1 on Synology Docker host, RFLink, ESPEasy wemos D1, Ecodevices, relays x8, dahua doorbell, reolink cameras ....
chrispazz
Posts: 81
Joined: Friday 08 July 2016 10:38
Target OS: -
Domoticz version:
Contact:

Re: Tesla hardware module

Post 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.....
MrHobbes74
Posts: 115
Joined: Sunday 19 January 2020 22:29
Target OS: Raspberry Pi / ODroid
Domoticz version: latest B
Location: Netherlands
Contact:

Re: Tesla hardware module

Post by MrHobbes74 »

chrispazz wrote: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.....
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
chrispazz
Posts: 81
Joined: Friday 08 July 2016 10:38
Target OS: -
Domoticz version:
Contact:

Re: Tesla hardware module

Post by chrispazz »

Just tried but that script is giving me the following error:

ValueError: Can't find device `Device #1`
MrHobbes74
Posts: 115
Joined: Sunday 19 January 2020 22:29
Target OS: Raspberry Pi / ODroid
Domoticz version: latest B
Location: Netherlands
Contact:

Re: Tesla hardware module

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest