glynhudson / leaf-python-mqtt

Extract data from Nissan Leaf API and post to mqtt
Apache License 2.0
24 stars 7 forks source link

Issues receiving values for 2015 leaf #8

Closed jumpingmushroom closed 6 years ago

jumpingmushroom commented 6 years ago

Hi!

First off, great work in buidling a script that integrates with mqtt. Just the kind of home automation i enjoy! Now for the problem.

INFO:root:Startup leaf-python-MQTT: 2018-03-11 13:35:08 INFO:root:Loaded config file /home/username/leaf-python-mqtt/config.ini INFO:root:updating data from API every 15min INFO:root:Prepare Session INFO:root:Login... INFO:root:Start update time: 2018-03-11 13:35:08 INFO:root:Connected to MQTT host mqttserver with result code 0 INFO:root:Suscribing to leaf control topic: leaf/control INFO:root:Publishing to leaf status topic: leaf/status INFO:root:get_latest_battery_status Traceback (most recent call last): File "./leaf-python-mqtt.py", line 220, in get_leaf_status() File "./leaf-python-mqtt.py", line 161, in get_leaf_status leaf_info = l.get_latest_battery_status() File "/usr/local/lib/python2.7/dist-packages/pycarwings2/pycarwings2.py", line 372, in get_latest_battery_status return CarwingsLatestBatteryStatusResponse(response) File "/usr/local/lib/python2.7/dist-packages/pycarwings2/responses.py", line 514, in init bs = recs["BatteryStatus"] TypeError: list indices must be integers, not str

I have configured everything correctly it seems, as the work on getting values start (it didn't earlier as i did the same error as some others, using the mail adress instead of username for login), but it seems to me the output values we receive is strings and not ints.

Hope you could help shed some light on what might be causing this.

glynhudson commented 6 years ago

I'm not able to re-create the issue. I think the issue is to do with the pycarwings2 library.

Try running pycarwings2/examples/get-leaf-info.py

I don't think the issue is with my MQTT wrapper

glynhudson commented 6 years ago

Same issue here https://github.com/jdhorne/pycarwings2/issues/34