[RELEASE] Alarm.com App

So in short, yes... That's normal, and in my experience shouldn't be an issue.

tl;dr version: Since there is no true API and I had to use the web app calls, the app is bound to the web app behavior; Which is to expire a session after 10 minutes of inactivity. Now, if you set your polling to < 10 minutes, you in theory could continue to reuse the same auth token without a problem. However, us developers are a lazy bunch, and I wrote a single routine that just goes ahead and grabs a new session for every call (because someone could set polling to > 10 minutes and I didn't feel like coding out the two scenarios).

If you're concerned about the frequency of the polling, that's why I added the preference. And if you're like me, and you almost exclusively use your HE hub for panel interaction rather than the panel itself, you can set polling to a much less frequent value without much impact.

However, my concern on polling was more specifically on the performance impact to the hub than the integrated service itself. My old hub (ST) and app polled in a similar manner, and it never caused any issues in the 2+ years I used it. So I would be surprised if my method caused any service issues.

I have my poll setting at five minutes, and I may eventually back it off to 30 so the hub isn't unnecessarily stressing to fetch a status it almost certainly already has.

** EDIT: I also forgot to mention the auth tokens have a 24 hour expiration. So coding around that as well as the polling frequency is just unnecessary complexity over simply fetching a new auth token for every call. **

Sweet!! Great to know and thank you for your professional opinion since you are the writer of the code lol.. thanks again!!

To be clear, your ST hub didn’t do any polling. It was the ST cloud that did the polling for your app.

That isn’t the case here. Frequent polling by a cloud integration has been known to bog Hubitat down.

Exactly, which is why the preference to dial it back is available.

1 Like

Oh I wasn't critiquing your method of polling or your app.

I was correcting your statement that polling didn't cause any issues on ST for the 2+ years you used it; therefore, you would be surprised if your method caused service issues.

ST and HE cannot be compared for cloud polling.

Ok, but I think I noted my concern was on the HE hub performance, and that I hadn't seen any impacts on the service itself in my 2+ years of using one that polled (regardless of its source) in a similar fashion. Unless I'm mistaken, @steelz1 was asking about the ADC service impact and not hub compute.

Either way, I think we're speaking the same language here.

You are absolutely correct.. that was my question..

Been playing with this app a few days. IMHO setting the polling to 30min or even several hours if option was available shouldn't be an issue.
Unless your having really terrible service with your ISP.
In my 10yrs with alarm.com I've never seen there service skip a beat unless I was having internet connection issues on my end. I use cellular for everything living in BFE and traveling constantly.

I have a few zwave relays set to work off arm/disarm and this app should be the key to moving them off my alarm system. In fact one controls my well and water heater. Had a pipe break last night. It kept the cleanup to a few gallons instead of ankle deep water.

1 Like

To that end, I've updated the app with additional polling options. You can now choose to poll as infrequently as every three hours.

I've altered my own to every 30 minutes, which should be sufficient enough for me.

** EDIT: I should note that I updated the option values (e.g. "30 Minutes" instead of "30") so they were easier to understand. This will, however, require you to re-submit your polling preference when you update the app. **

2 Likes

:). I had already added an option in my hub for 120 min... :).

Not sure it can be done but integration to all the sensors would be AWESOME. Although retrieving that information would probably need to be done differently.

This was the first thing I searched for when I got my Hubitat last year.

Again thanks. The arm/disarm abilities within the app really open up alot of potential for the HE.

I can see this app being a big hit.

Very cool.

Some help needed.

I installed app and drivers fine.
Switches are created and visible in DEVICES.
I can add a tile that control the switch for ARM STAY.
I can activate it and deactivate it.

However it doesn't actually work.

I tried using a new login set to LIMITED ACCESS and allowed to only view and control one device the main panel called PANEL.

I tried with both my main login and then with the new login.

Any tips?

I get this in logs:

app:5452020-06-14 10:36:29.338 pm debugADC-App.updateSwitch(): Setting null-armaway to off

app:5452020-06-14 10:36:29.313 pm debugADC-App.updateSwitch(): Setting null-disarm to off
app:5452020-06-14 10:36:29.279 pm debugADC-App.toggleOtherSwitchesTo(): Toggling all switches that are not armstay to off
app:5452020-06-14 10:36:29.276 pm errorADC ERROR (setSystemStatus): groovyx.net.http.HttpResponseException: Forbidden
app:5452020-06-14 10:36:28.905 pm debugADC-App.setSystemStatus(): Attempting to set a panel status of: armstay
app:5452020-06-14 10:36:28.901 pm debugADC-App.getSystemAuthID(): Received sessionID (hsmqzbypq05mqq5dfyn1dsju) and afg (null)

