This plugin has now been updated to work with the newest token and API flow for PalGate and works as of Feburary 2025.
Credit to @DonutByte for making this possible. Translation from Python to Javascript was implemented by @Knilo.
This plugin connects PalGate app-controlled systems to Apple HomeKit.
Before installing the plugin, gather the following information:
- Device ID: Found in the PalGate app under Gate > Settings.
- Phone Number: Your account’s phone number, including the country code (e.g.,
972000000000
for a 12-digit Israeli number). - Session Token: Extracted using the
pylgate
tool (see below). - Token Type: Either
0
(SMS),1
(Primary), or2
(Secondary), determined viapylgate
(see below).
Make sure you have docker
running on your machine, if you don't know how to do that, google it.
Instead of the next section manual run, you can use the attached Dockerfile
to install a docker image which will save you all the repo cloning etc, to do so run as follow:
- From the this repo main folder run
docker build -t pylgate-runner .
- To execute the extraction tool please run
docker run -it pylgate-runner
- Scan the QR code using the Device Linking > Link a Device
- The script will return an output like the following:
< SOME QR CODE WILL BE GENERATED HERE >
checking status...
updating user info...
checking derived token...
Logged-in successfully :)
Phone number (user id): <phone number>
Session token: <token>
Token type: 1 (TokenType.PRIMARY)
- Copy this info to use in the config of the plugin.
- The QR code should be scanned within your PalGate app! to do so open your PalGate app, click on the menu icon (three lines).
- From the menu select "Device linking".
- Click on
Link a device
button. - Scan the QR code generated above.
@DonutByte released a Python tool for extracting the Session Token and Token Type.
- Install the utility:
pip install git+https://github.com/DonutByte/pylgate.git@main
- Download the source code from here
- Run the extraction script:
python pylgate/examples/generate_linked_device_session_token.py
- Scan the QR code using the Device Linking > Link a Device
- The script will return an output like the following:
checking status...
pdating user info...
checking derived token...
Logged-in successfully :)
Phone number (user id): <phone number>
Session token: <token>
Token type: 1 (TokenType.PRIMARY)
- Copy this info to use in the config of the plugin.
- Open your HomeBridge UI and navigate to "Plugins" tab.
- Locate the PalGateOpener plugin and click on "Settings".
- Follow on-screen instructions, please do so after extracting the required information listed above.
"accessories": [
{
"accessory": "PalGateOpener",
"name": "<chosen name>",
"deviceId": "<device id>",
"token": "<token>,
"phoneNumber": "<phone number>",
"tokenType": <1 or 2>,
"accessoryType": "garageDoor"
}
]
key | Mandatory/Optional | Description |
---|---|---|
accessory |
Yes | Must be PalGateOpener |
name |
Yes | Chosen name to populate to HomeKit |
deviceId |
Yes | Gate ID extracted from CLI tool |
token |
Yes | Token extracted using pylgate |
phoneNumber |
Yes | Phone number for your account <972501234567> |
tokenType |
Yes | 1 (Primary) or 2 (Secondary) |
accessoryType |
No - Default usage: switch | switch/garageDoor* |
- The default accessoryType is set to
switch
, if usinggarageDoor
HomeKit with location service to open the gate automatically when arriving home will have to be initiated by user via push notification and his approval for the automation to run. This is a security feature by Apple. If you wish to "bypass" it please set theaccessortyType
asswitch
. - You CAN duplicate the accessory so you will have one button as GarageDoor button in your Apple CarPlay and a switch for the automation scene (works great BTW :))
Yes you can! just insert the block more than once with different name and with the same session token and a new deviceID and it should work just fine.
Yes! just copy the same block of the device you want to duplicate and set the accessory type from switch
to garageDoor
.
If you use the tile as garageDoor
YOU CANNOT run automations on it without approving it before run.
So if you want to have the button displayed in your Apple CarPlay but still want to run an automation that once you arrive home the gate will be opened automatically duplicate the same gate block with two different accessory types, one as switch
which you can run automation on without prompting approval for it to run and one as garageDoor
if you want to open it manually.
Yes! With the Device Linking feature, adding this plugin using Pylgate does not remove access from your phone.
Yes you can, it has nothing to do with this plugin.
This project is intended for research purpose only.
This project is not affiliated with, endorsed by, or in any way officially connected to PalGate.
The use of this software is at the user's own risk. The author(s) of this project take no responsibility and disclaim any liability for any damage, loss, or consequence resulting directly or indirectly from the use or application of this software.
Users are solely responsible for ensuring their use of this project complies with all applicable laws, regulations, and terms of service of any related platforms or services. The author(s) bear no accountability for any actions taken by users of this software.