Binary sensor: show last state change date

Hello,

I would like to easily know at what time my front door was opened.
For that I created a binary graph displaying the value of my door sensor, but I don’t find it great.
First, the graph does what it’s told: it shows my sensor’s state over time, except a door opens and closes in 10s, so at the graph’s scale (at best 1h) you hardly see anything (just a spike, sometimes narrower than 1 pixel).
And it’s not very quick to access: I saw that I can click the graph to get more detail, but it’s still cumbersome (you have to click in the right spot, etc.)

Is there another way to do this?
Otherwise, wouldn’t it be possible to create a « door-type object » to manage this?
I’m opening the question :slight_smile:

Hello @NineStars,

I fully agree with the need. To validate your opinion, and that of @pierre-gilles, with the help of ClaudeAI:

Proposal: New « Event History » widget

I recommend option 2 — a dedicated new widget — for these reasons:

  1. Option 1 (click in « Devices ») would require a complex popup/modal system that doesn’t exist in Gladys, and it mixes two responsibilities
  2. A dedicated widget naturally integrates into the existing system and remains consistent with Gladys philosophy (one widget = one clear function)

Proposed name: event-history / « Event History »

Shorter than « History of binary sensors » and potentially extensible to other types later.

What the widget would display:

  • Vertical list of state changes in a box with fixed height and scroll
  • Each line: [colored dot] Sensor name — New state — HH:MM:SS
  • Grouped by date (separators « 24 March 2026 », « 23 March 2026 »…)
  • Only transitions (no repetition if the same value arrives multiple times)
  • Last 24h displayed initially, automatic pagination on scroll to the bottom
  • Configurable colors in edit mode (one color per state 0/1, per feature, or global)
  • Real-time via WebSocket (new transition = new line at the top)

Edit side:

  • Selection of binary features only (filter on type === 'binary' || type === 'push')
  • Choice of colors for state 0 / state 1 (like in Chart)
  • Customizable labels for 0/1 (e.g., « Closed »/« Open ») — optional V2

API side:

  • Possible reuse of the existing aggregated_states API for binary transitions
  • Add a pagination parameter (offset/limit or cursor-based) because the current endpoint does not paginate

Propositions :


@Terdious , your proposal is a bit of a duplicate of the request I had posted. Isn’t it?

1 Like

For me it’s two different things, you’re proposing an « Event Log » tab that groups all the devices in the house!

Here, we’re just talking about a different display of the opening sensors (door/window) on the dashboard!

Yes, I agree, but in @Terdious’s proposal he wants to add an event history for the different positions. This event history part, to me, is redundant with my event log proposal.

1 Like

Hi,

I think a history can be useful, but it doesn’t go much further than the need I had described.

On reflection, I think that if we display under / next to / … the date of the last state change (i.e., when my door changes from open to closed, or vice versa) it would be quite simple, and generic for any binary sensor.
It could be offered in the dashboard editor, when displaying a binary state with a checkbox « show date of last change », for example if we want to make it configurable

That’s not bad! Especially since it’s already something we do for motion sensors, and for the « Users present » widget:

Hello, will this update be taken into account? Thanks :slight_smile:

Hi @NineStars :slightly_smiling_face:

Is there a specific point that interests you?

To be honest, the request isn’t very clear as it stands. The title doesn’t really help understand what is expected, so it’s not very « actionable », especially when browsing the list without going into each topic (there are already 234 pending requests :sweat_smile:).

Ideally, the title should be enough on its own to understand the desired development. And if you have several ideas, don’t hesitate to create several separate requests :slightly_smiling_face:

Thanks for your feedback anyway!!

Hi @pierre-gilles, I thought your previous comment made the request clear enough. I’ll rename the topic.