HomeKit and Siri integration

Thanks everyone for this Apple integration :wink:

I added Gladys to my Home app, but due to a mistake I deleted the Gladys hub.
And as soon as I try to re-add it with the QR code provided by Gladys, it tells me the hub already exists and needs to be reset.
But I can’t find how to do that :wink:

I’ve searched a bit on the web, but I can’t find anything


Could you help me please?

During testing, we had this problem but I thought it had been fixed.
If you’re comfortable with the command line, I can give you the procedure tonight.
Otherwise, I’ll create an issue and we’ll have to wait for the fix.

The command line doesn’t particularly scare me lol

Within reason lol

I’d be interested in your technique, just in case. Thanks

Procedure to reset the HomeKit connection:

  • ssh pi@gladys.local (ssh to your Raspberry Pi via IP or local domain)
  • docker exec -it gladys /bin/sh (connect to the Gladys container)
  • sqlite3 /var/lib/gladysassistant/gladys-production.db (start sqlite3 on the Gladys database)
  • DELETE FROM t_variable WHERE name LIKE 'HOMEKIT_%'; (delete variables related to HomeKit)
  • .quit (Quit sqlite3)
  • Ctrl D (Exit the Gladys container)
  • docker restart gladys (Restart the Gladys container to reinitialize HomeKit)

If that works, I’ll open an issue to fix this problem

1 Like

A genius!!!

Thank you very much, it works! I’ll keep these commands as a note — they can definitely come in handy!!

3 Likes

Indeed, you had pointed it out to me, but the reset button hasn’t been implemented yet — I’ll look into it again. In the meantime, your database solution is the simplest.

2 Likes

Hi @cicoub13, on the code side we’re all set for this PR regarding contact sensors and near real-time value updates in the Home app. I believe there was a slight optimization fix since your last test — could I please ask you for one final test with the image I just created for you? You’ll find it as usual with the tag bertrandda/gladys:homekit

Hello. Thank you. I’m testing this week (probably Friday)

1 Like

The latest contribution from @bertrandda is available in Gladys Assistant 4.23 ! ( Streaming de caméra live dans Gladys Assistant 4.23 | Gladys Assistant )

Thank you for the contribution :folded_hands:

1 Like

The PR to reset the HomeKit bridge from the integration’s configuration page

This should simplify the procedure that @cicoub13 described a little earlier.

For those who want to test, a Docker test image is available bertrandda/gladys:homekit

1 Like

Tested this morning with two scenarios:

  • removal of the bridge in Home on iPad, reset on Gladys then adding the bridge. Everything works :white_check_mark:
  • reset on Gladys, then removing/adding the bridge in Home on iPad. Everything works :white_check_mark:

Thanks :muscle:

2 Likes

This feature is available in Gladys Assistant 4.25, thanks to @bertrandda for development and @cicoub13 for testing!

2 Likes

New PR to simplify adding future devices to the integration; I took the opportunity to add humidity and water leak sensors. If anyone wants to test, the image bertrandda/gladys:homekit is up to date.

The PR: Add leak & humidity sensor for HomeKit by bertrandda · Pull Request #1835 · GladysAssistant/Gladys · GitHub

1 Like

Hi everyone,

Have there been any testers on @bertrandda’s latest PR? :slight_smile:

Hi everyone, quick follow-up now that we’re back — has anyone tested this integration? :slight_smile:

@bertrandda Can you confirm you haven’t actually tested this PR? If you need me to send you hardware to run tests, don’t hesitate!

I can pay for, for example:

Hi Pierre-Gilles,

I’ve tested with virtual devices in my dev environment. On my real Gladys instance I have water leak sensors. I’d like to run zigbee2mqtt in my dev environment but I don’t really know how to do it since the dev environment is started via the CLI while zigbee2mqtt needs (I think) Gladys running in Docker to start and communicate. Any idea to help me?

At the moment that’s not possible, but there’s a PR from Alex that I had started to pick up (before working on the « Alarm Â» feature) which allows connecting Gladys to an external Zigbee2mqtt. After, for now it’s not live, it’s just a PR!

If you’ve already tested with virtual devices

Yes, if you want you can merge the PR, @cicoub13 will take care of adding the motion sensor in another PR

1 Like

It’s merged, thanks for the PR! :folded_hands:

Some info about updates related to the HomeKit service

I just proposed a fix for devices that have the same functionality multiple times (like power strips, for example)

If you want to test, the image bertrandda/gladys:homekit is available.

The hap-nodejs library that replicates the protocol used by HomeKit was released as 1.0, which brings very good changes including one to greatly reduce interactions and network congestion. Unfortunately, for now I can’t get it to work; it will require more work and I updated to the version just before the stable one, 0.12

3 Likes