Spot Crime


The spotcrime sensor allows one to track reported incidents occurring in a given area. Incidents include anything reported to Spot Crime. Your regional emergency services may or may not report data. The sensor defaults to counting incidents within one day, but can be customized via configuration.yaml.

Setup

You will need to request an API key from Spotcrime.

Configuration

To enable this sensor, add the following lines to your configuration.yaml. Your radius should be of sufficient size to capture incidents in your area. 0.01 = 1 mile.

sensor:
  - platform: spotcrime
    name: NAME
    radius: SEARCH_RADIUS
    api_key: YOUR_API_KEY

Configuration Variables

name

(string)(Required)Name the sensor what you’d like.

radius

(float)(Required)Radius you’d like to search within. 0.01 = 1 mile.

api_key

(string)(Required)The API key to access the service.

days

(integer)(Optional)Number of days you’d like see to crime statistics for.

include

(list)(Optional)Event types you want statistics for.

exclude

(list)(Optional)Event types to ignore statistics for.

Notes

Incident Types

You can explicitly include or exclude incident types. Specifying includes restricts the incidents to those types. Specifying excludes will return all incident types except those specified.

These incident types are available:

  • Arrest
  • Arson
  • Assault
  • Burglary
  • Robbery
  • Shooting
  • Theft
  • Vandalism
  • Other

Events

The crimealerts sensor fires a crimealerts_incident event when a new incident is detected, including the type, time, and location of the incident.