Home assistant can do it on it’s own without node red required. See this thread for a lot more information: Optimizing use of unused Solar Power to charge a Tesla
There are many ways to go about it depending on your preferences. My Tesla is set to start charging when the sun comes up, and when HA sees it charging it adjusts the charge current to match solar excess (I can set a target export level, and to what degree it should let my myenergi eddi consume energy first, and a minimum charge current).