[RELEASE] Elk M1 Integration

@captncode

Great News, after the soft reset and re-installation everything just worked. Having things fail early on due to the incorrect port preventing communications with the M1 seemed to mess things up.
I was so happy to hear the M1 voice the Arm/Disarm sequence!
Now it's time to get some I/O running in both directions, going to be a fun day tomorrow.
Thanks again Greg,
Al

@alkramer6,

That's great to hear. I wonder if the keypad number that the main Elk M1 device uses didn't get set up correctly when it was installed 'unable to connect'. It depends on keypad number to know which area to arm/disarm. I will look over the code to look for clues.

Enjoy!
Greg

Greg,
I am a new user moving from a Vera Plus to C7.
I have tried to get my Elk M1 connected...
i keep getting this error:
Error: Cannot invoke method sort() on null object when I install the app

When I head into the logs, I see
app:352021-03-31 10:40:35.900 am errorjava.lang.NullPointerException: Cannot invoke method sort() on null object on line 270 (deviceMapsPage)

app:352021-03-31 10:40:35.776 am debugElk M1 Application: Found a Child Elk M1 Elk M1

app:352021-03-31 10:40:16.705 am debugElk M1 Application: Setting state.ElkM1DNI e6d43d8b-2712-41ed-86c3-427baeba098a

app:352021-03-31 10:40:16.701 am debugElk M1 Application: Creating Parent ElkM1 Device

app:352021-03-31 10:40:16.699 am debugElk M1 Application: Showing deviceMapsPage

app:352021-03-31 10:40:14.302 am debugElk M1 Application: Showing mainPage

And under the device, I see
dev:392021-03-31 10:40:25.615 am errorjava.lang.NullPointerException: Cannot invoke method padLeft() on null object on line 417 (installed)

dev:392021-03-31 10:40:24.410 am warnElk M1 installed...

I have uninstall, reinstalled, restored, rebooted...

any thoughts on where to look

The Elk M1 Device is able to connect and gets info... but the Application part won't show up.

@project_x
That is some very useful debug information. Thanks for that!

I would guess that when the application was installed and ran the first time, it did not have a valid Elk M1 user code. It seems the rest of the set up depends on that being correct upon installation.

Can you please remove the Elk Device and Elk Application and try again with a user code that you know is correct? If that fixes the problem, I will look into adding validation to the user code when it is initially set up.

Greg

@project_x,

One more thing that also needs to be verified. Can you confirm that the port used is the correct non-secure port and that port is turned on with your M1XEP or C1M1?

Greg

M1xep
Non secure port
And it does connect, as I can see it is connected through m1 device

What about the user code? It does not need the user code to connect but it needs it for other functions,

I verified the user code is correct. I can arm and disarm from the Elk M1 Device in the devices section..

@project_x,

I have pushed out a small change to the Elk Application driver. It now checks for child devices and should not produce that app error that you were seeing in the log. Can you please replace your existing Elk M1 Application driver with the one from https://raw.githubusercontent.com/thecaptncode/hubitat-elkm1/master/Elk-M1-Application.groovy

Then, on the Hubitat, go into Apps -> Elk M1 Application (should be only one of those) then click on "Devices" and let me know what you see under the "Existing Devices" heading.

Greg

That worked...and got me a bit farther
Now I get to Device Maps- it has Elk M1 as an existing device.

However, if I go into Apps ->
Elk M1 Application is not there

@project_x - How did you get to Device Maps without going to Apps -> Elk M1 Application?

When I tried to add User App.
I filled in all my info and clicked next...it then went to Device Maps. I think I forgot to hit done there....

