[ST Edge] Smartthings Alarm.com Integration

Yeah. I tried that. No luck.

Now, I tried starting over completely. Re-flashed Pi. Followed instructions in readme. Uninstalled and re-installed driver. However, the app is not finding the Alarm.com device when I scan for nearby devices. Any suggestions?

I am trying a new approach for the proxyā€¦ Try this oneā€¦ Just download the file and config file and run for this one. Even the config file is optional and for support of future services. No python, no docker, etc. You have to download the appropriate file for your machineā€¦

That usually means that it was unable to automatically find the proxy. In that case, I would enter the IP address of where the proxy is running manually in settingsā€¦ I also checked in one more fix to the driver to handle the error in not finding proxy better. I need to test that case more.

99% of the time this fixes issues. Thatā€™s what Iā€™ve done when the ST app device screen shows as itā€™s not connected.

yeah thatā€™s all I see. I donā€™t think itā€™s even trying to login to alarm.com. I have it setup in alarm.com where I get a push notifications for failed and successful logins.

I tried logging the request body in server.py but it wasnā€™t much help (there was obfuscated content, though).

Iā€™ve verified that I can login using the same credentials on alarm.com. I havenā€™t been asked for 2FA in a long time (and, your old integration is working fine). Any other things I can look at?

I have checked in another fix to the code - it was only looking at the first response - and if you have Hue bridges/lights in the house they respond to ALL requests and create ā€œnoiseā€ā€¦ So I am now looking through all responses to see if one of them is the proxy. Hopefully this is more resilient to Hue lamp homes.

1 Like

There is a line commented out that will also log the header and the bodyā€¦

server.py:82
server.py:84

Can you uncomment them and run the server and DM me the contents (sanitized for usernames, passwords, etc.)

Typing command ā€œuname -mā€ on my rapsberry pi returns ā€œaarch64ā€ which is not listed on your GitHub architecture list. I attempted to use both the stproxy-linux-arm, and the stproxy-linux-arm64 on my pi and couldnā€™t get either to work.

I then typed in command ā€œlscpuā€ and it returned the following cpu architecture and cpu data. I have the 64bit pi os currently running on it:

Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
Vendor ID: ARM
Model: 4
Model name: Cortex-A53
Stepping: r0p4
CPU max MHz: 1200.0000
CPU min MHz: 600.0000
BogoMIPS: 38.40
L1d cache: 128 KiB
L1i cache: 128 KiB
L2 cache: 512 KiB
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Flags: fp asimd evtstrm crc32 cpuid

I can get this to work on my Windows PC, but I prefer to run it on the pi so I donā€™t encounter issues when the Windows PC updates. Any suggestions/

Thanks for all your time helping me to get this goingā€¦

aarch64 is the same as arm64ā€¦ So stproxy-linux-arm64 should work - it is interesting that it is not working. On my own rpi, I am using the stproxy-linux-armā€¦

What happens when you run either of those on your raspberry pi?

file stproxy-linux-arm64 

stproxy-linux-arm64: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=CL2AaLQaL7zmur9ObhXX/7U7vAbnru0b_wK3zC-yI/XUFUQh-_xR7m2x3o2-yt/p4d13ZZ2kUBupD7Z-mle, with debug_info, not stripped
1 Like

Thanks. I donā€™t have Hue lights so I donā€™t need to worry about that. Also, weā€™re out of town for a week, so Iā€™ll try it again when I get back.

Okay I need to come cleanā€¦ I am a total Raspberry Pi / linux rookie. My pi was given to me as a Christmas gift years ago and it was only used as a Nintendo emulator for me to play Super Nintendo games. I stole the pi from the Nintendo case, determined what version of pi i had, and totally wiped the MicroSD card with the Nintendo emulator and reinstalled a fresh install of the Pi OS. soā€¦

In the pi terminal I am sitting in the home ā€œsmartthingsā€ directory I created and copied your files into. I have typed in ā€œstproxy-linux-arm64ā€, and ā€œstproxy-linux-arm64 -d smartthingsā€, and I it keeps returning ā€œbash: stproxy-linux-arm64: command not foundā€.

What do I need to type into the terminal window to make it invoke your proxy program. Please put it into quotes for me so this rookie canā€™t screw it up. : )

Thanks

LOLā€¦ First you need the full path to where you areā€¦

pwd

will give you the full pathā€¦ Most likely something like /home/pi/smartthings/

Then you can type inā€¦

/home/pi/smartthings/stproxy-linux-arm64 -d /home/pi/smartthings

You could also do

./stproxy-linux-arm64 -d /home/pi/smartthings

but that would only work when you are exactly in that directory, whereas the prior command will work from anywhere

okay we are making progressā€¦ assuming the ā€œpiā€ in the command string is my system user name minus the ā€œ@rapsberrypiā€ (made that assumption by typing the ā€œpwdā€ command), I have tried both suggestions, the first by being at the terminal prompt as it was when I opened it, the second after navigating to my ā€œsmartthingsā€ folderā€¦ and in both cases i get ā€œbash: <the directory and / or command> Permission deniedā€. Dang!

Ah you need toā€¦

chmod +x stproxy-linux-arm64
1 Like

Bingo!

Thanks for all your help and patience. Youā€™re a Stud!

@schwark all of a sudden it started working on my Synology NAS, without me doing anything!
I see a couple recent changes to the driver code - do driver updates auto-update through Smartthings?

Okay I did it againā€¦ wanting to have a fresh install of the edge driver and the proxy, I had deleted the Alarm Panel device in Smarthings app, uninstalled the driver from the SmartThings Hub device, and unenrolled from the invite. I proceeded to setup the proxy server on the raspberrypi per your instructions above, and was successfu in doing so. Then I went back to re-enroll under the device invite and download the driver, then confirmed under the SmartThings Hub device in the app that the driver had been reinstalled and I was newly enrolled under your invite in the SmartThings Hub device. Both showed fine. When I scanned for new devices within the app I could no longer pickup the Alarm Panel device. It would just report no device found. I nothiced in pi the terminal window that it would say ā€œ[SSDP] 2022/09/20 17:40:48 failed to handle message: unexpected EOFā€ when I initiated the scan for device in the SmartThings appā€¦

I then closed down the pi and ran the proxy exectuable in Windows. The very same thing was happening. I then ensured both the pi and windows proxys were both dead and tried to get the SmartThings app to scan for the Alram.com Panel deviceā€¦ still no luck.

Bottom lineā€¦ clearing app cache, uninstalling the app and reinstalling, once again deleting the edge driver and unenrolling, and once again starting both the pi and windows proxys (not at the same time), and a ton of misc combinations of all the proceeding, there seems to be a problem that I can no longer get the Alarm.com Panel device back into my Smarthings app.

I know have already been a pain in your side because of my ingorance, but could I indulge you one more time for some help?

Thanks

Ok it turns out there are a number of things that were broken in between my adding the executable proxy and some other changes I made. Also, Smartthings seems like it gives you garbage when the username and password are not set which causes alarm.com to go into a tizzy.

Either way, I have fixed a bunch of those issues and tested adding the panel for first time with both the python and the executable proxies.

So try the latest versions of the proxy and the driver. There is a new version of the driver up now.

Before you ask, I donā€™t know if the drivers update automatically. Unenroll and reenroll should probably get you the latest driver.

1 Like

That solved my problem of SmartThings not adding back in the Alarm.com Panel device. I will play with it and hopefully everything goes well.

Thank you for all your efforts on thisā€¦ it really is appreciated.