You cannot set this up using the car or the app. You could do it manually by setting a 40% charge limit when you get home. Of course, you'll need to raise it up when your rates go down! You could, of course, set a a reminder in your phone to alert you each day at that time.
The Tesla API does allow setting charge limits remotely. If you're a programmer, you could possibly write a small program to play with the charge limits automatically. Or, using home automation software, like HomeAssistant, you could set up an automation to do this. There are commercial Tesla tracking services, like teslafi and teslascope that might have some capability here. You could check with them.
However, you might also consider how often you find yourself needing to do some emergency driving in the evening and how far you would need to go in such cases. Unless the driving is a true emergency, you may have the option to stop at a nearby supercharger. Starting with a SoC below 20%, a mere five minutes at a supercharger will give you quite a bit of range. If the need is infrequent, it might be better than having to fiddle around with manually starting and stopping a charge every day.
Finally, consider that 20% allows quite a bit of driving. It's likely to be plenty to do ordinary errands in the evening. On the highway, you should be able to get around 50 miles, depending on weather.