Tesla smart charging - excess solar AND low tarif charging


I’ve been searching but haven’t found it - so time for a question:
I would like to charge my Tesla Model 3 only on excess solar energy AND one-day-ahead low tariff - using the Homey PRO ‘23.

I have seen apps like Tesla Smart Charging and Power by the Hour that facilitate the low tariff charging. Apps like Zonnepanelen let me integrate with my Enphase solar system but do not show how much excess solar I am sending back to the grid. I have Homewizard running so should be able to read how much access solar I am feeding back to the grid. For excess solar, I was hoping to find a flow or script that would be able to dynamically change the Tesla charging rate based on the amount of excess solar.

I cannot imagine that nobody else already has this up and running.

I noticed that Marcel Holtkamp mentioned a possible candidate for what I need, as a recommendation for the Tesla Smart Charging app:

But I cannot find Marcel.

Can you help and guide me to information that will help me set this up in the Homey / reusing flows / scripts that other smart people have created?

Anybody have suggestions?
Thanks in advance!

I can write an example what I have made and try to point out what you could use.


  1. The excess solar should be measured. I use Shelly 3EM, but you could use the Homewizard for that. You need to know what kind of eletricity tariff you have. For example I have nordpool pricing for the electrical energy and the measurement period is one hour. Within this one hour the net consumption in all phases and net production in all phases are summed together. Note that in other countries there might be other kind of methods for metering and net calculation.
  2. Detecting the cheapest hours of the day. I use the Heating Controller app. With this app you can choose for example to charge during the two cheapest hours of the day.
  3. Some method to start and stop charging and change the charging current. I have the Go-e charger and use the Go-e Charger app for that. If I understood correctly you have a Tesla so you could use the Tesla Smart Charger app.
  4. All the needed calculations have to be made with Homeys inbuild logic or with Better Logic Library app.

My control method

  1. I charge the car up to 180km (or other settable limit) of range every day during the low price hours. This is the “baseline” for the charging. With this I can manage one days drives. For this I calculate the needed charge in kWh based on the range of the car, needed range and battery charge level.
  2. If excess solar is available I charge the car up to 90% (not up to 100% to preserve battery).
  • Because I have hourly net metering I calculate the net produced energy to the grid during the ongoing hour.
  • When the produced energy + the prediction of production during the end of the hour is higher than could be consumed with the charging it will start charging.
  • When the consumed energy + the prediction of consumption during the end of the hour is higher than production without the charging the charging is stopped.
  • This same method is used for changing the charging current if more or less consumption is needed.

It is a little bit hard to explain how this exactly works as a whole. I would suggest that start building the controls and ask help for specific problems that you are facing. Happy to help but with this communication platform it’s too time consuming to try to explain everything.

Hi JP,

Thanks a lot, you provided a lot of info for me to work with!

Regards, Philip

1 Like

Hi Philip,

created an advanced flow which is using the information from homewizard to put all excess solar power into the tesla car battery

A bit difficult to have a single screenshot showing the entire flow unfortunately :frowning:

HTH & Br, Yvo

Thanks for sharing, but I have one question. On the second screenshot you set the “Current_Charge_Current” to “Start_Charging_Current”. Where does the “Start_Charing_Current” come from? Is this a default logic value you have defined?

indeed a logic value which I set at 5A … this to start loading with a starting current of 5A which gets adjusted after the first 60 seconds to the value of current available

This also means every time it stops charging and wants to go back on, it always start from “Start_Charging_Current”.

not really if you don’t disconnect the car and/or stop the charging current …
it only starts with 5 Amps the first time …
if there is no current available for charging, it sets the charging current to 0A …

But charing stops when charge_current is less than 0. After that it will start charging with 5A as the current_charge_current again when Power_insight has changed and car is not charging