Optimize Your Tesla Charging: Charge with DLM for Tesla EV

This Node-RED flow manages the charging of a Tesla car in three different ways:

  1. 100% self-consumption of the photovoltaic production

  2. Maintenance of the limit of the network electric meter’s power (avoids disconnection)

  3. Charging in F3 off-peak tariff (the cheapest rate in Italy)

To use the code, it is necessary:

  • A) Node-RED correctly installed in Home Assistant

  • B) A power meter for the power delivered by the wallbox (e.g., a Shelly EM)

  • C) A photovoltaic system integrated into HA

  • D) A Tesla car integrated into HA

For automation no. 1 (100% self-consumption of the photovoltaic production), the Node-RED flow will check every 30 seconds that the charging power absorbs 100% of the available photovoltaic power. If the power value from the photovoltaic is higher or lower than 1A compared to the amperes set in Tesla, the flow recalculates the value and modifies it. To avoid errors in setting the amperes, the flow calculates the maximum and minimum available amperes for Tesla and the value of the volts available on the electric line at each cycle. Automations can be managed from Lovelace; it is possible to switch from one type of charging to another, and the charging in F3 off-peak displays a countdown before starting. The power of the meter can be set directly from Lovelace.

It is possible to set a charging percentage from 0% up to 100% for all charging modes (charging will stop when the target % is reached).

The code of the individual sensors must be adapted to the users’ custom installations.

Link to git:

Ciao Michele
I saw this card of yours and I find it perfect for my purpose…
Today I’m going to pick up my Tesla and I’d like to implement this card of yours, I’m asking for your help to implement it if possible, at least as regards the “APIs” which I understand have recently been changed, so I think I’ll it would be useful to understand this first step given the confusion (at least mine) on what could be already outdated documentation.

You have already helped me with the consumption card (now working) and I also have a Huawei inverter with three-phase 30Kwh storage

first you must configure this: tesla-http-proxy-addon/tesla_http_proxy at main · llamafilm/tesla-http-proxy-addon · GitHub or nothing will work :frowning:

Hi Michele,
I am registering on Tesla Developer to use the Fleet API, but I am facing an issue. When I select Italy, it asks for the company name and TAX ID number (partita IVA), which I obviously don’t have. Unfortunately, these fields are mandatory…
How did you manage this? Did you choose another foreign country?


Thank you.

Thanks Michele for the reply

It’s definitely not a simple thing, do you happen to know any step by step guide, the one just indicated even though I think it’s the official one I can’t understand some steps…

Ho trovato questa guida, va bene per lo scopo, nel senso è aggiornata?

I completed the procedure many months ago, but I don’t remember entering the VAT number. I selected Italy as country.