Python script for Tesla actions
Moderator: leecollings
-
- Posts: 112
- Joined: Sunday 20 May 2018 12:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: NL
- Contact:
Python script for Tesla actions
Hi,
Could this python script work in Domoticz?
This is an exported script from "postman program" to Python.
My goal is to do some actions with a virtual switch in Domoticz to control a Tesla.
********************************************************************************************************************************
import requests
url = "https://owner-api.teslamotors.com/api/1 ... /honk_horn"
payload = ""
headers = {
'Authorization': "Bearer 1234567890",
'User-Agent': "PostmanRuntime/7.11.0",
'Accept': "*/*",
'Cache-Control': "no-cache",
'Postman-Token': "abcde",
'Host': "owner-api.teslamotors.com",
'accept-encoding': "gzip, deflate",
'content-length': "",
'Connection': "keep-alive",
'cache-control': "no-cache"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
*********************************************************************************************************************************
Thanks
Could this python script work in Domoticz?
This is an exported script from "postman program" to Python.
My goal is to do some actions with a virtual switch in Domoticz to control a Tesla.
********************************************************************************************************************************
import requests
url = "https://owner-api.teslamotors.com/api/1 ... /honk_horn"
payload = ""
headers = {
'Authorization': "Bearer 1234567890",
'User-Agent': "PostmanRuntime/7.11.0",
'Accept': "*/*",
'Cache-Control': "no-cache",
'Postman-Token': "abcde",
'Host': "owner-api.teslamotors.com",
'accept-encoding': "gzip, deflate",
'content-length': "",
'Connection': "keep-alive",
'cache-control': "no-cache"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
*********************************************************************************************************************************
Thanks
- FireWizard
- Posts: 1863
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Python script for Tesla actions
Hi,
Are you aware that there exist a node for Tesla in Node Red? You need an account and it is for Tesla Model S. From there you can use the same approach as I did for Volvo.
See "Connected Cars"
Regards
Are you aware that there exist a node for Tesla in Node Red? You need an account and it is for Tesla Model S. From there you can use the same approach as I did for Volvo.
See "Connected Cars"
Regards
-
- Posts: 17
- Joined: Saturday 09 March 2019 20:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2025.1
- Location: Helsinki
- Contact:
Re: Python script for Tesla actions
After more than ten searches for connected cars or cars or Tesla, can someone who knows it point to the thread in question?
Looking for a Tesla S API for Domoticz.

Looking for a Tesla S API for Domoticz.
- FireWizard
- Posts: 1863
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Python script for Tesla actions
As I do not own a Tesla, I'm not able to test anything, as I don't have the account.
As said Node-Red has a node for Tesla Model S. You need an account.
You have to take the following steps:
1. Install NodeJS
2. Install Node-Red
3. Install MQTT broker, e.g Mosquitto and Mosquitto-clients
For details see my post at:
viewtopic.php?f=38&t=26549
Of course you can skip the Volvo part.
If you have installed the programs above you can create virtual sensors in Domoticz.
With MQTT you can push the desired data to Domoticz.
If the node in Node-Red supports it you can send commands to your Tesla.
Do not hesitate to ask.
Regards,
As said Node-Red has a node for Tesla Model S. You need an account.
You have to take the following steps:
1. Install NodeJS
2. Install Node-Red
3. Install MQTT broker, e.g Mosquitto and Mosquitto-clients
For details see my post at:
viewtopic.php?f=38&t=26549
Of course you can skip the Volvo part.
If you have installed the programs above you can create virtual sensors in Domoticz.
With MQTT you can push the desired data to Domoticz.
If the node in Node-Red supports it you can send commands to your Tesla.
Do not hesitate to ask.
Regards,
Last edited by FireWizard on Friday 03 May 2019 17:18, edited 1 time in total.
-
- Posts: 112
- Joined: Sunday 20 May 2018 12:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: NL
- Contact:
Re: Python script for Tesla actions
Hi, thanks for the information. I will try this week to install these programs on my Rasp Pi.
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Python script for Tesla actions
And did it work???

Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
- Posts: 36
- Joined: Sunday 11 February 2018 13:25
- Target OS: -
- Domoticz version:
- Location: Longwy, France
- Contact:
Re: Python script for Tesla actions
Hello there.
Working on a Tesla Plugin for Domoticz.
I am open to any contributions and test... (currently started work, so it does not work yet...).
See : https://www.domoticz.com/forum/viewtopi ... 65&t=30812
Regards
Working on a Tesla Plugin for Domoticz.
I am open to any contributions and test... (currently started work, so it does not work yet...).
See : https://www.domoticz.com/forum/viewtopi ... 65&t=30812
Regards
-
- Posts: 115
- Joined: Sunday 19 January 2020 22:29
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest B
- Location: Netherlands
- Contact:
Re: Python script for Tesla actions
See
https://www.domoticz.com/forum/viewtopi ... 38&t=31244
for a working first version of native Tesla support in Domoticz.
https://www.domoticz.com/forum/viewtopi ... 38&t=31244
for a working first version of native Tesla support in Domoticz.
-
- Posts: 115
- Joined: Sunday 19 January 2020 22:29
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest B
- Location: Netherlands
- Contact:
Re: Python script for Tesla actions
The coming beta will have Tesla support! Please try it! Comments and tips are welcome for a next version!
-
- Posts: 36
- Joined: Sunday 11 February 2018 13:25
- Target OS: -
- Domoticz version:
- Location: Longwy, France
- Contact:
Re: Python script for Tesla actions
Really nice work. Better than mine... (was out of time).
So I can delete my start of work, and rely on native domoticz Tesla support
Many thanks :p
So I can delete my start of work, and rely on native domoticz Tesla support

Many thanks :p
-
- Posts: 115
- Joined: Sunday 19 January 2020 22:29
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest B
- Location: Netherlands
- Contact:
Re: Python script for Tesla actions
Thanks! Didn’t mean to overrule your work, but I recently got a Model 3, and at the same time wanted to get to know the Domoticz internal c++ code. 1+1=2. Hope you enjoy using it
, if you have additional requirements or bugs, please let me know!
Who is online
Users browsing this forum: No registered users and 1 guest