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

Post Reply
cr1cr1
Posts: 16
Joined: Sunday 04 September 2016 14:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: France
Contact:

Re: Tesla hardware module

Post by cr1cr1 »

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)
Domoticz on RPi2 - RFXCOM RFXtrx433E - Weather Station WMR200 - Z-WAVE.ME UZB - Fibaro FGR[M]222, FGFS101 - GR105n - Opus XT300 - téléinfo Elec.- Everspring SM103 & Vision ZD2102 - NAS Thecus N4800 - Logitech Harmony Ultimate - MXIII-G + Kodi :D
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 »

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.
cr1cr1
Posts: 16
Joined: Sunday 04 September 2016 14:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: France
Contact:

Re: Tesla hardware module

Post by cr1cr1 »

MrHobbes74 wrote: Tuesday 12 May 2020 18:38 ...
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. ...
Fair enough! You're right.
I'd love to just insert my token in a file somewhere. Not that I do not trust your code... but just a habit with Tesla related pieces of software ;-)
Domoticz on RPi2 - RFXCOM RFXtrx433E - Weather Station WMR200 - Z-WAVE.ME UZB - Fibaro FGR[M]222, FGFS101 - GR105n - Opus XT300 - téléinfo Elec.- Everspring SM103 & Vision ZD2102 - NAS Thecus N4800 - Logitech Harmony Ultimate - MXIII-G + Kodi :D
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Tesla hardware module

Post by freijn »

Dear Mr Hobbes

Monday I got my Tesla and ready to press the button to activate the option in my domoticz.

Without having seen the software I would like to ask for a feature request already. Please ignore if its already there......

Would it be possible to manage the charging on status of the Solar equipment?

- charge dynamicly when there is sun for x amount of minutes
- change charge amp's dynamicly for the amount Sun available
- Override button to charge from Grid if the card is suppose to drive the next day

For the moment it's just a toy but in the Netherlands this might become huge as government will slowly stop the Green money flow...

Many thanks for your great work !!
Need to wait for my Tesla account transfer... :-(

Cheers,
Frank
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 »

Hi Frank,

Congrats on your Tesla! I’m sure you will enjoy it!

Regarding your requests: the Tesla module allows you to start and stop charging at your own convenience using a switch so with some dzVents scripting linked to your solar panels this is definitely possible. Changing the amps is not yet a possibility.
Changing from solar to grid is not Tesla related, I guess that would be another switch somewhere in Domoticz that you can use in your scripts.

Good luck!
Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Re: Tesla hardware module

Post by Bikey »

freijn wrote: Wednesday 27 May 2020 13:30 Dear Mr Hobbes

Monday I got my Tesla and ready to press the button to activate the option in my domoticz.

Without having seen the software I would like to ask for a feature request already. Please ignore if its already there......

Would it be possible to manage the charging on status of the Solar equipment?

- charge dynamicly when there is sun for x amount of minutes
- change charge amp's dynamicly for the amount Sun available
- Override button to charge from Grid if the card is suppose to drive the next day

For the moment it's just a toy but in the Netherlands this might become huge as government will slowly stop the Green money flow...

Many thanks for your great work !!
Need to wait for my Tesla account transfer... :-(

Cheers,
Frank
That is actually exactly what I have done.

I'm not so good in DzVents so I used NodeRed to provide the logic and read the Tesla status from Domoticz (using MQTT) and the info from the Solar panels to decide when to start and stop charging. I also included a virtual "TrackSolar" switch in Domoticz to indicate if charging has to be done by the script or is on "manual".

To be able to this, of course you need real-time data from you solar panels.
I am using a Modbus Kwh meter on the Solar panels and a script to read the Modbus data for this. The data is then posted on a MQTT-topic where this can be picked up by the NodeRed script. You could perhaps also use the API of you Solar panel suplier like SolarEdge if this real-time enough.

Only thing on my wish list is to be able to dynamically change the Amps. I now manually have set it in the car at (3 x) 6 or 7 Amps which is still 5-6 Kwh.

See below,the purple line is the charging power to the car, it is activated if the Solar power exceeds 5Kw during 2 minutes and stopped if it is less then 3 Kwh during 5 minutes or the car is full (in this case).
Solar charging.png
Solar charging.png (186.68 KiB) Viewed 10320 times
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Tesla hardware module

Post by freijn »

Well done Mr. Bikey !!

A few months ago I adapted a python library in order to report in my Domoticz.
On every tick of my P1 interface I do collect the Solars and calculate house consumption.

As I wrote I do not have access to my Tesla yet , but heard you set the charging current from the App?
So can we do it from the API ? :-)
I believe regulating the current would be better than starting and stopping many times.

Did you make a switch as well of override the Solar Charging and draw current from the Grid?
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 »

What kind of current values would you want to have? Is it a fixed set of selections or totally variable? I could work on adding a current setting for the Tesla in Domoticz for this purpose.
Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Re: Tesla hardware module

Post by Bikey »

As I wrote: I have to set the current in the car, the App does not support that unfortunately.

You can find (reverse engineered) documentation of the Tesla API here. As far as I can see there is no way to set the charging power/Amps with the API. Unfortunately, as you said, because that would be better then just start/stop.

On the other hand: the minimum Amps at which car (with a TWC) wants to charge is 3 x 6 Amps, my solar panels provide max 3 x 10 Amps, so there is not very much to modulate.

If you have a Tesla Wall Charger you could try to hook it up to RS-485 and then use this python script somebody wrote to command the charger itself to offer only the amount of Amps you have available from solar. I do have a TWC and it already have a data-cable but I have not tried to get that working yet. Doing it via the API would be more elegant (and not depend on the charger hardware).

My switch is only a virtual switch in Domoticz which the NodeRed logic checks to see if it has to be active or not. This prevents it from stopping the charging if the sun is low.
There is no need to physically switch something on or of: the car just takes the power it needs, if there is enough from the Solar panels this is used, if not it comes from the grid.
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 »

Indeed, I did not realize, you can’t set the amp from the api. So there is no way to make this.
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Tesla hardware module

Post by freijn »

Guys,

I do not want to hijack this topic, just a quick Q.

Do you see the nightly spikes as well? Any clue why this is "good" ?
Capture.JPG
Capture.JPG (105.12 KiB) Viewed 10284 times
Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Re: Tesla hardware module

Post by Bikey »

Nope, I can see a steady current of 0,03 - 0,04 Amp on 1 phase to feed the TWC itself, but that's it.
I have to say however that I only read my Modbus meter only once per minute, so if it are very short spikes I might mis them.

I think however that this is an indication that your car isn't sleeping well and wakes up about every hour. So perhaps you have set your polling interval incorrectly or another App that wakes it up.

I'm using TeslaFi which says my car sleeps all night.
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 »

Does the Tesla module in Domoticz also detects these wake ups? Or don’t you use the module yet.
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Tesla hardware module

Post by freijn »

I can't connect at this moment, waiting for tesla to assign my accound. (Tesla is so slowwwwww) :-(
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 »

I waited 1.5 month to get it 😬
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Tesla hardware module

Post by freijn »

MrHobbes,

I think I got a way to contol charging speed of the car.......

In my setup my charger pole is connected to a P1 device monitoring the power used by the house.
If I emulate this ( rs232 ) signal I can tell the car to decrease or increase charging current by simulating house consumption.

I will dive in P1 signals/protocol and let you know if this can be done.
Please let me know if your charging system is connected to a P1 one as well?

Cheers,

Frank
PVuser
Posts: 33
Joined: Monday 30 March 2020 19:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: DE
Contact:

Re: Tesla hardware module

Post by PVuser »

What is P1? Do you mean PP This ist only for the current protection of the cable I think. The controlling of the current is done via CP. Best way wil be of course a Tesla API.

There was a discussion in https://twitter.com/elonmusk/status/932649922666438656 Elon Musk leave the comment: "Good point"! :-). But nothing happend till now. Does someone have a Twitter account and can ask Elon how about this point? If there is a chance in the near time to get this feature. I think it should not such a lot of work. At least the API call will help us.
PVuser
Posts: 33
Joined: Monday 30 March 2020 19:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: DE
Contact:

Set Temperature not 0

Post by PVuser »

@MrHobbes74 Is it possible to show the last temperature when you get not current temperature. It will be better for the chart which is going to 0 very often. Very confusing at the beginning. Also the temperature range in the lower chart is always wrong because it shows 0 to max.

Thanks
Last edited by PVuser on Thursday 04 June 2020 10:12, edited 1 time in total.
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Tesla hardware module

Post by freijn »

PVuser wrote: Wednesday 03 June 2020 19:40 What is P1?
P1 is an output from the so called "Smart meter" and is the feedback from the providers meter how much amps you are pulling off the grid.

When the Tesla starts charging at my home power connection it can do 11Kw (3 phase 16Amp) which is the max I am allowed with my subscription.
The charging point is monitoring my house power draw for that moment and top it up to 11Kw in total.

If I manipulate the P1 information to the charging point so that the Top Up will be my Solar amount, the Car is really charged by Solar power..... :-)

I agree a API would be much better.. But the last response was from 2018.... :-(
PVuser
Posts: 33
Joined: Monday 30 March 2020 19:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: DE
Contact:

Re: Tesla hardware module

Post by PVuser »

Ok, I understand. Than it is a special environment.

I'm thinking about using the "simple EVSE" ( e.g. documentation).
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest