Fuglem
November 7, 2021, 5:29pm
1
Update the Mazda integration to include the EV-specific features included in pymazda
bdr9
(Brandon Rothweiler)
November 14, 2021, 4:47am
2
Hi, I’m the developer of pymazda and the Mazda integration. This is something I am planning to work on. I hope to find some time to work on it soon.
3 Likes
Fuglem
November 14, 2021, 8:48am
3
Great, no hurry. But had been fun with all the features of my mx-30 in home assistant. Thanks for all the work you have already done.
1 Like
bdr9
(Brandon Rothweiler)
November 14, 2021, 7:12pm
4
By the way, the start/stop charging feature is already added. You can use it via the mazda.start_charging
and mazda.stop_charging
services.
The features that still need to be added are:
HVAC status and control
EV status entities - driving range, plugged in status, charging status, etc
Service to refresh vehicle status (only works on electric vehicles)
1 Like
Mibix
November 19, 2021, 12:57am
5
Hey I just added this to connect to my 2021 Mazda CX-5 and the sensors (besides tires and fuel distance) and lock feature seem to be working great. I tried to write a script to use that mazda.start_engine but no dice. Does that work yet? How would I configure the script? I’m free to do any testing.
bdr9
(Brandon Rothweiler)
November 19, 2021, 1:54am
6
Hi @Mibix , the start_engine feature is working fine for me. Here’s what your script should look like:
Here is that same script in YAML form:
alias: Start Car
sequence:
- service: mazda.start_engine
data:
device_id: 26cd9beb60a2ea64ba40e2d23fb07f9c
mode: single
Let me know if you are still having issues getting it to work.
Mibix
November 19, 2021, 3:00am
7
Works like a charm, thanks! I wonder if the fuel distance remaining will work once I drive it and park it again.
bdr9
(Brandon Rothweiler)
November 19, 2021, 5:32am
8
Glad to hear it worked!
Unfortunately I don’t think the fuel distance remaining sensor works on the CX-5. If you look in the MyMazda app I think you will see that that information is missing there as well. It’s a limitation of the Mazda API. We only have access to the information that is available in the app.
Skotch116
(Steven Koch)
December 1, 2021, 3:21am
9
Hi, I have 2021 Mazda 3 turbo and wasn’t able to get this script to work. I was able to add the mazda integration and get the tire pressure and the lock / unlock to work. When i look at the available services the start engine doesnt show up. any advice would be appreciated. Thanks
Skotch116
(Steven Koch)
December 1, 2021, 3:43am
10
Nevermind i figured it out. I had a syntax error.
1 Like
Fuglem
January 10, 2022, 12:25pm
11
Hi Brandon, any news on the update for the HVAC status / control and other features?
1 Like
bdr9
(Brandon Rothweiler)
January 10, 2022, 8:53pm
12
Still working on it There were some other changes (#59869 , #63423 ) that needed to be made before the EV features could be added, and those took several months to be merged by the HA core team due to their large backlog of pending Pull Requests. The good news is that as of yesterday, those changes are now merged and I can now work on the EV features.
I’ll be starting with sensor entities for things like charging status, charge level, and driving range. HVAC control is more complex, so I’ll likely add that afterward, in a separate change.
Fuglem
January 11, 2022, 8:31am
13
Thanks for the update! Looking forward to the changes.
bdr9
(Brandon Rothweiler)
January 16, 2022, 3:00am
14
Hi @Fuglem . Good news: I submitted a pull request to Home Assistant to add sensor entities for EV driving range and charge level. It was merged today and it will be included in HA 2022.2.
home-assistant:dev
← bdr99:mazda-ev-sensors
opened 04:44AM - 14 Jan 22 UTC
<!--
You are amazing! Thanks for contributing to our project!
Please, DO N… OT DELETE ANY TEXT from this template! (unless instructed).
-->
## Proposed change
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
- Upgrade pymazda dependency to 0.3.0 which adds support for electric vehicles. Diff: https://github.com/bdr99/pymazda/compare/0.2.2...0.3.0
- Add electric vehicle sensors (charge level and remaining range)
- Add state classes to sensor entities
- Will add electric vehicle binary sensors in a future PR
## Type of change
<!--
What type of change does your PR introduce to Home Assistant?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [x] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [x] New feature (which adds functionality to an existing integration)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request: https://github.com/home-assistant/home-assistant.io/pull/21186
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [x] The code change is tested and works locally.
- [x] Local tests pass. **Your PR cannot be merged unless tests pass**
- [x] There is no commented out code in this PR.
- [x] I have followed the [development checklist][dev-checklist]
- [x] The code has been formatted using Black (`black --fast homeassistant tests`)
- [x] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [x] Documentation added/updated for [www.home-assistant.io][docs-repository]
If the code communicates with devices, web services, or third-party tools:
- [x] The [manifest file][manifest-docs] has all fields filled out correctly.
Updated and included derived files by running: `python3 -m script.hassfest`.
- [x] New or updated dependencies have been added to `requirements_all.txt`.
Updated by running `python3 -m script.gen_requirements_all`.
- [x] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
- [ ] Untested files have been added to `.coveragerc`.
The integration reached or maintains the following [Integration Quality Scale][quality-scale]:
<!--
The Integration Quality Scale scores an integration on the code quality
and user experience. Each level of the quality scale consists of a list
of requirements. We highly recommend getting your integration scored!
-->
- [ ] No score or internal
- [ ] 🥈 Silver
- [ ] 🥇 Gold
- [x] 🏆 Platinum
<!--
This project is very active and we have a high turnover of pull requests.
Unfortunately, the number of incoming pull requests is higher than what our
reviewers can review and merge so there is a long backlog of pull requests
waiting for review. You can help here!
By reviewing another pull request, you will help raise the code quality of
that pull request and the final review will be faster. This way the general
pace of pull request reviews will go up and your wait time will go down.
When picking a pull request to review, try to choose one that hasn't yet
been reviewed.
Thanks for helping out!
-->
To help with the load of incoming pull requests:
- [ ] I have reviewed two other [open pull requests][prs] in this repository.
[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure
<!--
Thank you for contributing <3
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/en/development_checklist.html
[manifest-docs]: https://developers.home-assistant.io/docs/en/creating_integration_manifest.html
[quality-scale]: https://developers.home-assistant.io/docs/en/next/integration_quality_scale_index.html
[docs-repository]: https://github.com/home-assistant/home-assistant.io
Next, I plan to add binary sensors for plugged in status and charging status.
1 Like
Fuglem
January 16, 2022, 10:38am
15
Wow! Thanks for all your hard work.
2 Likes
bdr9
(Brandon Rothweiler)
January 17, 2022, 5:55am
16
You’re welcome! I don’t have an EV to test with, so I’d appreciate if you could let me know here whether the new EV features are working for you, after you upgrade to 2022.2.
Fuglem
January 17, 2022, 4:22pm
17
Will do an upgrade as soon as its out and let you know.
milras
(João Milreu)
January 27, 2022, 9:55am
18
Just wanted to thank you for your great work.
I’m using this integration with my mazda mx-30 and the new EV features are an excellent addition!
2 Likes
Fuglem
February 5, 2022, 11:01am
19
Hi! Looks like everything works of the new feats. but is it just me or is the device tracker broken?
HWiese1980
(Hendrik Wiese)
February 20, 2022, 9:07am
20
Hey @bdr9 , the EV sensors charge level and range do work now in the HA integration. I’m still waiting for HVAC control and the binary sensors. Any news on these?