Many things can keep car the awake, check these first: smart summon, cabin overheat protection (when it gets hot only), sentry mode on, 12V battery needs charging, a door that isn't quite shut properly etc...
TeslaFi has a lot of settings to control its polling. As an example, here are my settings, which work well (for me) and let the car sleep:
There is a lot of good information in the settings themselves as well as a separate guide they have a link to at the beginning of the settings. If you really want to understand how it all works, read that information.
In essence, these settings indicate when TeslaFi should stop calling the Tesla APIs and for how long. During that time, any activity would be missed which is why we try to limit those periods. At the same time, if you limit too much and constantly poll the car through the APIs, it cannot sleep. It's a tradeoff.
After that period where it stops polling, TeslaFi first calls an API that doesn't wake the car up and just tells if the car is awake or not. Only if it is still awake does TeslaFi call the other APIs that might wake it up. OTherwise it keeps calling that single API function that tells if the car is awake or not and will resume polling when it says "awake". That's how every app must do it, it's all they can do with the current APIs.