# Use Grafana to graph motion sensor triggers

**URL:** https://discourse.nodered.org/t/use-grafana-to-graph-motion-sensor-triggers/98370
**Category:** General
**Created:** [29 July 2025 21:40 UTC](https://discourse.nodered.org/t/use-grafana-to-graph-motion-sensor-triggers/98370 "2025-07-29T21:40:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![richiep](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@richiep](https://discourse.nodered.org/u/richiep)
#### Post date: [29 July 2025 21:40 UTC](https://discourse.nodered.org/t/use-grafana-to-graph-motion-sensor-triggers/98370/1 "2025-07-29T21:40:46Z")

</div>

I once saw how someone set up a Grafana display to show when a motion sensor was triggered over a 24 hour period. It was like an occupancy record. I can’t find it again.

Has anyone done this? Or can someone point to an example?

Here’s what mine looks like so far. Each data point is not equally spaced as the graph suggests.

 ![Screenshot 2025-07-29 173412](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/6/56c18d67840929373143abde87c026616f17c654.png)

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [29 July 2025 22:11 UTC](https://discourse.nodered.org/t/use-grafana-to-graph-motion-sensor-triggers/98370/2 "2025-07-29T22:11:24Z")

</div>

It doesn’t look anything like your example and it’s not grafana, but is [https://flows.nodered.org/node/@cgjgh/node-red-dashboard-2-ui-state-timeline](https://flows.nodered.org/node/@cgjgh/node-red-dashboard-2-ui-state-timeline) what you had in mind?

---

<div class="post-metadata">

### Author: ![richiep](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@richiep](https://discourse.nodered.org/u/richiep)
#### Post date: [29 July 2025 23:31 UTC](https://discourse.nodered.org/t/use-grafana-to-graph-motion-sensor-triggers/98370/3 "2025-07-29T23:31:01Z")

</div>

That looks cool, I’ll check it out.

Thanks!

---

<div class="post-metadata">

### Author: ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)
#### Post date: [30 July 2025 04:00 UTC](https://discourse.nodered.org/t/use-grafana-to-graph-motion-sensor-triggers/98370/4 "2025-07-30T04:00:38Z")

</div>

If you use InfluxDB you could use a simple query to aggregate the events by location, so the data gets sampled down to a readable scale based on your time range.

```sql
SELECT count("value") AS "count" FROM "movement" WHERE $timeFilter GROUP BY time($__interval), "location"

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [28 October 2025 04:00 UTC](https://discourse.nodered.org/t/use-grafana-to-graph-motion-sensor-triggers/98370/5 "2025-10-28T04:00:47Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
