Controlling danalock via openhab using old android phone

I should probably amend my post - with the latest zwave binding, I find that the locks work with zwave just fine. Direct Bluetooth control would be neat, but would presumably involve reverse-engineering the protocol used by the locks.

Okey, I meant maybe openhab should control locks like bridge app at Android phone, so we don’t need phone as bridge…

great idea

It works now! (Your script)
Note: Got it work with Huawei P7, Huawei P10 Lite had no luck!

Hi Dan!
I need little help: as BT connection not always works, I want to swipe locks 1-2-3-2-1, but can’t figure out the string…
Just adding new line: adb shell input swipe 300 600 750 600 500, and at the beginning changed lock count from 3 to 5 doesn’t help…

I figured this out by enabling the developer option that shows the location of fingers on the touchscreen. Then experimented sending various adb shell input swipe commands from the terminal until I found numbers that worked consistently.

The other thing to try - I haven’t yet - is installing android on a raspberry pi, which in principle is more appropriate for an “always on” system than a mobile phone.

Jep, finding coordinates is not a problem - I can’t figure out how to swipe back from last screen to first. From 1-2-3 all works, but to confirm, that it see color, I want to swipe back also…

so what happens if you enter adb shell input swipe 300 600 750 600 500 from the terminal?

Haven’t tried that, added this line to existing…
I’ll try in the evening - in theory it should swipe in revers…
But how to modify the script right direction and then also back - can’t figure out…

oh, so your problem is with the bash script logic and not with controlling the phone?

:slight_smile: yes!
If I could figure out bash script!
Tested, swipe 300 600 750 600 500 works nice, my only problem is, how to modify bash script to do that…

I don’t understand - can’t you just have another for/do/done loop which swipes back x times?

Certainly I can!
I’ll start studying the bash script tonight… Thanks!