Create a Custom Map View Showing All Sensor Locations and Live Status in Home Assistant
Alright, let's be honest. You've got a dozen doors sensors, a handful of water leak detectors, maybe some cameras. Your "default" tab in Home Assistant is probably a scrolling list of entities. It's functional. It's also… boring. Actually, it's worse than boring—it's slow. When something triggers at 2 AM, you don't want to scan a list. You want to *look* at a map and know, instantly, "Oh, it's the garden shed door." You want a command center, not a spreadsheet. That's the goal here.
Gather Your Tools: What You'll Need Before We Start
You don't need to be a cartographer. But you do need the basics. First, the most important add-on: the **'Map Card' by Thomas Loven**. Search for it in HACS and install it. Next, coordinates. For every sensor you want on the map, you need latitude and longitude. Don't panic. You can get these from your phone's Google Maps app (drop a pin, long-press, copy the coords) or use a site like LatLong.net over a satellite image of your house. Grab a notepad, digital or paper. Write them down. Last tool? A floor plan image. A simple JPG from your builder, or even a clean sketch you make. That's your canvas.
The Magic Ingredient: Turning Coordinates into Map Pins
This is the part that trips people up. Home Assistant doesn't magically know where your back door sensor is. You have to tell it. For each device, you create a "helper" sensor. You're going to edit its device info in your `configuration.yaml` file (or use the File Editor add-on). You're adding two custom attributes: `latitude` and `longitude`. The format is super specific. It looks like this for a door sensor:
`sensor.back_door_location:`
`friendly_name: "Back Door"`
`latitude: 45.123456`
`longitude: -122.654321`
Yeah, it's a bit of manual data entry. But do it once. It's worth it.
Building Your Dashboard: The Fun Part Begins
Now for the payoff. Head to your Lovelace dashboard, hit the three dots, and edit your dashboard. Add a new card. Choose "Manual". This is where you paste the YAML for the Map Card. The core of it is simple: you tell it which entities have location data. But the real power is in the options. You can set the map's default zoom, the icon for each entity, and—critically—layer your floor plan image over the map so the pins sit perfectly on your house layout. It takes a little tweaking of the image's location and scale. Trial and error. But when it snaps into place? Chef's kiss.
Beyond the Basics: Make It Actually Useful
Don't just stop at static pins. A green dot on a map is cool. A dot that turns red when the door opens? That's smart. You do this by tying the map icon's state to your sensor's real status. The Map Card's documentation is your friend here. You can set different icons for 'on' vs 'off', or even use a custom picture of a water droplet for your leak sensor. Want to see live camera feeds? You can make the map pins tap-able, pulling up a camera stream or a more detailed entity pop-up. This is where your security map goes from a fancy graphic to your actual nerve center.
The Final Polish: A Place for Everything
So you've got this beautiful map. Now what? Give it its own dashboard tab. Call it "Map" or "Security" or "Overlook". Make it the first thing you see on your wall-mounted tablet or phone app. Pair it with other relevant cards on that tab—maybe a grid of camera thumbnails below it, or a list of recently triggered alarms. The point is to build a view that gives you situational awareness at a glance. No digging. No menus. Just the big picture of your home, literally. Then go admire your work. You've earned it.