homebridge-fordpass icon indicating copy to clipboard operation
homebridge-fordpass copied to clipboard

[Bug]: Lock notification spam

Open shad0wca7 opened this issue 3 years ago • 22 comments

Describe the bug

Things might be quiet for a day or two and then I'll get hit with tens of notifications at the same time about the vehicle being locked / unlocked (and bouncing between the two). I've gone to the point of disabling lock notifications within the home application but I wonder if it's something I'm doing wrong?

Debug Output

Frequently see 'EAI_AGAIN' in the logs

Steps to reproduce

  1. Follow instructions in the setup - use normally.

Device Type

Intel Xeon server

iOS Version

15

Bug Persistence

Consistently

Last Working Version

No response

shad0wca7 avatar Oct 04 '21 15:10 shad0wca7

Are you using the auto refresh feature? This may resolve your issue. Without this, the Ford API uses cached data that may not always be up-to-date.

Brandawg93 avatar Oct 06 '21 12:10 Brandawg93

I turned on the auto refresh feature (wasn't using it) but I'm still seeing this in the logs: [10/8/2021, 9:53:14 AM] [homebridge-fordpass] Status failed with error: EAI_AGAIN

shad0wca7 avatar Oct 08 '21 14:10 shad0wca7

Here's some info I found on EAI_AGAIN. It looks to be a DNS issue.

Brandawg93 avatar Oct 08 '21 15:10 Brandawg93

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 3 days

github-actions[bot] avatar Oct 23 '21 00:10 github-actions[bot]

Here's some info I found on EAI_AGAIN. It looks to be a DNS issue.

hm that's odd - shouldn't be any DNS issues unless it's calling to something that's being blocked by my DNS ad blocking - though I can't see anything in the logs

shad0wca7 avatar Oct 24 '21 23:10 shad0wca7

I am seeing this as well. Several times a day I get a lock or unlock notification. I can correlate the "real" events, but the middle of the night - and even this AM - just did not happen. I have disabled the plug-in for now as it was driving my wife crazy.

JeffGoldner avatar Nov 02 '21 16:11 JeffGoldner

I tried to set this up in the past but was frustrated with the inaccurate lock/unlock indicator. I gave it another try today and from what I can see, when issuing commands to lock and unlock my vehicle, it is working. When I lock my vehicle, it indeed locks, but then within 30 seconds or so, HomeKit shouts that the vehicle is unlocked.

I really want this to work, but the uncertainty of whether my vehicle is really locked is making it hard to keep the plugin enabled. How can I help test/debug this?

iamkhris avatar Nov 03 '21 23:11 iamkhris

The issue is with how Ford built their API. It uses cached data instead of live data to determine the state of the vehicle. So if you lock your vehicle and then get its state some time later, it may be inaccurate. You cannot see the state of the vehicle in the official fordpass app either because of this issue. I've tried to circumvent this in the plugin by adding the refresh ability, but this can potentially drain your vehicle's battery.

Brandawg93 avatar Nov 04 '21 00:11 Brandawg93

Thanks for the info and explanation. Forgive me if my questions have already been asked at some point along the way.

Is it possible to have Homebridge "assume" that if I used it to lock the doors, it should continue showing the doors are locked for at least X minutes before refreshing? This may be the way you've designed the refresh, but from what I saw earlier when I was testing it, the doors would always go unlocked a short time after locking them through Homebridge.

When the data is pulled from the Ford API, is it timestamped at all as to when it was last pulled? I assume no, but if it was, you could then look at the state of the data at the timestamp from Ford and compare it with the Homebridge version. If Ford is showing the vehicle unlocked at 2pm and Homebridge is showing the vehicle locked at 2:30pm, with it now being 4pm, I would assume the doors are still locked.

Forgive my ramblings as I honestly have no idea how the actual Ford API works, and am just thinking/wishing out loud. lol Thanks for your effort on this. :)

iamkhris avatar Nov 04 '21 01:11 iamkhris

I spent a decent amount of time looking into this and actually spoke with one of the developers of the fordpass app. They have some great features coming to the app in the future, but these issues that this plugin is facing is what they are trying to resolve now. It's "kill the battery and have up-to-date info" or "have stale info with a working vehicle" 😜

Hopefully Ford will have a proper solution soon to this.

Brandawg93 avatar Nov 04 '21 20:11 Brandawg93

Thanks Brandon. I appreciate you taking the time to respond.

Given those choices, I GUESS I'll take stale info and a working vehicle! lol 🤣

Have a great day!

iamkhris avatar Nov 05 '21 15:11 iamkhris

Are you using the auto refresh feature? This may resolve your issue. Without this, the Ford API uses cached data that may not always be up-to-date.

@Brandawg93 Hello can you explain me what exactly I have to enter in the config so that I can use the auto refresh feature? Thank you!

Razeeer avatar Nov 15 '21 05:11 Razeeer

You can add autoRefresh: true to your config to have it refresh automatically.

Brandawg93 avatar Nov 15 '21 14:11 Brandawg93

Thanks for the answer. Can you tell me exactly where it needs to go in config to make it work?

"platforms": [ { "platform": "FordPass", "username": "", }, "password": "", "vehicles": [ { "name": "", "vin": "" } ] } ] }

Razeeer avatar Nov 15 '21 14:11 Razeeer

Under the fordpass "platform" add an "options" object with the above line in it.

Brandawg93 avatar Nov 15 '21 14:11 Brandawg93

Would be great if you could include it in my config or in the example config of the plugin. I'm there not so experienced in config.json edit.

🙏 Thanks

Razeeer avatar Nov 15 '21 14:11 Razeeer

No problem. Unfortunately, I'm on a phone since I'm out of town, but I'll be able to add it when I get to a computer. The settings UI should guide you through it depending on if you are using HOOBS or Homebridge.

Brandawg93 avatar Nov 15 '21 14:11 Brandawg93

That would be really great if you can make an example later. Thanks!

Razeeer avatar Nov 15 '21 17:11 Razeeer

I've added an example to the README. Here it is:

{
    "username": "YOUR_USERNAME",
    "password": "YOUR_PASSWORD",
    "vehicles": [
        {
            "name": "VEHICLE NAME",
            "vin": "YOUR_VIN"
        }
    ],
    "options": {
        "autoRefresh": false
    },
    "platform": "FordPass"
}

You would just need to replace false with true.

Brandawg93 avatar Nov 16 '21 14:11 Brandawg93

Super many thanks!

Razeeer avatar Nov 17 '21 04:11 Razeeer

I experienced this issue as well and I think I finally understand that is starts occuring after FordPass has determined the vehicle has been idle for a certain amount of time and disables the API. From my experience, the status then reports as default Unlocked, Off. I do not think the auto-refresh fixes this as the disabling of the API is not client side. Once I start my truck with the key, the API is re-enabled and status reports correctly.

HAKrofft avatar Jan 10 '22 15:01 HAKrofft

I experienced this issue as well and I think I finally understand that is starts occuring after FordPass has determined the vehicle has been idle for a certain amount of time and disables the API. From my experience, the status then reports as default Unlocked, Off. I do not think the auto-refresh fixes this as the disabling of the API is not client side. Once I start my truck with the key, the API is re-enabled and status reports correctly.

I think your right; I get the MOST spam about Lock/Unlock after my truck has set several days. I know after two weeks the ford app will send me a notification saying truck has been put to "deep sleep" or something to that effect and the lock spamming seems to stop.

blaine07 avatar Apr 25 '22 20:04 blaine07