I just reset my hub to an earlier version...I think I didn't hit done on the initial Device Maps screen and the M1 Application didn't finish (and I was stuck with an M1 Device I couldn't delete.

I will post what happens in a minute

@project_x,

That makes sense and could be directly related to that app error that I just fixed. Hopefully this is smooth sailing from here on out for you. You are not the first one who had a similar issue. I will see what I can do about that orphaned device so this doesn't happen to others.

Greg

Now I have installed it shows up in the App-

Will attempt to import Zones.

Thanks for the quick response and the great work.

Thank you and thanks for your help identifying the issue. I hope you enjoy the integration!

Greg

Hey @captncode, hope you have been well!! I am still loving the M1 integration with the Hubitat!

I have a few odd issues I wanted to run by you, not sure if they are all related or not.

  • I have a rule setup to lock some August locks when my M1 is Armed. It was working perfect then stopped a few months back. The M1 still arms and disarms, but it does not lock the doors but I can separately lock and unlock the same locks from the Hubitat dashboard.
  • Periodically (maybe 1 out of 10) on my Hubitat app when I hit Arm Away (not on local wifi) the app or HSM displays the M1 as Armed but it is NOT armed.
  • There appears to be an open issue with HSM that is scheduled to be fixed with release 2.2.8 that addresses a typo in the code. Currently, on my hub I cannot open HSM and get an error which lead me to the following link and it might be the root of my issues above (1 & 2): HSM bug? - #4 by tomm1313 but wanted to run all this by you.

Any suggestion on issue 1 & 2? Below are my logs when I hit Arm Away it just stops at HSM Alert and nothing else. Either way both logs are showing errors during the Arm process but I am not sure which way to go from here. Also, quick note, the lock automation does not run under any Arm scenario nor unlock.

*Unsuccessful Arm Away log – HSM shows the status as Armed but it is not.

2021-07-11 11:50:55.129 am infoHSM Alert: armingAway

dev:12021-07-11 11:50:55.085 am errorgroovy.lang.MissingMethodException: No signature of method: user_driver_belk_Elk_M1_Driver_394.armAway() is applicable for argument types: (java.lang.Long) values: [59]

Possible solutions: armAway(), armAway(int), armAway(int, java.lang.String), armHome(), ArmNextAway(), armHome(int) (armAway)

*Successful Arm Away log but Locks do not Lock – note errors in logs.

app:272021-07-11 11:54:54.530 am errorjava.lang.IllegalArgumentException: The JSON input text should neither be null nor empty. on line 1581 (armNoticeHandler)

dev:12021-07-11 11:54:54.510 am infoElk M1 Gold armStatus was arming away by 1 - Main

dev:12021-07-11 11:54:54.433 am infoElk M1 Gold armingIn was 60

dev:12021-07-11 11:54:54.058 am infoElk M1 Gold Elk M1 Gold sent email # 1

app:12021-07-11 11:54:53.407 am infoHSM Alert: armingAway

dev:12021-07-11 11:54:53.367 am errorgroovy.lang.MissingMethodException: No signature of method: user_driver_belk_Elk_M1_Driver_394.armAway() is applicable for argument types: (java.lang.Long) values: [59]

Possible solutions: armAway(), armAway(int), armAway(int, java.lang.String), armHome(), ArmNextAway(), armHome(int) (armAway)

Thank you!

@AKTown ,

Sorry it has taken me so long to look at this. All of my time this week has been taken up with work and family things.

Looking at that error with arming, it looks like there is a parameter of 59 being passed to ArmAway. The only reason to be passing a parameter (argument) to ArmAway is if you wish to arm another area or use a user code other than what is stored in the Elk M1 driver. When you lock it from the dashboard, no parameters are being passed.

Are you arming HSM and letting the ELK arm or vice versa? It shouldn't make a difference but it does give me a direction to look.

Greg

Hi @captncode

Thank you for looking over the issue with me. Ironically after living with my problem for a few months the hub updated last night and it is now locking and unlocking as intended. Unfortunately I pulled a fresh log and I still have the errors. In this log file I tapped Arm Home with HSM.

app:12021-07-16 05:02:18.000 pm infoHSM Alert: armedHome
app:272021-07-16 05:02:17.949 pm infoArmed Home
app:272021-07-16 05:02:14.091 pm errorjava.lang.IllegalArgumentException: The JSON input text should neither be null nor empty. on line 1581 (armNoticeHandler)
dev:12021-07-16 05:02:14.057 pm infoElk M1 Gold armStatus was arming home by 1 - Master
dev:12021-07-16 05:02:13.977 pm infoElk M1 Gold armingIn was 60
dev:12021-07-16 05:02:13.604 pm infoElk M1 Gold Elk M1 Gold sent email # 1
app:12021-07-16 05:02:12.948 pm infoHSM Alert: armingHome
dev:12021-07-16 05:02:12.883 pm errorgroovy.lang.MissingMethodException: No signature of method: user_driver_belk_Elk_M1_Driver_394.armHome() is applicable for argument types: (java.lang.Long) values: [5] Possible solutions: armHome(), armHome(int), armHome(int, java.lang.String), armAway(), ArmNextHome(), chime() (armHome)

Thank you!

@AKTown ,

I have a few observations from the log.

  1. The Elk driver threw an error because something passed an argument of 5 to armHome() that should not have.
  2. HSM sent armingHome instead of armedHome
  3. HSM threw an error on JSON, then armed home 4 seconds later

I suspect HSM was set to use a 5 second delay, which may have been that 5 in the argument.

HSM may be set to use the Elk keypad to arm AND the Elk M1 Application is also set to use HSM integration. This is not a scenario I have tested.

Could you please send screen shots or at least the information used to configure Arming/Disarming/Cancel Options in HSM? That would help me better test how you have things set up.

It is likely HSM has new features that I have not tested with the Elk M1 integration.

Regards,
Greg