Replies: 6 comments 2 replies
-
This is how I do it.
vehicles = tesla.vehicle_list()
vehicleData = vehicles[0].get_vehicle_data()
if vehicleData.get('state') == 'online':
…On Tue, Aug 1, 2023 at 11:39 AM selsrog ***@***.***> wrote:
I notice that if your Tesla is awake, and you start looping in your
application using vehicles_list(), it prevents the car from going to sleep.
As the last_seen() function is giving an error, I'm looking for an
alternative.
Just noticed the available() function, would that work for continuous
polling without keeping the car awake?
—
Reply to this email directly, view it on GitHub
<#138>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A22GEVER76ZABN4PDCUOG53XTEIJVANCNFSM6AAAAAA2737GVM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
It's get_vehicle_data that keeps the car awake. Try something like this:
get_vehicle_summary is a light weight info that doesnt keep the car awake. It doesnt contain the same amount of data, but at least you can check if its online. available() does more or less the same:
|
Beta Was this translation helpful? Give feedback.
-
Interesting enough, if you look at whats returned from
tesla.vehicle_list()
It has a state in there... So that's without ditching the vehicle
data. I just changed my code.
…On Tue, Aug 1, 2023 at 12:08 PM selsrog ***@***.***> wrote:
I currently also do it like you describe, but that prevents an online car
from going to sleep. And this is something I want to prevent, as it
consumes like 1% of the battery...
—
Reply to this email directly, view it on GitHub
<#138 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A22GEVARWQ3NIQWKQYNQY2DXTELWZANCNFSM6AAAAAA2737GVM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the feedback. Now, I think it would make sense to give more inside in what I am trying to do. Hence, I need to now where it is, and if it is connected at all times. And that is just not possible with vehicle_list, available or the car status. Because it can change with me not checking, and if I check it, I keep the car awake... Makes sense? Or am I missing something? Now, I think I found something. last_seen gave me an error (date is in the future), that is why I went looking for another way, as I thought it was a bug. So if last_seen is more recent then when I saw the car, I can poll its location and state. And with that I can work... If it goes offline after me polling, I know it fell asleep without moving... |
Beta Was this translation helpful? Give feedback.
-
If you need to know where it is located, then you are going to have to talk
to the car, hence waking it up to do so. There is no way around that unless
you store it's last location and do some logic to say that it's not online
and hence it's last stored location has to be i's location since it never
came online and therefore could not have moved.... Same goes for the "If
it's connected", I assume you mean plugged in to a charger, only the car
can tell you that...
…On Wed, Aug 2, 2023 at 5:58 AM selsrog ***@***.***> wrote:
Thanks for the feedback. Now, I think it would make sense to give more
inside in what I am trying to do.
I want to now when the car is connected to my home charger, so I can make
it charge in a controlled way. In the summer for instance I only want solar
surplus rolling into it.
Hence, I need to now where it is, and if it is connected at all times. And
that is just not possible with vehicle_list, available or the car status.
Because it can change with me not checking, and if I check it, I keep the
car awake...
Makes sense? Or am I missing something?
Now, I think I found something. last_seen gave me an error (date is in the
future), that is why I went looking for another way, as I thought it was a
bug.
But! I just found out that last_seen only gives an error when the car is
awake (both on S and 3). But that I can intercept... Moreover, if it gives
and error it is online ;-).
So if last_seen is more recent then when I saw the car, I can poll its
location and state. And with that I can work... If it goes offline after me
polling, I know it fell asleep without moving...
—
Reply to this email directly, view it on GitHub
<#138 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A22GEVHBXCT4A3PMLCESM3DXTIJDZANCNFSM6AAAAAA2737GVM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I understand. That way you would have access to the latest info from the car when he himself was online, without having to wake it up... Just tested the last_seen(), and that one also keeps the cars awake, if it was awake when when first used in the loop... |
Beta Was this translation helpful? Give feedback.
-
I notice that if your Tesla is awake, and you start looping in your application using vehicles_list(), it prevents the car from going to sleep.
As the last_seen() function is giving an error, I'm looking for an alternative.
Just noticed the available() function, would that work for continuous polling without keeping the car awake?
Beta Was this translation helpful? Give feedback.
All reactions