-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Charging Binary Sensor Not Working - Ariya #77
Comments
The errors communicating with the API seems to be some sort of Nissan issue that I'm getting too. Does the plugged in sensor update correctly? |
Not 100% sure as I've rolled back to v0.6.0. My primary use case for using this sensor is to determine which utility meter bucket to put the consumed energy in as we have several vehicles. If I get time this week I'll roll back up and see if I could also use plugged in sensor to do the same job. |
Ive got the same issue... Yes, the plugged in sensor updates correctly on 0.7 - but the charging state doesnt show |
I appreciate this is a bit annoying, but could one (or both) of you please install v0.7.1-beta.2 before your next charge. You'll see in the log messages like this: If possible, can you please grab one of these messages when you are charging and one when you are not. Thanks in advance! |
FetchBatteryStatusAriya: {'lastUpdateTime': '2024-11-22T10:50:07Z', 'batteryLevel': 77, 'batteryTemperature': 0, 'batteryAutonomy': 196, 'plugStatus': 0, 'chargingStatus': 0.0, 'chargingRemainingTime': 68, 'batteryCapacity': 63, 'batteryAvailableEnergy': 44, 'rangeHvacOn': 0, 'rangeHvacOff': 0} FetchBatteryStatusAriya: {'lastUpdateTime': '2024-11-22T11:08:50Z', 'batteryLevel': 77, 'batteryTemperature': 0, 'batteryAutonomy': 196, 'plugStatus': 1, 'chargingStatus': 0.0, 'chargingRemainingTime': 97, 'batteryCapacity': 63, 'batteryAvailableEnergy': 44, 'rangeHvacOn': 0, 'rangeHvacOff': 0} |
Thats really strange - chargingStatus is what I'd expect to update but it doesnt seem to. Do any of your logs show chargingStatus to be anything other than 0? |
I'd have to check the old version - to see what was coming out on that... (assuming thats what you meant) - but it must do - as it was updating the status to charging |
My does also not change. Can I be in any help with logs etc or have you seen the error? |
@dan-r do you need anything to help get a resolution to this? |
Apologies - I haven't had the time to look into this. It could really do with a developer who owns an Ariya looking at it :) The root of the issue is that the changes I made in 0.7.0 (should?) fix the range not showing for the Ariya but seem to have also broken charging binary sensor. This change was to use a different API endpoint to the Leaf. It seems like we actually need to be hitting both endpoints to keep both working. |
Thanks @dan-r. I wish I could help but I'm not a dev :| I'm just worried that at some point v0.6 will end up being deprecated/left behind. I appreciate the work you've done so far. |
I'll try to get a beta out over the weekend and put a message here when its done. Might take a bit of back and forth but shouldn't take too long |
@RGx01 would you mind trying v0.7.4-beta.1? |
@dan-r looking good so far. I'd like to see what happens when the charge finishes (that won't happen until tomorrow) ![]() |
Not a problem, just let me know. Do the range sensors work for you too? |
@dan-r ![]() |
I also tried this beta last night, here are my observations (I'm guessing some of this might be expected in this test version): Car: Nissan Ariya 2022 V0.7.3 - All Ariya sensors provide values except
V0.7.4 beta-1 - Several sensors are now missing and 'Plugged In' is no-longer accurate.
It looks like some blend of the two versions could provide values for all sensors. The images below show the status of using each of the versions; the first is the beta, the second is production. |
I'd like to confirm @RGx01 's findings. |
Thanks all, I appreciate your time getting this right! How about with v0.7.4-beta.2? There's a really weird mix here. So pre v0.7.0 everything came from the 'Leaf' endpoint. In v0.7.0 I moved everything to the 'Ariya' endpoint if you drive an Ariya. So now, for the Ariya, everything comes from the 'Leaf' endpoint except for the following which come from the 'Ariya' endpoint:
I think I've managed to capture everything from your feedback, but let me know how it works for you. |
Good to hear its looking good. From experience, I think the service in general is just pretty slow. So for the range and charge times, there's only one value for the Ariya whereas the Leaf splits them both out into AC on/off and 3kw/6kw. Charge times seem to change based on if its charging or not, so no idea there. For the range, I'd rather just provide one sensor - do you know whether it looks like the AC on or the AC off range? |
Good shout @dan-r about reducing duplication. |
@dididu I'm leaning towards taking that value as AC On, but would you mind checking the range from in the car with heating/cooling on and seeing if it is? For my Leaf (with heat pump) there's only 2 miles difference currently so not a big deal really. |
@dan-r Ariya doesn't change the GOM with AC on/off. Should have said it in the initial message. :) |
Ah - that explains the one value then, thanks for that! |
Thanks @dan-r I agree on Range... I see little difference with AC on or Off neither numerically nor practically. We can definitely simplify the sensors for Ariya. I also have some observations of "Charge Time", see later. I made a little test plan and did a sneaky charge... I can corroborate the results from: @dididu as shown here: Regarding charge time, for the first time I think I understand it. It seems that the value returned by the API is adaptive according to actual charging current, with some sort of default high-current value when unplugged. This is what happened today, The big jump up happens at charge-start, and the big drop at unplugging. So, charge time is only really useful during a charge, and there should certainly only be one sensor for the Ariya, perhaps "Charge Time (adaptive)"? |
Thanks for that testing, its really helpful! I've released a new beta that shouldn't change anything except:
Would you mind testing it out over the weekend? - I'll do the same to make sure I haven't messed up anything for the Leaf/non-Ariyas. |
Unlike @dididu, I still get unknown on several of the sensors, even on v.0.7.4-beta.2. I should note that the car is brand new (2024 model, FE0-24, Norway), I've had it for less than 24 hours and haven't charged it yet. But the official NissanConnect app shows both estimated range and last updated fields. |
@natterangell what about beta 3? |
@dan-r Thanks. We're nearly there I think. Here are my observations of beta2 vs. beta3.
I, therefore, cannot see a sensor that exposes Range, unlike in beta 2. I'm not sure what your intention was... to re-use |
No, wait. Three sensors were no longer provided by the integration. The following is correct on beta 3 for me, so it seems identical to what @wralb got, except "Range (AC ON)" and "Last updated" are unknown for me. Plus I don't have a "charge time" sensor anymore. The car has only been active in Nissan's systems for about 24 hour, maybe data needs to propagate somehow(?) |
@wralb oops, my bad, typo in the code. How about now with beta 4? @natterangell odd that it isnt working for you... In beta 4 I've added something in to fallback to the Leaf endpoint if the Ariya one doesnt provide anything. Mind trying this? |
@dan-r Looks good now. Comparing beta-3 to beta-4:
|
@dan-r Morning. |
@dididu hm that's very strange. Would you mind downgrading to 0.6.x temporarily and letting me know if the battery percentage shows for that? If so, it'll be an easy fix, if not it'll require some more investigation. |
Is there some pattern to why certain sensors only show values for some users? Could there be API-differences between car firmware versions? As previously, I have a 2024 model firmware verison FE0-24. |
Looks like after some driving the battery percentage value appeared again. Same beta4 version. |
@wralb glad its working for you now! @natterangell I'm really not sure on this one - I wouldn't have thought it would differ. All supported Leaf models seem to use the same API and present the same data. @dididu do you see any errors in the logs? |
Right it looks like for most of you the values are now being provided. I've released v0.7.4 stable now (exactly the same code as beta 4 though). Because this issue is getting quite long, I'll close it now. If any of you are still having issues, could you please raise it as a new issue with any relevant logs and screenshots. Thank you |
What happened?
Since release 0.7.0 Binary Sensor Charging does not report charging when charging. Also noting a high number of "Error communicating with API" in logs.
To Reproduce
Charge an Ariya and check sensor status after polling.
Expected behavior
Binary Sensor should report Charging whilst charging.
Log Output
2024-11-13 16:48:01.491 DEBUG (MainThread) [custom_components.nissan_connect.coordinator] Finished fetching Poll Coordinator data in 0.321 seconds (success: True)
2024-11-13 16:48:03.748 DEBUG (MainThread) [custom_components.nissan_connect.coordinator] Finished fetching Update Coordinator data in 2.258 seconds (success: True)
2024-11-13 16:48:09.628 DEBUG (MainThread) [custom_components.nissan_connect.coordinator] Finished fetching Statistics Coordinator data in 2.410 seconds (success: True)
2024-11-13 17:03:03.066 WARNING (MainThread) [custom_components.nissan_connect.coordinator] Error communicating with API
2024-11-13 17:03:03.067 DEBUG (MainThread) [custom_components.nissan_connect.coordinator] Finished fetching Update Coordinator data in 0.025 seconds (success: True)
2024-11-13 17:18:03.766 WARNING (MainThread) [custom_components.nissan_connect.coordinator] Error communicating with API
2024-11-13 17:18:03.767 DEBUG (MainThread) [custom_components.nissan_connect.coordinator] Finished fetching Update Coordinator data in 0.725 seconds (success: True)
2024-11-13 17:33:03.066 WARNING (MainThread) [custom_components.nissan_connect.coordinator] Error communicating with API
2024-11-13 17:33:03.066 DEBUG (MainThread) [custom_components.nissan_connect.coordinator] Finished fetching Update Coordinator data in 0.024 seconds (success: True)
2024-11-13 17:48:01.458 DEBUG (MainThread) [custom_components.nissan_connect.coordinator] Finished fetching Poll Coordinator data in 0.288 seconds (success: True)
2024-11-13 17:48:02.841 DEBUG (MainThread) [custom_components.nissan_connect.coordinator] Finished fetching Update Coordinator data in 1.383 seconds (success: True)
2024-11-13 17:48:02.844 DEBUG (MainThread) [custom_components.nissan_connect.sensor] Updating odometer state
2024-11-13 17:48:11.138 DEBUG (MainThread) [custom_components.nissan_connect.coordinator] Finished fetching Statistics Coordinator data in 1.919 seconds (success: True)
2024-11-13 18:03:02.678 WARNING (MainThread) [custom_components.nissan_connect.coordinator] Error communicating with API
2024-11-13 18:03:02.678 DEBUG (MainThread) [custom_components.nissan_connect.coordinator] Finished fetching Update Coordinator data in 0.636 seconds (success: True)
Home Assistant Version
Core
2024.11.1
Supervisor
2024.11.2
Operating System
13.2
Frontend
20241106.2
Integration Version
v0.7.0
Additional context
polling interval = 60
polling interval while charging = 15
update interval = 15
update interval for stats = 60
The text was updated successfully, but these errors were encountered: