-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle sleep behavior of MCU2 upgraded cars #3262
Conversation
…check subsystems. They report online but if vehicle_data is requested they wake up completely (cars clicks) and is awake for 15 minutes instead of a 2-3 minutes. The only difference (known at this moment) is stream reports power=nil in subsystem online and reports a power as a number when it is a real online. Stay in state :start when online is detected on non-vehicle_data stream receives data and new variable fake_online is set dependent on power is nil or a number There are still some TODO's around the code. Also handle stream getting vehicle offline and change to state offline in vehicle
…te is offline or asleep. Before it caused a vehicle_data request in suspended even though not intended (since it actually went to state start where vehicle_data is allowed when false_online=false, which it is in online and suspended) Added a clause in suspended if power > 0 to go back to online (e.g. if climate is turned on remotely with app. That works, not sure if opening door without climate on is enough to trigger this (power seems to be integers, but hopefuly rounded up)
This will lay of vehicle_data and use non-vehicle_data instead and hopefully not keep the car awake when errors suddenly stop again Changed some comment and logger texts
… in online when getting an error.
Could otherwise give a irrelevant warning from try_to_suspend function. (E.g. User present)
This is Beautiful - I've been wondering about this for a couple of years now but never thought to dig more into why the MCU2 upgraded car behaved differently to the other MCU2 car in the account |
Would it make sense to make different PR's to the things that are not directly related to the MCU2 issue?
Just to make it easier to review this, but also for me to actually get CI tests working for both this MCU2 issue and the other things |
Is this PR still active? |
Yes, it just fails some of the workflow tests, so I think I need to figure that out. Besides that I once in a while merge teslamate:master in to keep the PR up-to-date |
Currently installing 2023.38.9. Will report back Works fine with 2023.38.9 |
I can’t see any runs on this PR - @JakobLichterfeld do we have any elixir gurus who could take a look at this one? |
Run needs manual approval. I didn't push the button till now since this branch seems outdated in regards to workflow files |
I just synced the fork, but I know from last run that there are a lot of test failures. Previously I used WSL on windows for test, but it seems to fail even on master. |
✅ Deploy Preview for teslamate ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Can we get this merged into the master? |
Once our 321 test cases run successfully and we are sure that we are not breaking anything with non-MCU2 upgraded cars, the answer will be yes. |
changes from @micves from #3262 Co-authored-by: Jakob Lichterfeld <[email protected]>
changes from @micves from teslamate-org#3262 Co-authored-by: Jakob Lichterfeld <[email protected]>
power > 0 is when e.g. the climate is on which could be scheduled preconditioning or starting preheat from the app. This code will make sure it doesn't enter 'trying to sleep' (the internal state suspended) when power > 0. changes from @micves from teslamate-org#3262
…o online When power > 0. power > 0 is when e.g. the climate is on which could be scheduled preconditioning or starting preheat from the app. changes from @micves from teslamate-org#3262
Only goes to Charging when the car is plugged in (power < 0) and its not preconditioning or in dog mode. changes from @micves from teslamate-org#3262
changes from @micves from teslamate-org#3262 Co-authored-by: Jakob Lichterfeld <[email protected]>
power > 0 is when e.g. the climate is on which could be scheduled preconditioning or starting preheat from the app. This code will make sure it doesn't enter 'trying to sleep' (the internal state suspended) when power > 0. changes from @micves from teslamate-org#3262
…o online When power > 0. power > 0 is when e.g. the climate is on which could be scheduled preconditioning or starting preheat from the app. changes from @micves from teslamate-org#3262
Only goes to Charging when the car is plugged in (power < 0) and its not preconditioning or in dog mode. changes from @micves from teslamate-org#3262
There is a lot more info in this issue: #3084
The short story is:
Older cars upgraded to MCU2 have a little wakeup every hour to check subsystems.
They report online but if vehicle_data is requested they wake up completely (cars clicks) and is awake for 15 minutes instead of a 2-3 minutes.
The only difference (known at this moment) is stream reports power=nil in subsystem online and reports power as a number when it is a real online.
Fix implemented by staying in state :start when online is detected on non-vehicle_data.
Stream receives data and new variable fake_online is set dependent on power is nil or a number.
The variable fake_online is used to decide whether to get only non-vehicle_data or the full blown wakeup vehicle_data
In suspended only non-vehicle_data is allowed to be better at going to sleep. Usage is detected if power>0 to go back to online state.
Other things:
This will lay of vehicle_data and use non-vehicle_data instead and
hopefully not keep the car awake when errors suddenly stop again