Skip to content

How to Test & Debug

Elahd Bar-Shai edited this page Oct 23, 2023 · 12 revisions

Below are instructions for performing various testing and debugging actions to help developers debug issues.

Install integration development version

  1. In Home Assistant, go to HACS and click on the Alarm.com integration. This will open up the description page for the Alarm.com integration.

  2. Click on the three dots on the top right, then click on "Redownload".

  3. From the "Select version" menu, select "master", then click download.

  4. Restart Home Assistant.

Get debug data for a single entity

  1. In Home Assistant, go to Settings > Devices & Services > Devices. You'll see a list of all of your devices.

  2. Click on the device for which you want to get debug information. That will take you to the device's information page.

  3. Click on "PRESS" for the device's Debug entity:

  4. Go to Settings > System > Logs and click on the debug log for your device:

  5. Use the copy button in the log entry's modal to copy and paste the required information into your GitHub comment. Please don't post a screenshot!

Enable code debugging

  1. Adding the following to Home Assistant's configuration.yaml file:
logger:
  default: warn
  logs:
    custom_components.alarmdotcom: debug
    pyalarmdotcomajax: debug
  1. Restart Home Assistant
  2. Perform the Alarm.com action that needs debugging.
  3. Review the logs by going to Settings > System > Logs.
  4. Once on the logging page, click on the "Load Full Logs" button at the bottom of the page.
  5. Use Ctrl+F to use your browser's search function to find the relevant entries.
  6. When done, turn off debugging mode by removing the lines you added to configuration.yaml and restarting Home Assistant.

Install the ADC command line tool

WARNING: The adc command line tool dumps information about your Alarm.com devices. This may leak sensitive information such as your location, your name, or names of your family members (i.e.: if your devices have names like "Noah's Bedroom Right Window"). When posting, be sure you manually remove any information that you don't want to share publicly.

  1. Install Python >= 3.11.
  2. Install pyalarmdotcomajax via pip:
Version Command
Latest pip install pyalarmdotcomajax
Specific (e.g.: v0.5.0-beta) pip install pyalarmdotcomajax==0.5.0-beta
Git Branch (e.g.: new-device-support) pip install git+https://github.com/pyalarmdotcom/pyalarmdotcomajax.git@new-device-support
  1. You can now use ADC in the command line. Below are useful commands:
Command Template Name Command Description
Basic adc -u "YOUR_USERNAME" -p "YOUR_PASSWORD" get Shows human-readable device statuses.
Raw JSON adc -v -u "YOUR_USERNAME" -p "YOUR_PASSWORD" get Same as above, but returns the server's raw responses broken out by device type.
Stream Live Events adc -u "YOUR_USERNAME" -p "YOUR_PASSWORD" stream Stream alarm events as they happen.
Unsupported Devices adc -v -u "YOUR_USERNAME" -p "YOUR_PASSWORD" get -x Shows raw data for all devices on you system, including devices not supported by this integration.
Code Flow Debugging adc -d -u "YOUR_USERNAME" -p "YOUR_PASSWORD" get Shows debug message from pyalarmdotcomajax. Useful for determining where in the connection process a feature is breaking.
Help - General adc -h
Help - get Command adc get -h The get command retrieve device states.
Help - set Command adc set -h The set command changes device settings. It currently only works for Skybell HD doorbells.
Turn off Skybell HD's indoor chime adc -u "YOUR_USERNAME" -p "YOUR_PASSWORD" set -i 634798620-3745 -s indoor-chime-on -k False Assumes Skybell HD's Alarm.com ID is 634798620-3745. See the pyalarmdotcomajax README for more set commands.

Capturing POST data in Chrome

  1. In Chrome, go to the page where you're being asked to perform an action.

  2. Press Ctrl+Shift+J (Windows/Linux) or Cmd+Option+J (Mac) to open the DevTools console.

  3. Click on the "Network" tab:

  4. Make sure that "Preserve Log" is checked:

  5. Do the action that you're being ask to perform (e.g.: save device settings). You'll see new entries appear in the bottom left pane of the Network tab.

  6. Find the entry with the data from your request and click on it. This should be one of the first entries to appear after you took the action in the last step. You can use the "name" field in the bottom left pane and the Payload tab in the bottom right pane to confirm that you've found the request. The Payload tab should show some of the settings / form data that you submitted.

  7. In the Payload tab, right click on the row immediately below "Request Payload", then click "Copy Object":

  8. Paste what you've copied back into the GitHub post.

Clone this wiki locally