Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It looks like the registration at Google/Firebase for push is not always working... Not sure why. #78

Open
MrYutz opened this issue Jun 25, 2021 · 6 comments

Comments

@MrYutz
Copy link

MrYutz commented Jun 25, 2021

I would like to help test this. It looks like the original app is on the spark plan and it only allows 10K registrations per month.

Once users have cached credentials, they can re-use them. Let's see if this fixes itself at the start of the new month - July in our case.

I completed a new install, and can't get past this error. I think you may be able to replace the firebase / GCM auth keys in the code to get a round this.

I am testing.

@matijse
Copy link
Owner

matijse commented Jul 5, 2021

Thanks for testing, but yeah the FCM registration error occurs randomly but not clear why... Your theory sounds plausible, does it work now in July?

@MrYutz
Copy link
Author

MrYutz commented Jul 5, 2021

It does.

I also tested by swapping out all the credentials for a new firebase / GCM project. That worked as expected with no other code changes.

At this point, I think my theory is pretty solid. If the google firebase project gets more than 10K new auths or re-auths, it starts denying a new one. They are not included in the free plan.

Maybe the best approach is to allow creds for a new firebase project in the config file?

I'll post my test FCM test project config so you can test if you want to.

{
  "project_info": {
    "project_number": "246205401711",
    "project_id": "eufy-home-assistant",
    "storage_bucket": "eufy-home-assistant.appspot.com"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "1:246205401711:android:f0b7dfb9d37aff7c319b9a",
        "android_client_info": {
          "package_name": "com.bustedcamel.homeassistant.eufy"
        }
      },
      "oauth_client": [
        {
          "client_id": "246205401711-gbgfbdu97pbmhm7ekui7t065a7l3k5uh.apps.googleusercontent.com",
          "client_type": 1,
          "android_info": {
            "package_name": "com.bustedcamel.homeassistant.eufy",
            "certificate_hash": "f051262f9f99b638f3c76de349830638555b4a0a"
          }
        },
        {
          "client_id": "246205401711-1b11901lptlp1rk7qth8a4u6pbijtkv3.apps.googleusercontent.com",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "AIzaSyDQCrOiuWNDumMw7fSDf2Bpyhspr3b9WGo"
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": [
            {
              "client_id": "246205401711-1b11901lptlp1rk7qth8a4u6pbijtkv3.apps.googleusercontent.com",
              "client_type": 3
            }
          ]
        }
      }
    }
  ],
  "configuration_version": "1"
}

@matijse
Copy link
Owner

matijse commented Jul 7, 2021

But then you would have the credentials for the "wrong" project, and you would not get the push notifications from Eufy right? The whole script depends on these push notifications, so that won't really be a solution then...

@MrYutz
Copy link
Author

MrYutz commented Jul 7, 2021

Yeah. You're right. I was down in the weeds figuring out why the auth was failing. I was not getting push notifications, but I think that is the root issue for the GCM error.

@skrobul
Copy link

skrobul commented Nov 11, 2021

Getting PHONE_REGISTRATION_ERROR each time when trying to start the application up.
I have collected debug information in this gist - hope it helps with troubleshooting. My error message looks more like #3, but I guess it's related.

@skrobul
Copy link

skrobul commented Nov 11, 2021

btw, eufy-node-client is deprecated and the project's readme recommends using eufy-security-client instead. From brief skimming it looks like they handle FCM/GCM registration differently - is there anything that can be 'borrowed' from that code to make it work?

skrobul added a commit to skrobul/eufy-ha-mqtt-bridge that referenced this issue Nov 21, 2021
Main driver behind this change are issues with Firebase registration - see
matijse#78 for details.

Aside from different name, the main change is how the registration is handled.
Eufy-security-client's new `PushNotificationService` class handles the
registration itself if needed and emits the 'credential' event when it happens.
On our side, we just listen to this event and persist credentials to disk.

In future, we may want to stop listening to raw events and use normalized
messages provided by `PushNotificationService` instead. This would potentially
allow supporting more devices.
skrobul added a commit to skrobul/eufy-ha-mqtt-bridge that referenced this issue Nov 21, 2021
Main driver behind this change are issues with Firebase registration - see
matijse#78 for details.

Aside from different name, the main change is how the registration is handled.
Eufy-security-client's new `PushNotificationService` class handles the
registration itself if needed and emits the 'credential' event when it happens.
On our side, we just listen to this event and persist credentials to disk.

In future, we may want to stop listening to raw events and use normalized
messages provided by `PushNotificationService` instead. This would potentially
allow supporting more devices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants