UK Police API

:oncoming_police_car: UK Police – Live Crime & Neighbourhood Data Integration for Home Assistant

Hey everyone,

I've just released a new custom integration that brings official UK Police open data straight into Home Assistant!

UK Police gives you rich local safety insights using the free data.police.uk API (no API key needed).

:sparkles: Key Features

  • Automatic neighbourhood detection based on your Home Assistant home location (or manually choose any UK police force + neighbourhood)
  • Detailed crime sensors including:
    • Total crimes this month
    • Crime trend (rising/falling/stable)
    • Breakdown by crime category
    • Monthly crime count (perfect for history graphs)
  • Stop & Search statistics (totals, outcomes, ethnicity, age, etc.)
  • Neighbourhood policing info:
    • Team size & officer names
    • Current policing priorities
    • Upcoming public events + next event
  • Binary sensors for alerts:
    • High Crime Alert
    • Rising Crime Trend
    • Active Policing Priorities
    • Upcoming Events
  • Interactive Crime Map with two modes:
    • Grouped by category (clean overview)
    • Individual crime incidents (street-level detail)
  • All pins show distance from your home and full incident details

You can add multiple neighbourhoods if you want to monitor several areas.

Installation (via HACS recommended)

  1. Add this repo in HACS → Custom repositories:
  1. Search for "UK Police" and install
  2. Restart HA and add the integration

GitHub Repo: GitHub - 91JJ/HA_UK_Police: UK Police API for Home Assistant. Provides geo_location sensors for crimes in your local (or selected) area plus multiple sensors. · GitHub

Would love feedback, feature requests, or contributions! Especially from people in different forces across the UK.

Let me know how it works in your area! :man_police_officer:

3 Likes

Noticed a couple of things that needed tweaking so v1.1 is now out!

This has been public for a week or so now and I'm curious if anyone is using it and any feedback?

Just raised an issue.

1 Like

Thanks, will take a look!
What Home Assistant version are you running?

I released v1.1.1 ... let me know if that works.

I'm on HA 2026.6.0.
The refactored config flow has fixed it thanks.

1 Like

Hello, What considerations did you have when deciding which data to expose as binary “alert” sensors (e.g., high crime, rising trend, active priorities) versus keeping it as numeric or Red humana informational sensors, especially in terms of avoiding false positives or over-triggering automations in Home Assistant?

1 Like

Great stuff, thanks!

We hard-coded the binary alert logic (e.g. the 50-crime threshold for High Crime Alert, and the custom “rising” trend rule) because we wanted simple, actionable triggers for Home Assistant automations without forcing users to build complex templates.

The main considerations were:

  • Reducing noise — We used conservative thresholds and a stability band on trends so automations don’t fire on minor fluctuations.
  • Clear separation — Binary sensors (PROBLEM class) for automations/notifications, numeric sensors + attributes for dashboards and detailed data.
  • Low false positives — High-crime uses a reasonably high bar (50), trends require a clear directional change, and the others are simple presence checks on official police data.

All of this logic lives in the integration code (not the API). Going forward, these thresholds and rules can easily be made configurable or removed entirely if users prefer to handle alerting themselves.

Specific Considerations for Each Binary Sensor

Binary Sensor Why it was made binary How we avoided false positives / over-triggering Threshold / Logic
High Crime Alert Clear “something is wrong” trigger Used a reasonably high fixed threshold (50 crimes in the latest month). This is high enough to represent genuinely elevated activity in most UK neighbourhoods (street-level ~1 mile radius) without firing constantly in busier areas. total_crimes >= 50 (hardcoded, exposed in attributes)
Rising Crime Trend Actionable early warning Added a custom stability band in the trend calculation (abs(diff) <= max(1, oldest * 0.05)). Small fluctuations are treated as “stable”. Only clear directional changes over the chosen history window trigger “rising”. Custom _trend_label() with 5% + min-1 stability band
Active Policing Priorities Useful to know when police have declared focus areas Simple > 0 check on official police data. Very low false-positive risk because priorities are explicitly published by the force. priorities_count > 0
Upcoming Events Good for notifications / awareness Pure presence check (len(events) > 0). Objective data from the police, so minimal risk of spurious triggers. has_upcoming_events
Neighbourhood Team Assigned Indicates active local policing presence Simple > 0 check. Again, based directly on published team data. team_count > 0