Page 1 of 15

Tesla hardware module

Posted: Friday 07 February 2020 10:53
by MrHobbes74
Hi all,

A new hardware module is introduced in the latest stable release (2020.1): the Tesla hardware.
For more information about how to use the module, see the wiki: https://www.domoticz.com/wiki/EVehicles

The module connects to your Tesla electronic vehicle, and provides you with:
- a battery level indicator
- an alert indicator giving you the status of the car
- a temperature meter indicating the temperature inside the Tesla
- a temperature meter indicating the temperature outside the Tesla
- an alert indicator giving you an alert for open windows/doors/unlocked Tesla [2012.2 beta build 12004]
- an odometer indicating the total driven mileage of the Tesla [2012.2 beta build 12004]
- a switch to turn on / off charging
- a switch to turn on / off climate control
- a switch to turn on / off defrost mode
- a switch to switch between maximum (on) and default (off) charge level [2012.2 beta build 12004]

Update 21/02/2020: The first version is now integrated in domoticz beta!
Update 25/03/2020: The latest version is now integrated in the new stable release [2020.1] and a WIKI is created.
Update 29/04/2020: A new version with new devices is now present in the next beta [2012.2 beta build 12004]

Re: New: Tesla hardware module

Posted: Monday 17 February 2020 17:32
by meel4chris
great work!
I'd love to test it. just got my first succesfull API request working via postman but via domoticz is much better!
But how do I start? I have domoticz already running for years but from the link I cant figure out the next step..
thanks!

Re: New: Tesla hardware module

Posted: Monday 17 February 2020 19:20
by HvdW
I'd love to test.
Missing a Tesla ;-))

Re: New: Tesla hardware module

Posted: Monday 17 February 2020 20:32
by MrHobbes74
meel4chris wrote: Monday 17 February 2020 17:32 great work!
I'd love to test it. just got my first succesfull API request working via postman but via domoticz is much better!
But how do I start? I have domoticz already running for years but from the link I cant figure out the next step..
thanks!
Thanks! For now, you will have to clone my GitHub and compile domoticz yourself.

In the mean time, I have improved the module a lot, it runs in a separate thread (so not blocking domoticz at any moment) and added climate control: from domoticz you can turn on and off the climate in the car, or set it to defrost mode.This way you can schedule your car to be warm and defrozen when you leave the house in the morning (besides a scheduled charge). For safety, all these controls can only be used when the car is at home and not driving.

Re: New: Tesla hardware module

Posted: Tuesday 18 February 2020 9:30
by meel4chris
Ok, never compiled domoticz before but I'll look into that. Since I'm running a "live" system I have to prepare a few things in order to keep the family happy ;)

Re: New: Tesla hardware module

Posted: Tuesday 18 February 2020 11:06
by MrHobbes74
What version of Domoticz are you running? Are you running the beta? And on Raspberry PI?
I may be able to create a patch that you can download, if you run the latest beta, so you don't need to get into the trouble of compiling.

Re: New: Tesla hardware module

Posted: Tuesday 18 February 2020 12:34
by meel4chris
that would be great!
I'm currently running version 4.11605 but it's no problem to updat to the latest beta.
Running on Raspberry PI indeed.

Re: New: Tesla hardware module

Posted: Tuesday 18 February 2020 17:32
by MrHobbes74
I have created a patch for the Tesla hardware in domoticz.
See:
https://github.com/MrHobbes74/domoticz_tesla_patch

Note that this patch only works on a Raspberry Pi (Buster) and domoticz version 4.11696.

Disclaimer: use at your own risk :-)

Re: New: Tesla hardware module

Posted: Tuesday 18 February 2020 18:39
by meel4chris
Great! I don’t run on buster but I’ll give it a try. After making a backup of my current image..


Verzonden vanaf mijn iPhone met Tapatalk

Re: New: Tesla hardware module

Posted: Tuesday 18 February 2020 19:16
by MrHobbes74
Buster is needed because unfortunately the latest versions of domoticz require Buster...

Re: New: Tesla hardware module

Posted: Tuesday 18 February 2020 19:43
by meel4chris
just found out indeed :o
after performing the steps, domoticz didnt start anymore. got the message:
---
Feb 18 19:34:44 raspberrypi domoticz.sh[1732]: /home/pi/domoticz/domoticz: error while loading shared libraries: libssl.so.1.1: cannot open shared object f... directory
Feb 18 19:34:44 raspberrypi systemd[1]: Started LSB: Home Automation System.
Hint: Some lines were ellipsized, use -l to show in full.
---

So I have to upgrade my OS. challenge accepted.
I have to perform two upgrades as I just read, from Jessie to stretch to Buster..
nice :)

Re: New: Tesla hardware module

Posted: Tuesday 18 February 2020 19:55
by MrHobbes74
I went for a clean install and restore the database. Do you also get that message without my patch?

Re: New: Tesla hardware module

Posted: Tuesday 18 February 2020 20:16
by meel4chris
Just tried to upgrade without your patch. also then it doesnt start anymore.
the beta I was running did run on Jessie. but an upgrade now seems unavoidable.

after a new installation and restore of the domoticz.db file (and lua directory), domoticz will run with all hw and device configuration again?
in that case it might be the best option after those years. I just have to reinstall homekit and mydomoathome as well..

Re: New: Tesla hardware module

Posted: Tuesday 18 February 2020 20:25
by MrHobbes74
Yes, if you restore the database it will work fine.
Just make sure that, just in case, you can always revert to the situation before today 😉

Re: New: Tesla hardware module

Posted: Tuesday 18 February 2020 20:30
by meel4chris
Thanks, I will use another SD card. Just to be sure.
Coming days I'm a bit busy so I dont expect to have buster running before the weekend.
I'll keep you posted. Thanks for the help so far!

Re: New: Tesla hardware module

Posted: Tuesday 18 February 2020 21:02
by MrHobbes74
Take your time! In the mean time, I'm just making it better!

Re: New: Tesla hardware module

Posted: Wednesday 19 February 2020 17:22
by meel4chris
Reinstallation was easier as expected. I now have a sd card running on the latest beta from today, 4.11706. Can you create a new patch for this release?

On buster I don’t get mydomoathome up and running anymore (issue in combination of npm, nodejs and buster). Mydomoathome is required for the imperihome app on my iPhone. Imperihome was the app I used to check and control the house. Do you have any nice suggestions / alternatives? I’m not fan of the standard webapp of domoticz. Now testing to switch to the home / woning app of apple...


Verzonden vanaf mijn iPhone met Tapatalk

Re: New: Tesla hardware module

Posted: Thursday 20 February 2020 7:38
by MrHobbes74
It’s possible to use Apple home in combination with homebridge and donoticz, but it’s not ideal. Have you tried Pilot? That is a good alternative, it works great with domoticz.

I will make a new patch, I’ll let you know.

Re: New: Tesla hardware module

Posted: Thursday 20 February 2020 11:26
by patoo77
MrHobbes74 wrote: Thursday 20 February 2020 7:38 It’s possible to use Apple home in combination with homebridge and donoticz, but it’s not ideal. Have you tried Pilot? That is a good alternative, it works great with domoticz.
What a great advice :mrgreen:

Re: New: Tesla hardware module

Posted: Thursday 20 February 2020 19:01
by MrHobbes74
A new version of the patch is available!