I get those as well… when that happens normally for me things are working.
Try to scan on the addon a few times. it might be that insisting will work.
But my expectation is that when you press scan on the addon a bunch of messages show on the gateway
the only thing I could do is add a fingerprint ID
cannot add card or passcode
operation failed
also when I try to unpair, it does not allow me to unpair
so far you have been amazingly helpful … I appreciate your help
I have been trying to get this to work for a while. I have to use the gateway option as my HA install is in a VM. Therefore I have built a gateway on a RPI as per the instructions above.
However I cannot get the lock to appear in the Add In.
Replying to my own message, running the debug options I see this error:
uncaughtException catch: unhandledRejection
TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Timeout'
| property '_idlePrev' -> object with constructor 'TimersList'
--- property '_idleNext' closes the circle
at JSON.stringify (<anonymous>)
at TTLock.toJSON (/app/node_modules/ttlock-sdk-js/dist/device/TTLock.js:1340:25)
at Manager._onFoundLock (/app/src/manager.js:695:50)
at TTLockClient.emit (node:events:519:28)
at TTLockClient.onScanResult (/app/node_modules/ttlock-sdk-js/dist/TTLockClient.js:163:22)
at BluetoothLeService.emit (node:events:519:28)
at BluetoothLeService.onDiscover (/app/node_modules/ttlock-sdk-js/dist/scanner/BluetoothLeService.js:52:18)
at NobleScannerWebsocket.emit (node:events:519:28)
at NobleScannerWebsocket.onNobleDiscover (/app/node_modules/ttlock-sdk-js/dist/scanner/noble/NobleScanner.js:100:22)
at Noble.emit (node:events:519:28)
It certainly looks like you are almost there if you’re seeing startScan/ discover /stopScan messages.
Has the lock been RESET? My understanding is that the lock only appears if it is completely free of any previous pair connection. In other words you have to RESET it with the ‘reset button procedure’.
In my case (yours might be different, not sure what type of lock you have) I hit the reset button inside the battery compartment for 5s and then had to enter admin code ‘000#’ to complete the RESET process.
My lock has a ‘speaker’ so it prompts me during this process for the admin code.
Once a lock has been reset (is no longer linked to any previous gateway/phone), touching the pin pad results in a prompt via speaker to “start Bluetooth administration’ or something like that. This is essentially saying the lock is now in pairing mode. It does not last that long so you need to be setup ready to pair from the Homeassistant Addon.
I found this last step was a bit difficult (hit/miss) due timing. reset procedure etc.
For the lock to initially appear in the HA ADDon (first time) to be paired , I think it has to have been reset (ie free of any connection to previous pair bluetooth connections). So I think the Gateway Bluetooth Scan has to discover a ‘new’ lock. (New like fresh out of the box)
Once the Gateway finds a ‘new’ lock it will present in HA addon with a PAIR option. This is the first milestone . . but don’t be tempted to hit that HA Addon PAIR option yet! The lock must be put into pair mode just before you attempt the HA Addon PAIR operation.
So for me, once the lock appeared in HA Addon ready to be paired . . .
I touched the lock keypad, heard the speaker say ‘start Bluetooth Admin’, then quickly hit the HA Addon PAIR button. If successful the lock responds via speaker ’ was successful’ or similar.
Thanks for the tips. The lock I have is 5B01, it doesn’t have a keypad, just fobs, I haven’t worked out how to reset it, there are no obvious buttons.
I have never seen the lock appear in the addon. I wasn’t completely sure what was supposed to happen there as there are no screenshots of that process anywhere that I could find.
I did download the TTLOCK app, which will see the lock, although I didn’t pair it. If I can’t see how to reset the lock on the device, it will have to be paired and then reset with the app.
I bought a Lock, it shows as type “RXDQ” in the app.
Unfortunately i cannot get anything in the HA add-on.
When i look at the add-on log, after pressing the pair button, i see nothing at al happening. i just see
Loading log…
> [email protected] start
> node ./index.js
[Error: ENOENT: no such file or directory, access '/data/lockData.json'] {
errno: -2,
code: 'ENOENT',
syscall: 'access',
path: '/data/lockData.json'
}
[Error: ENOENT: no such file or directory, access '/data/aliasData.json'] {
errno: -2,
code: 'ENOENT',
syscall: 'access',
path: '/data/aliasData.json'
}
MQTT connected
Server started
should it not at least show something about it starting to look for locks or anything indicating the pairing proces is started?
Im on a rasp Pi4 with the standard HAOS and standard bluetooth of the Pi. it should work without any settings in gateway configuration right?
too bad this add-on has been dead for some years now and it seems nobody is able to continue work on it…
also now tried with the ESP32 as BT host, after a dificult instal process got that running and connected, but still i see no activity at all when pressing the pair button, just a silent log…
I presume you are seeing something like this in the HA Addon
Is it this PAIR button you are referring to?
If Yes, the lock must be in PAIR mode BEFORE you press this button.
This was very confusing for me (and others) at first. The image is presented by the Addon if it finds a lock/device that is lonely and has not made any friends (is an orphan). It does not mean it is ready to be paired.
The integration ‘PAIR’ image above should probably say ‘I found this lock in BlueTooth range and it is not associated with any app or server, if you want to integrate it into HA, first put it in PAIR mode, THEN hit this PAIR button’
On my lock (there are many different TTLOCKs out there) when the physical lock is put in PAIR mode it ‘speaks to me’ (via a small in built speaker). It says ‘please enter bluetooth administrator’. When I hear this, I quickly tap the HA Addon PAIR button and a few seconds later the lock speaks ‘adding administrator successful’
Hope this helps a bit in your TTLock integration quest.
I was actually referring to this button on the far right. its the only button i see…
I suppose this is the button that should start the BLE scan?
Could it be that because this add-on is so old the command to start the scan just doesnt work in HA’s current state? maybe a way to start the scan another way?
i have been able to enter the add-on’s container with CLI but thats where my knowledge really stops… i have no idea what command i could run to start the scanning process
So this means that the lock has yet to be ‘found’ by the HA Addon. This could be for a few reasons. So my next question is …
Is the lock completely free of any previous pair operation, ie it has to be in what I call orphan mode. If the lock was previously paired with a phone app? , it must be reset to essentially a clear state. You can only link the lock with one paired app/addon at a time. During a pair process a set of digital code/keys are exchanged. Once those codes are created the lock will only respond to an app or HA Addon with those codes.
On my lock, I perform a reset by a ‘long press’ of a button on the inside battery compartment. Once this is done the HA Addon will see the orphaned lock and present an image like the one I shared above.
Once HA Addon presents the basic lock details and an offer to PAIR, before you hit that pair button, you must put the lock into pair mode. On my lock that is done by touching the lock keypad when it is in orphan mode. Does your lock instructions detail how to reset and how to put the lock in pair mode?
thanks, yes its completely reset, it has the speaker telling me to “please add a bluetooth administrator” when i touch any button on the lock.
So the “scan” button of the add-on has no indication that it is actually scanning? or is the add-on constantly scanning? I have seen screenshots here where it says in the logs something like “BLE scan started”. but i never see this.
anyway, i have never seen anything pop up in the add-on screen, nor any activity in the logs…
have you ever been able to get yours working? im at the exact same point now.
As soon as i activate the locks bluetooth a similar error pops up in the log for me. the lock never shows up in the add-on.
BLE Scan started
uncaughtException catch: unhandledRejection
TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Noble'
| property '_peripherals' -> object with constructor 'Object'
| property '2f6bb1312fe5' -> object with constructor 'Peripheral'
--- property '_noble' closes the circle
at JSON.stringify (<anonymous>)
at TTLock.toJSON (/app/node_modules/ttlock-sdk-js/dist/device/TTLock.js:1340:25)
at Manager._onFoundLock (/app/src/manager.js:695:50)
at TTLockClient.emit (node:events:518:28)
at TTLockClient.onScanResult (/app/node_modules/ttlock-sdk-js/dist/TTLockClient.js:163:22)
at BluetoothLeService.emit (node:events:518:28)
at BluetoothLeService.onDiscover (/app/node_modules/ttlock-sdk-js/dist/scanner/BluetoothLeService.js:52:18)
at NobleScannerWebsocket.emit (node:events:518:28)
at NobleScannerWebsocket.onNobleDiscover (/app/node_modules/ttlock-sdk-js/dist/scanner/noble/NobleScanner.js:100:22)
at Noble.emit (node:events:518:28)
Hello, could you please tell me how to correctly send BLE commands to TTLock? What do they look like in plain text, in what format should they be encoded, and through which GATT characteristics should they be transmitted? At the moment, I am specifically interested in pairing with the lock.