Skip to content
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

Add new sensor "Preclimate Status" for hybrid and electric vehicles #264

Merged
merged 4 commits into from
Oct 3, 2024

Conversation

philippwaller
Copy link
Contributor

@philippwaller philippwaller commented Oct 2, 2024

This pull request introduces a new sensor called "Preclimate Status" to provide insights into the current status of the preconditioning system for hybrid and electric vehicles. Additional attributes providing further details about the preconditioning states, such as duration, trigger, configured departure time, selected seats and more.

For reference, this PR addresses issue #263.

@philippwaller
Copy link
Contributor Author

I'm not completely thrilled with the name "Preclimate Status." I went with it for consistency, but I would prefer to stick to the official attribute names.

@philippwaller philippwaller changed the title Add new sensor "Preclimate Status" for hybrid and electric vehicle conditioning Add new sensor "Preclimate Status" for hybrid and electric vehicles Oct 2, 2024
@ReneNulschDE
Copy link
Owner

Thanks for this good PR! Unfortunately, precondOperqtingMode is not a good sensor core value. This is reported for EQE, B and S but not for hybrids and EQV and some others like smarts. Means that all these would be not available for these car types.

We can calculate the active value based on active/now.

…precond_status_handler

- Refactored _get_car_values to use the handler pattern, improving readability and scalability.
- Added precond_status_handler to calculate the precondition status based on precondNow, precondActive and precondOperatingMode.
@philippwaller
Copy link
Contributor Author

Thank you very much for your feedback and the valuable insights! I've implemented your suggestions right away and additionally integrated precondOperatingMode into the calculation, as my tests have shown that this value is updated a bit earlier than the other two. I took the opportunity to modularize the _get_car_values function in the spirit of "opportunistic refactoring" 🚀.

@ReneNulschDE
Copy link
Owner

Thanks, let me check this.

OperatingMode possible values:
0=OFF
1=HEAT
2=COOL
3=VENTILATE

So your >0 = Active assumption is right.

@ReneNulschDE ReneNulschDE merged commit 0ee9e3d into ReneNulschDE:master Oct 3, 2024
6 checks passed
@ReneNulschDE
Copy link
Owner

merged, thanks - I will add a few cleanups and the translation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants