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

Bug: Cannot connect to Google Home on IOS #61

Closed
Ultra-bob opened this issue Jun 23, 2024 · 32 comments
Closed

Bug: Cannot connect to Google Home on IOS #61

Ultra-bob opened this issue Jun 23, 2024 · 32 comments

Comments

@Ultra-bob
Copy link

Originally posted on the home assistant plugin repo, but it's a problem even with no plugins so posting it here
t0bst4r/matterbridge-home-assistant#93
I've set up matterbridge and all my HA devices show up, but when trying to add it to Google Home with my iPhone, it fails.
Debug logs attached (they didn't fit)
matterbridge-logs.txt

@Apollon77
Copy link

Apollon77 commented Jun 24, 2024

Hi,

I had a look at the logs:

1.) You have enabled maaaaany network interfaces. ideally try to limit to one. So many network interfaces could have unwanted side effects
2.) The log shows a successful commissioning of the first fabric for Google. So there could be a chance that it works even if google app shows an error message.
3.) Then Google wants to add the second fabric as they usually do and then it strangely calls the csrRequest command 3 times, but also acknowledges that it received the response, so noooo idea what the google hub/device has ... Please reboot hub and also mobile devcie and make sure that the "current" firmwares are on it and not updates outstanding.

Then I propose to try again, else it might be needed to report the issue to google

@Ultra-bob
Copy link
Author

How do I disable a network interface? These were all enabled by default.

@Ultra-bob
Copy link
Author

Here's my docker compose

  matterbridge:
    environment:
      HOME_ASSISTANT_URL: 'http://192.168.2.4:8123'
      HOME_ASSISTANT_ACCESS_TOKEN: "**********"
      HOME_ASSISTANT_CLIENT_CONFIG: |
        {
          "includeDomains": ["light"]
        }
    container_name: matterbridge
    image: luligu/matterbridge:latest # Matterbridge image with the latest tag
    network_mode: host # Ensures the Matter mdns works
    restart: always # Ensures the container always restarts automatically
    volumes:
      - "${HOME}/homeassistant/config/matterbridge/plugins:/root/Matterbridge" # Mounts the Matterbridge plugin directory
      - "${HOME}/homeassistant/config/matterbridge/storage:/root/.matterbridge" # Mounts the Matterbridge storage directory

@Luligu
Copy link
Owner

Luligu commented Jun 24, 2024

Hi,
concerning the pairing issue Apollon is the best expert to answer you.

Concerning Matterbridge:
[23:18:54.601] [Matterbridge] Matterbridge is out of date. Current version: 1.2.22, Latest version: 1.3.0
Why you are using a so old version ?

Current version is:

[1.3.4] - 2024-06-23

and

[1.3.2] - 2024-06-22

also updated matter.js to the latest...

@Luligu
Copy link
Owner

Luligu commented Jun 24, 2024

How do I disable a network interface? These were all enabled by default.

What machine are you running matterbridge on ?

@Ultra-bob
Copy link
Author

Ultra-bob commented Jun 24, 2024

What machine are you running matterbridge on ?

It's running on my home server (old gaming pc) through docker

Why you are using a so old version ?

These are old logs, I'm on the latest version and same issue

@Ultra-bob
Copy link
Author

Please reboot hub and also mobile devcie and make sure that the "current" firmwares are on it and not updates outstanding.

I rebooted the hub, my phone, checked that the hub has latest firmware and checked for updates on google home app. Still same issue

@EffortlessHome
Copy link

I have the same issues as @Ultra-bob. Pairing doesn't work with IOS and Google Home on latest everything. Love the project and watching this thread closely. Let me know if you want my logs too.

@Luligu
Copy link
Owner

Luligu commented Jun 25, 2024

Hi,
the log would be usefull for sure.
Apple Home is my primary controller and I can assure you that it has never ever failed to pair Matterbridge/matter.js device once.
So it can can be something specific to your setup.
Maybe with the log we will understand.

@Apollon77
Copy link

Yes Debug log please ... and make sure that your docket is correctly configured and UDP messages can flow all between the network of the Apple/Google mobile app,s pods and the matterbridge host ... no VLANs in place that could block UDP routing ...

But in fact log should show whats up ... because if you see nothing happening ion the log at all then UDP is blocked somewhere. If you see incoming traffic then we can look deeper with the log

@EffortlessHome
Copy link

Appreciate the help. I have tried to pair again with IOS and Google Home. Debug logs attached. My environment is Home Assistant running on an HA Green with the Matterbridge Addon. I don't have a HomeKit device, just several different models of Google/Nest speakers/hubs.
debug.txt

@Apollon77
Copy link

I need a bit more context for this way to short log :-)

It seems that something is connected and was reading data from 192.168.1.231 ... whats that?

Other then that I do not see any incoming traffic. (if I assume that you tried it in the shown log timeframe). What error is iOS/Google showing you? if it can not find any accessory/device then check your UDP traffic routing. The mobile apps and also the hubs need to be able to communicate with UDP with the matterbridge. So in fact "see above" ... it seems somethings blocks the UDP traffic and you also need IPv6 enabled

@Ultra-bob
Copy link
Author

Appreciate the help. I have tried to pair again with IOS and Google Home. Debug logs attached. My environment is Home Assistant running on an HA Green with the Matterbridge Addon. I don't have a HomeKit device, just several different models of Google/Nest speakers/hubs. debug.txt

When I try to pair it a second time without resetting, nothing shows in logs and there is a connection failed error, whereas on the first try there is a setup failed error and there are lots of logs. Try resetting the commissioning in the settings

@Ultra-bob
Copy link
Author

Ultra-bob commented Jun 26, 2024

Here are my updated logs and error messages
image
logs.txt

@EffortlessHome
Copy link

Sorry about that, I reset commissioning and captured the full debug log while pairing to Google Home on IOS. Regarding 192.168.1.231, that is my Alexa Show which paired easily to Matterbridge. I have IPv6 enabled and don't see any issues with UDP traffic. I get the same error as @Ultra-bob. On initial pair after recommissioning it goes through the steps fairly quickly and then fails. On subsequent pairings it hangs and after several minutes shows that error.

logs.txt

@Apollon77
Copy link

Apollon77 commented Jun 27, 2024

@Ultra-bob Ok the log shows the following:

  • fe80::1876:1879:4fa4:c87%eno1 connects and commissions correctly one fabric ... that should be the mobile device you use with Google Home app
  • then it opens the second commissioning window as normal for apple
  • then the second commissioning process runs till csrRequest and then the app sends this command 3 times and then stops.
    Reason ... unknown ... in fact the response to the request was received by the apple device

For now I can only ask to check and make sure all stuff is properly updated and please provide app and ios versions. Also I only tests with the "Apple home" being migrated to this new architecture ... no idea if there are issues with the old.
Do you maybe have a second apple mobile device to try it too?

@Apollon77
Copy link

Ok @EffortlessHome you have the same as @Ultra-bob and now I have an idea ...

You do Google on ios ... got it ... DId you added the device to your google developer console? see https://github.com/project-chip/matter.js/blob/main/docs/ECOSYSTEMS.md#google-home-ecosystem ... Please try this!
Long time this was only needed for Android ... and iOs pairing worked without it ... But the place where it fails would be reasonable for the case that they decline the "not certified status".

@Ultra-bob
Copy link
Author

I'm trying to set that up, but I don't know what to add for the product id and whatever else
image

@Ultra-bob
Copy link
Author

Ultra-bob commented Jun 27, 2024

IT WORKED!

I looked more carefully at the settings and saw every device has product id 0x800 0x8000 and set that, and then everything worked perfectly. Thanks so much for all your help @Apollon77 and @Luligu

@Apollon77
Copy link

For clarity: it is 0x8000 not 0x800 :-))

