FilipDem / Domoticz-BMW-plugin

Domoticz plugin working with BMW Connected Drive
4 stars 2 forks source link

error with the 3.1 version #6

Closed tsrz closed 2 years ago

tsrz commented 2 years ago

hi, Filip,

my plugin was out of order since 3 weeks i think today, i see that you have update it, install ok but when i start it i have this error

General error TaskHandler: 'NoneType' object is not subscriptable

full log :

2021-11-23 09:54:34.348 Mini hardware started. 2021-11-23 09:54:34.348 Status: Mini: (Mini) Started. 2021-11-23 09:54:34.348 Status: Mini: (Mini) Entering work loop. 2021-11-23 09:54:41.540 Mini: (Mini) Car Cooper SE found! 2021-11-23 09:54:41.542 Mini: (Mini) Update unit 2: Mini SE - Portes - 0 - 0 2021-11-23 09:54:41.544 Mini: (Mini) Update unit 3: Mini SE - Fenêtres - 0 - 0 2021-11-23 09:54:41.549 Mini: (Mini) Update unit 10: Mini - Car - 0 - 0 2021-11-23 09:54:41.549 Mini: (Mini) Units (km) are not yet updated on device but hardcoded. 2021-11-23 09:54:41.553 Mini: (Mini) Update unit 1: Mini SE - Compteur kilométrique - 12699 - 12699 2021-11-23 09:54:41.560 Mini: (Mini) Update unit 11: Mini - km quotidien - 0 - 12699 2021-11-23 09:54:41.564 Mini: (Mini) Update unit 5: Mini - Autonomie restante mode Mid - 36 - 36 2021-11-23 09:54:41.564 Error: Mini: (Mini) General error TaskHandler: 'NoneType' object is not subscriptable 2021-11-23 09:54:44.091 Mini: (Mini) onHeartbeat called 2021-11-23 09:54:44.093 Mini: (Mini) onHeartbeat called, run again in 5 heartbeats... 2021-11-23 09:54:54.066 Mini: (Mini) onHeartbeat called 2021-11-23 09:54:54.066 Mini: (Mini) onHeartbeat called, run again in 4 heartbeats... 2021-11-23 09:55:04.087 Mini: (Mini) onHeartbeat called 2021-11-23 09:55:04.088 Mini: (Mini) onHeartbeat called, run again in 3 heartbeats...

can you help me, another time ;-)

Fred

FilipDem commented 2 years ago

First of all, sure I will help you. As BMW has not an official API, the plugin is based on reverse engineering. However it seems that BMW regularly makes changes and this change had a big impact. Therefore I decided to integrate the bimmer_connected solution directly based on threading.This has the advantage that I don't need to reverse engineer myself and we can work together to have a good python solution... We succeeded and I know that bimmer_connected tested it with quite a number of cars.

However for the integration in domoticz, I could not really rely on different cars, except mine (and it is not electric). Therefore I am glad with your message!

I think I found the problem, but are not 100% sure. I forgot to change this statement if self.myVehicle.status.remaining_range_fuel[0] != None into this if self.myVehicle.status.remaining_range_fuel != None. I did it on some lines above, but forgot this...

The code is updated (only the plugin.py changed).

I also included a test script... If there would still be a problem, you can run this and give back the output in a file. In line 293 you need to change the xxxxxxxx by your login name (email) and yyyyyyyyyy by your password. Remove the txt extension of course... And you must run it on an environment that has the bimmer_connected installed of course.

main.py.txt

tsrz commented 2 years ago

hi,

big thanks, plugin works now with the updated version. have a good day

Fred

FilipDem commented 2 years ago

Thanks for the feedback.