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

LeafSession: NoSuchMethodError: The method '[]' was called on null. #72

Open
JulienLivet opened this issue Feb 20, 2024 · 2 comments
Open
Assignees

Comments

@JulienLivet
Copy link

JulienLivet commented Feb 20, 2024

hi

LEAF_USERNAME: [email protected]
LEAF_PASSWORD: "password"
LEAF_TYPE: newerThanMay2019
MQTT_HOST: 192.168.1.104
MQTT_PORT: 1883
MQTT_USERNAME: mqttuser
MQTT_PASSWORD: paswword
MQTT_BASE_TOPIC: leaf
UPDATE_INTERVAL_MINUTES: 45
CHARGING_UPDATE_INTERVAL_MINUTES: 10
COMMAND_ATTEMPTS: 3
LOG_LEVEL: All

I'm using the add-on for Home Assistant. I have latitude, longitude, mileage, and temperature. I don't have any other information, and I have the following error in the logs.

FINE: 2024-02-20 02:32:59.393866: LeafSession: NoSuchMethodError: The method '[]' was called on null.
Receiver: null
Tried calling: []("realm")
FINER: 2024-02-20 02:32:59.393936: LeafSession: #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:38)
#1      _objectNoSuchMethod (dart:core-patch/object_patch.dart:85)
#2      NissanConnectSession.login (package:dartnissanconnect/src/nissanconnect_session.dart:299)
<asynchronous suspension>
#3      NissanConnectSessionWrapper.login (file:///app/src/leaf/nissan_connect_wrapper.dart:21)
<asynchronous suspension>
#4      LeafSession._executeWithRetry (file:///app/src/leaf/leaf_session.dart:146)
<asynchronous suspension>
#5      LeafSession.executeWithRetry (file:///app/src/leaf/leaf_session.dart:129)
<asynchronous suspension>
#6      Future.wait.<anonymous closure> (dart:async/future.dart:522)
<asynchronous suspension>

FINEST: 2024-02-20 02:32:59.393943: LeafSession: Executing
FINE: 2024-02-20 02:32:59.760658: LeafSession: RangeError (length): Invalid value: Not in inclusive range 0..3: 4
FINER: 2024-02-20 02:32:59.760711: LeafSession: #0      new NissanConnectBattery (package:dartnissanconnect/src/nissanconnect_battery.dart)
#1      NissanConnectVehicle.requestBatteryStatus (package:dartnissanconnect/src/nissanconnect_vehicle.dart:53)
<asynchronous suspension>
#2      NissanConnectVehicleWrapper.fetchBatteryStatus (file:///app/src/leaf/nissan_connect_wrapper.dart:69)
<asynchronous suspension>
#3      LeafSession._executeWithRetry (file:///app/src/leaf/leaf_session.dart:153)
<asynchronous suspension>
#4      LeafSession.executeWithRetry (file:///app/src/leaf/leaf_session.dart:129)
<asynchronous suspension>
#5      Future.wait.<anonymous closure> (dart:async/future.dart:522)
<asynchronous suspension>

FINE: 2024-02-20 02:32:59.760731: LeafSession: Exception: Execution failed.
FINER: 2024-02-20 02:32:59.760743: LeafSession: #0      LeafSession._executeWithRetry (file:///app/src/leaf/leaf_session.dart:161)
<asynchronous suspension>
#1      LeafSession.executeWithRetry (file:///app/src/leaf/leaf_session.dart:129)
<asynchronous suspension>
#2      Future.wait.<anonymous closure> (dart:async/future.dart:522)
<asynchronous suspension>

WARNING: 2024-02-20 02:32:59.760752: main: Could not execute request.
FINEST: 2024-02-20 02:32:59.760758: MqttClientWrapper: Publishing message lastErrorDateTimeUtc 2024-02-20T01:32:59.760755Z
FINEST: 2024-02-20 02:32:59.760999: MqttClientWrapper: Publishing message {vin}/lastErrorDateTimeUtc 2024-02-20T01:32:59.760755Z

`thx :)`
@JulienLivet
Copy link
Author

Hello, it works without any adjustments.
No more trace of that error.
It seems like using the vehicle might have resolved the issue, but I'm not entirely sure.

@compuguy
Copy link

compuguy commented Feb 22, 2024

Hello, it works without any adjustments. No more trace of that error. It seems like using the vehicle might have resolved the issue, but I'm not entirely sure.

Odd, I'm having a similar issue I think @JulienLivet...

WARNING: 2024-02-22 18:31:53.618286: main: An error occured while logging in. Please make sure you have selected the right LEAF_TYPE, LEAF_USERNAME and LEAF_PASSWORD. Retrying in 5 seconds.
FINE: 2024-02-22 18:31:53.618561: main: NoSuchMethodError: The method '[]' was called on null.
Receiver: null
Tried calling: []("realm")
FINE: 2024-02-22 18:31:53.618815: main: #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:38)
#1      _objectNoSuchMethod (dart:core-patch/object_patch.dart:85)
#2      NissanConnectSession.login (package:dartnissanconnect/src/nissanconnect_session.dart:299)
<asynchronous suspension>
#3      NissanConnectSessionWrapper.login (file:///app/src/leaf/nissan_connect_wrapper.dart:21)
<asynchronous suspension>
#4      _login (file:///app/src/leaf_2_mqtt.dart:87)
<asynchronous suspension>
#5      main (file:///app/src/leaf_2_mqtt.dart:63)
<asynchronous suspension>

WARNING: 2024-02-22 18:31:53.618878: main: Could not execute request.
FINEST: 2024-02-22 18:31:53.618955: MqttClientWrapper: Publishing message lastErrorDateTimeUtc 2024-02-22T23:31:53.618937Z

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

No branches or pull requests

3 participants