xraver / mercedes_me_api

Script to use Mercedes Me APIs.
MIT License
57 stars 14 forks source link

Entities loaded once, but doesnt get updated with data #23

Open ehallq opened 3 years ago

ehallq commented 3 years ago

Not sure if i have configured anything wrong. But right now I get all the entities for my car. I have set scan_interval to 30. But the entities never gets updated with a state and I don't see any errors in the log. Basically last update was when I restarted home assistant, but all entites has "Unknown" as status. I know this is expected for some values like XXX_rangeelectric since my car is a E200d, but all my entites are missing data

xraver commented 3 years ago

Dear, Try to put 120. When I try to update with bash script I can see that usually it takes 50 seconds to update all entities.

If you have chance also try to set debug log for this integration and share with me the logs. Thanks

ehallq commented 3 years ago

120 didnt help, I can see that it is running the update script, but nothing gets updated

2021-01-05 11:39:35 DEBUG (SyncWorker_0) [custom_components.mercedesmeapi] Start Update Resources 2021-01-05 11:41:27 DEBUG (SyncWorker_0) [custom_components.mercedesmeapi] End Update 2021-01-05 11:41:35 DEBUG (SyncWorker_0) [custom_components.mercedesmeapi] Start Update Resources 2021-01-05 11:43:04 DEBUG (SyncWorker_0) [custom_components.mercedesmeapi] End Update 2021-01-05 11:43:35 DEBUG (SyncWorker_4) [custom_components.mercedesmeapi] Start Update Resources 2021-01-05 11:45:34 DEBUG (SyncWorker_4) [custom_components.mercedesmeapi] End Update 2021-01-05 11:45:35 DEBUG (SyncWorker_0) [custom_components.mercedesmeapi] Start Update Resources 2021-01-05 11:47:28 DEBUG (SyncWorker_0) [custom_components.mercedesmeapi] End Update 2021-01-05 11:47:35 DEBUG (SyncWorker_7) [custom_components.mercedesmeapi] Start Update Resources 2021-01-05 11:49:21 DEBUG (SyncWorker_7) [custom_components.mercedesmeapi] End Update 2021-01-05 11:49:35 DEBUG (SyncWorker_6) [custom_components.mercedesmeapi] Start Update Resources

Image of all my sensors https://imgur.com/CdbpSE2.jpg

xraver commented 3 years ago

Interesting. the script working well. but no way to receive data. I have to understand better what is happening. Have you tried to use the standalone python script or bash?

thanks

ehallq commented 3 years ago

I have used the standalone python script to get the token only

edit: oh didnt see the status command. I will try that, will attach result in a minute edit2: So I ran it and made it write everything to the resource file. and this is what I get for every item basically. The same can be seen in HA {"name": "rangeliquid", "vin": "XXX", "version": "1.0", "href": "/vehicles/XXX/resources/rangeliquid", "state": null, "timestamp": null, "valid": false}

apfelflo89 commented 3 years ago

For me 0.10 broke my sensors, rolling back to 0.9 fixes it again. Getting no error within home assistant, just sensor value "unknown"

ehallq commented 3 years ago

I think it is related to https://github.com/xraver/mercedes_me_api/issues/15 I unlocked and locked my car with the app, causing some statuses to update. Now I got values for the lock related sensors

danielrheinbay commented 3 years ago

If it is related to #15, setting enable_resources_file: True may help.

apfelflo89 commented 3 years ago

enable_resources_file: True was indeed helping. Thank you

apfelflo89 commented 3 years ago

OK actually it didn't. With enable_resources_file: True the sensors are populated with data when Home Assistant is starting but it never gets updated as far as I tested. So far I´m back again on 0.9