home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.18k stars 30.57k forks source link

BMW Component not refreshing data of location and sensors after loading the first time. #13201

Closed ghost closed 6 years ago

ghost commented 6 years ago

@PeteBear commented on Mar 13, 2018, 4:48 PM UTC:

Hi, I was really pleased to see the BMW component introduced however I can not get it working reliably

I have my car set-up and the sensors read correctly once but they are not updating. not sure if i have it configured right as not sure what to put on the name line. I also have some errors showing.

No data available! 1:59 AM components/sensor/bmw_connected_drive.py (ERROR)

any help would be great I have the car responding off of the smart phone app and Alexa. The car is a 5 series GT November 2014 UK spec.

my config is

bmw_connected_drive:
  name:
    username: 'email address'
    password: 'password'
    country: UK

Interestingly the location sensor updates once I have been into the iPhone app and looked where the car is within the app.

The miles updated and so did the MPG however miles remaining is blank.

logger entries are:

2018-03-13 16:38:40 DEBUG (SyncWorker_13) [homeassistant.components.bmw_connected_drive] Updating vehicle state for account name, notifying 4 listeners
2018-03-13 16:38:40 DEBUG (SyncWorker_13) [bimmer_connected.state] requesting new data from connected drive
2018-03-13 16:38:40 DEBUG (SyncWorker_13) [bimmer_connected.account] Old token is still valid. Not getting a new one.
2018-03-13 16:38:41 DEBUG (SyncWorker_13) [bimmer_connected.state] received new data from connected drive
2018-03-13 16:38:41 DEBUG (SyncWorker_13) [homeassistant.components.sensor.bmw_connected_drive] Updating sensor.520d_remaining_fuel
2018-03-13 16:38:41 DEBUG (SyncWorker_13) [homeassistant.components.sensor.bmw_connected_drive] Updating sensor.520d_remaining_range_fuel
2018-03-13 16:38:41 ERROR (SyncWorker_13) [bimmer_connected.state] No data available!
2018-03-13 16:38:41 DEBUG (SyncWorker_13) [homeassistant.components.sensor.bmw_connected_drive] Updating sensor.520d_mileage
2018-03-13 16:38:41 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: timestamp=1520959121.8392832, level=ERROR, message=No data available!, exception=, source=components/sensor/bmw_connected_drive.py>
2018-03-13 16:38:41 DEBUG (SyncWorker_13) [homeassistant.components.device_tracker.bmw_connected_drive] Updating 520d

please contact me if I can help

This issue was moved by @fabaff from home-assistant/home-assistant.github.io/issues/4913.

gerard33 commented 6 years ago

Probably the iDrive software version of your car is not supporting automatic updates. You can check this post and this post on the forum for some more information.

m0wlheld commented 6 years ago

The data returned for my 2016 3series in Germany is partly outdated as well. The mileage ist about 6,000km behind the current state, but the scheduled services are up to date. Question is, how to trigger an update.

ChristianKuehnel commented 6 years ago

@m0wlheld It seems that the older navigation systems e.g. NBT do not send the updates automatically. I added an issue (see link above) to the bimmer_connected library to check if there is a way to poll the data from the vehicle. I think the app (and the web page) have a button somewhere, where you can get the current position of the vehicle. You could try if that also updates the data in Home Assistant.

Could you provide us your vehicle data? Then we could have a look, what your vehicle is actually returning... https://github.com/ChristianKuehnel/bimmer_connected/tree/b2vapi#data-contributions

ChristianKuehnel commented 6 years ago

@PeteBear Same for you: can you please provide use with the data for your vehicle? https://github.com/ChristianKuehnel/bimmer_connected/tree/b2vapi#data-contributions

PeteBear commented 6 years ago

Hi,

I am happy to provide the data of the car what exactly do you wish to know so I can send it all first time?

The link you gave me appears to be broken as I get an error page.

Pete

On 18 Mar 2018, at 08:16, ChristianKuehnel notifications@github.com wrote:

@PeteBear https://github.com/petebear Same for you: can you please provide use with the data for your vehicle? https://github.com/ChristianKuehnel/bimmer_connected/tree/b2vapi#data-contributions https://github.com/ChristianKuehnel/bimmer_connected/tree/b2vapi#data-contributions — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/home-assistant/home-assistant/issues/13201#issuecomment-373980433, or mute the thread https://github.com/notifications/unsubscribe-auth/Ac9kcE7xUwL8mqm28CeIyE_Q3qkGZElaks5tfhfhgaJpZM4Sp7t0.

gerard33 commented 6 years ago

@PeteBear the link has indeed changed to https://github.com/ChristianKuehnel/bimmer_connected#data-contributions.

dws199 commented 6 years ago

Hi @gerard33

I have the same issues with my BMW 5 Series F10 2014 model that has the NBT head unit. I don't have issues with the BMW android app but in Hass the tracker component seems to be constantly toggling between Home and Away, the reported mileage is too low by about 10k miles, the remaining fuel is incorrect as showing as mpg and the remaining fuel range is showing as Unknown.

I'd be happy to contribute the data from my vehicle but I'm not able to follow the guide in that link as via SSH I do not appear to have the pip3 command (via SSH), I presume this is because I'm running HASSIO? Is there some other way I can collect the info?

Thanks

Dave

gerard33 commented 6 years ago

@dws199 Strange, I have pip3 available when I SSH into my hassio server. Guess you don't have another Linux server which you can use?

And is there a refresh option in the Android app (or the website) which makes the data in HA refresh as well? Or is the data always the same?

dws199 commented 6 years ago

@gerard33 I'm using the Hassio Raspberry Pi build, isn't this a cut down version?

There is a refresh option in the app but it only seems to refresh the location of the vehicle. The other stats are refreshed very slowly, I see that today it is showing last updated 2 days ago.

gerard33 commented 6 years ago

I have a Pi running with Hassio as well and I use this SSH addon. Pip and pip3 are available when using that addon. Can you try this addon?

ChristianKuehnel commented 6 years ago

@dws199 The toggling might be caused by a known bug: https://github.com/home-assistant/home-assistant/pull/12999

Converning the mileage: That's weird. The home assistant component should show the exact same mileage as the app, as the data should be coming from the same source. Maybe it's a miles vs. kilometers issue?

If you do not have/want pip: you can also download the sources from github and unzip it: https://github.com/m1n3rva/bimmer_connected/archive/master.zip But then you might have to install the requests package manually...

dws199 commented 6 years ago

@gerard33 @ChristianKuehnel

Thanks for your help, I've now installed the community SSH addon and can see pip3 and hence have been able to run the fingerprint command which I have submitted the results of to this issue https://github.com/m1n3rva/bimmer_connected/issues/62

balloobbot commented 6 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

balloobbot commented 6 years ago

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