Closed OverloadUT closed 6 years ago
Hello, thanks for your questions:
On Thu, 2 Aug 2018, 01:20 Greg Laabs, notifications@github.com wrote:
Hello @zabuldon https://github.com/zabuldon!
I am planning on making some pretty big improvements to the Tesla component in Home Assistant. In order to do them, I need to make several changes to this library. I am going to make these changes regardless, but I wanted to check to see if you're still active and would accept these changes to your library. If not, I'll fork and publish a new lib, but it would be overall better to keep it all here!
Proposed changes:
- Make the library's polling interval management optional (Hass will take over responsibility of requesting when to poll, so that complex "smart polling" logic can be implemented and maintained there.
- Split out polling to be possible per-vehicle rather than per-account.
- Allow fetching updates from the owner API that don't require waking up the vehicle
- Expose a unique ID for each vehicle that can be used as a Hass unique ID, that is NOT the VIN, to avoid unnecessary PII exposure (not sure what this will be quiet yet; perhaps just a piece of the VIN)
I haven't written this yet; I am just putting this here to give you time to see it and let me know how you'd like to proceed before I get to the point where I'm merging it in to Hass :)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zabuldon/teslajsonpy/issues/14, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOKkG5k52yDLS_qPZwMUdFVplyJLSf0ks5uMim_gaJpZM4VrViq .
Excellent; I'm glad you're still active!
I understand that. What I want is the ability to have Hass manage "Smart Polling" to be much friendlier to the car battery: While the vehicle is driving, polling will be fairly rapid, but when the car is parked and not charging, polling will step down gradually to be quite infrequent, to preserve the battery. And if the battery gets to a critical state, such as 20% or less, polling will step down even further. Another objective here is that I will be exposing Hass services that can force a vehicle update, and another that will force and update and reset the step-down timer. The latter can be used in automations to ensure we get a state change to "driving" closer to when it actually starts. (Example: At 8am, reset the stepdown timer, because I expect I'll be driving very soon. More complex example: When my front door opens between 7am and 9am, reset the stepdown timer because I am probably leaving the house now)
Right now your code polls all vehicles on the account at once - this is incompatible with my "state-based" polling intervals I propose above. We need to be able to poll a single vehicle at a time.
I admit that I am inexperienced in this one, but from my read of the API docs, it looks like some of the properties of the vehicle can be fetched from Tesla's servers without needing to wake up the car. I may be completely wrong about this - I'll do more experimenting with the API in this regard.
I'm comfortable with it, I've planned to do something like this, but if you send a pr with this it would be nice
Sounds good. I already have this code, but it isn't stable. I can push it repo in a few days and you can make your changes.
Basically you can get all the sensors, but their values will be frozen if you don't send wake up. For example temperature sensor: if you don't send wake up it respona always the same value or with empty value. If you see possible resolution of this without waking up, I m ready to discuss/accept patches.
On Thu, 2 Aug 2018, 01:39 Greg Laabs, notifications@github.com wrote:
Excellent; I'm glad you're still active!
1.
I understand that. What I want is the ability to have Hass manage "Smart Polling" to be much friendlier to the car battery: While the vehicle is driving, polling will be fairly rapid, but when the car is parked and not charging, polling will step down gradually to be quite infrequent, to preserve the battery. And if the battery gets to a critical state, such as 20% or less, polling will step down even further. Another objective here is that I will be exposing Hass services that can force a vehicle update, and another that will force and update and reset the step-down timer. The latter can be used in automations to ensure we get a state change to "driving" closer to when it actually starts. (Example: At 8am, reset the stepdown timer, because I expect I'll be driving very soon. More complex example: When my front door opens between 7am and 9am, reset the stepdown timer because I am probably leaving the house now) 2.
Right now your code polls all vehicles on the account at once - this is incompatible with my "state-based" polling intervals I propose above. We need to be able to poll a single vehicle at a time. 3.
I admit that I am inexperienced in this one, but from my read of the API docs, it looks like some of the properties of the vehicle can be fetched from Tesla's servers without needing to wake up the car. I may be completely wrong about this - I'll do more experimenting with the API in this regard.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zabuldon/teslajsonpy/issues/14#issuecomment-409748022, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOKkIhanlua7gOoxW0ytgoVdCxmaB51ks5uMi4VgaJpZM4VrViq .
@OverloadUT
Hello @zabuldon!
I am planning on making some pretty big improvements to the Tesla component in Home Assistant. In order to do them, I need to make several changes to this library. I am going to make these changes regardless, but I wanted to check to see if you're still active and would accept these changes to your library. If not, I'll fork and publish a new lib, but it would be overall better to keep it all here!
Proposed changes:
I haven't written this yet; I am just putting this here to give you time to see it and let me know how you'd like to proceed before I get to the point where I'm merging it in to Hass :)