@EffortlessHome
Copy link

Thanks @Apollon77, with that value it also works for me. Can you shed any light on why that is the magic value and if this can be patched in Matterbridge to avoid this in the future?

@Apollon77
Copy link

Matter has a bid trust basis based on crypto certificates and such. Each device which was officially certified is getting an onw certificate for the Vendor (and the vendor gets a vendor Id) and then has certified devices (productIds). And everything is officially "pinned" with the certification.
There are special VendorIds and productids reserved for "devices in development and testing" and because matterbridge is no certified product is uses these test device IDs.

Formally the certificates used here are self signed and so not 100% as secure as the official devices and also not certified and so could behave wrong according to the standard. In fact each ecosysterm/Controller can not decide how to work with such test devices. Some just warn/inform and some (we had that for Aqara) block them ... Google chose a middle way with this "whitelisting in developer console".

This is in the end inconvenient for test devices.

The reality is that most likely matterbridge and other open source implementation s(also e.g. matter,js example scripts, tasmota integration) will never be certified officially and so this topic will stay. The reason is not that noone wants it to do certification, but in fact all this requires

  • being a CSA Member (costs money)
  • paying a service provider to do the certification initially ... and also when adding new features updating that!
  • paying a Certification Authority to generate device certificates per device (aka installation)
    Nothing of this will be possible for open source non-commercial projects (and also spending some coffees or spending funds will not really help here on the long run.

@EffortlessHome
Copy link

Makes sense, thanks for the detailed explanation and your assistance. Great work on this project, keep it up!

@Ultra-bob
Copy link
Author

Maybe there should be a note added to the docs so no-one else has to deal with this, but I think it's resolved now.

@Luligu
Copy link
Owner

Luligu commented Jun 28, 2024

Hi,
thank you so much.
I added a note to the readme.

@rexhoffman
Copy link

Been trying to follow the setup steps and seeing the same error. 0xfff1, 0x8000 and still no love. Left the google config in a Test mode, and logged in to the test console - getting security warnings. Don't you suppose you could write up your steps more clearly @Ultra-bob?

@Ultra-bob
Copy link
Author

Ultra-bob commented Jun 29, 2024

  1. I went to https://console.home.google.com/projects and used my existing project for controlling my nest thermostat (not sure what I did to create that project in GCP)
  2. Created a new matter device in the Develop section with the settings in my above screenshot (except product id set to 0x8000)

Not sure what you mean by test console and test mode, I stopped after the develop part and saving the default images/branding

The difference is probably with how I initially created the google cloud project when setting up my Nest thermostat, so maybe following that guide https://www.home-assistant.io/integrations/nest/#configuration will help?

@rexhoffman
Copy link

I found that I needed to "Reset Matterbridge Commissioning", to remove HomeKit integration, and then add the bridge to google home first. I could not reconnect to apple HomeKit afterwards.

@Apollon77
Copy link

I found that I needed to "Reset Matterbridge Commissioning", to remove HomeKit integration, and then add the bridge to google home first. I could not reconnect to apple HomeKit afterwards.

What do you mean? As soon as you have paired it to one controller you need to use this controller to get a second pairing code to add another ecosystem! You can not use teh same qr code again!

@Luligu
Copy link
Owner

Luligu commented Jul 1, 2024

Hi,
that's correct.
In one of the next release I will change the QR code in the frontend with the FabricInfo when the bridge/plugin is already paired and connected.
Now is actually not clear that you can use the QR only once.

@Luligu
Copy link
Owner

Luligu commented Jul 1, 2024

Please reboot hub and also mobile devcie and make sure that the "current" firmwares are on it and not updates outstanding.

I rebooted the hub, my phone, checked that the hub has latest firmware and checked for updates on google home app. Still same issue

Hi,
in the latest there is a command line parameter to limit the interfaces used for Matter advertise.
You can try to use it to limit to the main interface.

@Ultra-bob

This comment was marked as resolved.

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

5 participants