OK, I even though setting the app seems to work, I think there is a problem because the logs show this.

app:5452020-06-14 10:48:32.227 pm errorADC ERROR (getSystemStatus): groovyx.net.http.HttpResponseException: Conflict

app:5452020-06-14 10:48:31.900 pm errorADC ERROR (getPanelID:GettingPanelID): groovyx.net.http.HttpResponseException: Conflict
app:5452020-06-14 10:48:31.524 pm debugADC-App.getPanelID(): Received accountID (5374861)
app:5452020-06-14 10:48:30.704 pm debugADC-App.getSystemAuthID(): Received sessionID (jzrhd2euyjluksccflmoupc0) and afg (MkrRtfzJ92XUXkpfwha/9w==)
app:5452020-06-14 10:48:29.795 pm debugADC-App.getSystemAuthID(): Getting refreshed authentication credentials
app:5452020-06-14 10:48:29.791 pm debugADC-App.getSystemAuthID(): Received sessionID (i0rxss43dvjxuglhve2agroe) and afg (o1iQWGD1xlsRE48kBBMoqA==)
app:5452020-06-14 10:48:28.907 pm debugADC-App.getSystemAuthID(): Getting refreshed authentication credentials
app:5452020-06-14 10:48:28.874 pm debugADC-App.initialize(): Panel polling set for every 1 minute
app:5452020-06-14 10:48:28.857 pm debugADC-App.initialize(): Initializing Alarm.com Manager
app:5452020-06-14 10:48:28.844 pm errorADC ERROR (getPanelID:GettingPanelID): groovyx.net.http.HttpResponseException: Conflict
dev:352020-06-14 10:48:28.504 pm infoTERRACE TV OUTLET power is 0W
app:5452020-06-14 10:48:28.496 pm debugADC-App.getPanelID(): Received accountID (5374861)
dev:332020-06-14 10:48:28.467 pm infoTERRACE TV CABINET POWER power is 0W
dev:342020-06-14 10:48:28.323 pm infoTERRACE SOUND BAR OUTLET power is 0W
dev:342020-06-14 10:48:28.270 pm infoTERRACE SOUND BAR OUTLET power is 0W
app:5452020-06-14 10:48:27.524 pm debugADC-App.getSystemAuthID(): Received sessionID (03bn0kkkahlk5evkwgczxebw) and afg (bwmmxA+vyQYZXEORqbr/Uw==)
app:5452020-06-14 10:48:26.579 pm debugADC-App.getSystemAuthID(): Getting refreshed authentication credentials
app:5452020-06-14 10:48:26.575 pm debugADC-App.updated(): Updated with settings: [password:, disarmOff:Do Nothing, encryptPassword:true, debugMode:true, pollEvery:1 Minute, username:user..., encryptedPassword:0E6J4xd6Vlf557gwrGzj6Q==]
app:5452020-06-14 10:48:26.570 pm debugADC-App: Password encryption requested, and successfully completed

That's weird... It looks like it's failing when attempting to retrieve your panel ID, which is required for interacting with the service. Alarm.com itself is returning an HTTP response code of 409... A very uncommon one, and not typically associated with get calls.

While I normally hate the "reboot" method for resolving an issue, have you tried uninstalling/reinstalling the app? I'd recommend trying that (again), and you may have to manually delete the switches the app created, since the IDs weren't properly set.

When you create a fresh install of the app, make sure you use your "full" account. I'm wondering if your limited account was a little too limited when you first tried to install the app, it failed to pull the panel ID, and things just went south from there.

Good stuff.

Thanks.
I just tried what you recommended.

I want to add that when I log into Alarm.com, if I log into it from a new device it does a 2 factor authentication where it asked to send me a code to my mobile phone and then asks me to save the new device (more like the browser) so it will be recognized the next time.

When I deleted the app, the switches got deleted too or at least they were no longer visible in DEVICES.

I was monitoring the logs as I created the app again. Here's what they showed after I pressed DONE:

app:5462020-06-15 10:29:18.055 am errorADC ERROR (getSystemStatus): groovyx.net.http.HttpResponseException: Conflict

app:5462020-06-15 10:29:17.689 am errorADC ERROR (getPanelID:GettingPanelID): groovyx.net.http.HttpResponseException: Conflict
app:5462020-06-15 10:29:17.086 am debugADC-App.getPanelID(): Received accountID (5374861)
app:5462020-06-15 10:29:16.227 am debugADC-App.getSystemAuthID(): Received sessionID (htjkzxnrpbl3vg2kte2tqf0i) and afg (psk8ApjDLPI65JeOAoNdOg==)
app:5462020-06-15 10:29:15.362 am debugADC-App.getSystemAuthID(): Getting refreshed authentication credentials
app:5462020-06-15 10:29:15.358 am debugADC-App.getSystemAuthID(): Received sessionID (bo3vfkep24tz5nm4qimo04fb) and afg (0up4QJI/0KI+YqEVSWsyfQ==)
app:5462020-06-15 10:29:14.444 am debugADC-App.getSystemAuthID(): Getting refreshed authentication credentials
app:5462020-06-15 10:29:14.392 am debugADC-App.initialize(): Panel polling set for every 1 minute
app:5462020-06-15 10:29:14.383 am debugADC-App.initialize(): Initializing Alarm.com Manager
app:5462020-06-15 10:29:14.380 am debugADC-App.createChildDevice(): Child device null-armaway created
dev:6462020-06-15 10:29:14.347 am debugADC-Device.updated(): Switch updated
dev:6462020-06-15 10:29:14.334 am debugADC-Device.updated(): Switch installed
app:5462020-06-15 10:29:14.273 am debugADC-App.createChildDevices(): Creating child device: null-armaway
app:5462020-06-15 10:29:14.266 am debugADC-App.createChildDevice(): Child device null-armstay created
dev:6452020-06-15 10:29:14.232 am debugADC-Device.updated(): Switch updated
dev:6452020-06-15 10:29:14.219 am debugADC-Device.updated(): Switch installed
app:5462020-06-15 10:29:14.156 am debugADC-App.createChildDevices(): Creating child device: null-armstay
app:5462020-06-15 10:29:14.150 am debugADC-App.createChildDevice(): Child device null-disarm created
dev:6442020-06-15 10:29:14.099 am debugADC-Device.updated(): Switch updated
dev:6442020-06-15 10:29:14.086 am debugADC-Device.updated(): Switch installed
app:5462020-06-15 10:29:13.984 am debugADC-App.createChildDevices(): Creating child device: null-disarm
app:5462020-06-15 10:29:13.975 am errorADC ERROR (getPanelID:GettingPanelID): groovyx.net.http.HttpResponseException: Conflict
app:5462020-06-15 10:29:13.626 am debugADC-App.getPanelID(): Received accountID (5374861)
app:5462020-06-15 10:29:12.725 am debugADC-App.getSystemAuthID(): Received sessionID (ov12hydnyytbfzwdb5nkv4gj) and afg (a5cgyqtPYUsKkFFr5WkmaA==)
app:5462020-06-15 10:29:11.862 am debugADC-App.getSystemAuthID(): Getting refreshed authentication credentials
app:5462020-06-15 10:29:11.858 am debugADC-App.installed(): Installed with settings: [password:, disarmOff:Do Nothing, encryptPassword:true, debugMode:true, pollEvery:1 Minute, username:user_email, encryptedPassword:0E6J4xd6Vlf557gwrGzj6Q==]
app:5462020-06-15 10:29:11.844 am debugADC-App: Password encryption requested, and successfully completed

Ah, if you have MFA setup on your account, the ADC app won't work. Do you have the ability to disable MFA for your service account?

Maybe.
How do I set a password for my service account?
Seems I can create a user, email, but no password.

There's a section called, "Manage Logins"; Should be towards the top when you're managing users.

OK I got it, see logs at bottom. Here's what I did to get it running.

  1. Create new login within Alarm.com (Users-->Manage Logins)
  2. Set this user to Limited Device Access and then Arming setting should be the name of your panel. Mine was literally "Panel"
  3. This Login must have a unique username and email address. Hint: If you do not want to create a new email just for this, GMAIL allows your email to have additional periods and still be received. For example username@gmail.com is the same as user.name@gmail.com. You still need to set that login's password which is weirdly missing from the Alarm.com interface.
  4. Log out of Alarm.com
  5. Click on the forget password feature.
  6. Type in the unique email address you set for that login and ask to reset the password.
  7. Check your inbox for the password reset link.
  8. Use that link to reset (actually set for the very first time) the password for that new login you created.
  9. Log into Alarm.com using that new login to confirm you have access to the account at the level you set when it was created.
  10. Back to Hubitat, delete the user app for Alarm.com
  11. Add the user app again and use the LOGIN NAME and password you just verified as working. Yes, the login name is what worked for me.

app:5472020-06-15 06:25:49.568 pm debugADC-App.updateSwitch(): Setting 95337452-127-armaway to off

app:5472020-06-15 06:25:48.497 pm debugADC-App.updateSwitch(): Setting 95337452-127-armstay to off
app:5472020-06-15 06:25:47.606 pm debugADC-App.toggleOtherSwitchesTo(): Toggling all switches that are not disarm to off
app:5472020-06-15 06:25:47.601 pm debugADC-App.updateSwitch(): Setting 95337452-127-disarm to on
app:5472020-06-15 06:25:45.929 pm debugADC-App.updateHubStatus(): System status updated to: disarm
app:5472020-06-15 06:25:45.923 pm debugADC-App.getSystemStatus(): Alarm.com returned a panel status of: 1 - disarm
app:5472020-06-15 06:25:45.553 pm debugADC-App.getSystemAuthID(): Received sessionID (lgoa5cfmraakgpdbqnfbuskd) and afg (HuFBwUbhb1B6UM+qExYNKw==)
app:5472020-06-15 06:25:44.663 pm debugADC-App.getSystemAuthID(): Getting refreshed authentication credentials
app:5472020-06-15 06:25:44.609 pm debugADC-App.initialize(): Panel polling set for every 1 minute
app:5472020-06-15 06:25:44.602 pm debugADC-App.initialize(): Initializing Alarm.com Manager
app:5472020-06-15 06:25:44.594 pm debugADC-App.createChildDevice(): Child device 95337452-127-armaway created
dev:6492020-06-15 06:25:44.541 pm debugADC-Device.updated(): Switch updated
dev:6492020-06-15 06:25:44.524 pm debugADC-Device.updated(): Switch installed
app:5472020-06-15 06:25:44.458 pm debugADC-App.createChildDevices(): Creating child device: 95337452-127-armaway
app:5472020-06-15 06:25:44.453 pm debugADC-App.createChildDevice(): Child device 95337452-127-armstay created
dev:6482020-06-15 06:25:44.408 pm debugADC-Device.updated(): Switch updated
dev:6482020-06-15 06:25:44.389 pm debugADC-Device.updated(): Switch installed
app:5472020-06-15 06:25:44.309 pm debugADC-App.createChildDevices(): Creating child device: 95337452-127-armstay
app:5472020-06-15 06:25:44.304 pm debugADC-App.createChildDevice(): Child device 95337452-127-disarm created
dev:6472020-06-15 06:25:44.247 pm debugADC-Device.updated(): Switch updated
dev:6472020-06-15 06:25:44.230 pm debugADC-Device.updated(): Switch installed
app:5472020-06-15 06:25:44.079 pm debugADC-App.createChildDevices(): Creating child device: 95337452-127-disarm
app:5472020-06-15 06:25:44.071 pm debugADC-App.getPanelID(): Received panelID (95337452-127)
app:5472020-06-15 06:25:43.657 pm debugADC-App.getPanelID(): Received accountID (5374861)
app:5472020-06-15 06:25:43.010 pm debugADC-App.getSystemAuthID(): Received sessionID (22nc2jfe3mehuiiefsoorgb5) and afg (qbANF2pkqkfs2RwXn0jHHQ==)
app:5472020-06-15 06:25:42.086 pm debugADC-App.getSystemAuthID(): Getting refreshed authentication credentials
app:5472020-06-15 06:25:42.081 pm debugADC-App.installed(): Installed with settings: [password:, disarmOff:Do Nothing, encryptPassword:true, debugMode:true, pollEvery:1 Minute, username:USER, encryptedPassword:0E6J4xd6Vlf557gwrGzj6Q==]
app:5472020-06-15 06:25:42.076 pm debugADC-App: Password encryption requested, and successfully completed

This app is rightfully a hit.

I'm concerned about security though.

Wouldn't the same tile that arms also allow single push button disarming?

I just tried it.

It means if a bad guy rolled up to my HE tiles and saw that tile was yellow, he or she coudl just press it and disarm.

What security layers are other people implementing to counter this?

I put the ADC switches on a separate dashboard, disabled "allow changes" and added a pin. You could also disable cloud access if you like.