Log on dashboard to show what sensor reported leak

I am looking for a way to log what sensor reported a leak and at what time it did so. As is, I can see what sensor reports being wet IF the state persists when I look at it. I do get notifications on my phone and Alexa announces the same notification on about 15 Alexas stating all of the information to quickly spot the leak so it is unlikely I will miss it but I want to display the same information in a card. All my coding is in Node Red.

As simple as it is, this system has saved me several times, including a 160-200L (40-50gal) water heater in the attic that could have caused major damage when it started leaking. I now have a tankless heater…

A basic attempt at solving this is to use an input_text helper and assign the sensor name. I could easily build a string that includes name, state and date/time… but then I would be limited to one sensor or one log entry (would likely get messy otherwise).

I’ve seen the markdown card but am not familiar with it. I’ve tried to use log cards but they were logging all state changes including available/unavailable (during boot?) and stuff that was just making it unnecessarily crowded.

Also, the solution I use in Node Red pulls in any sensor that ends with “leak sensor” in its name. I have a standard naming convention for all my devices so this way I will never miss an alert because I forgot to add a new sensor to the leak alert code. The card I am seeking to build would display information from Node Red so even if I forget to do anything in the dashboard (ie adding the sensor individually as I did in the snapshot above), I should still see the sensor or sensors reporting wet.

This other attempt was using type: custom:logbook-card but as far as I recall it was only good for one device per card. Disregard the title… the YAML only lists one sensor

Suggestions? Examples?

I just stumbled on history-explorer-card:

It’s available via HACS and might kind of do what you want. You can setup a dashboard with the history graphs from specific sensors, see them all at once, and scroll around in time. So if you get an alert that a leak happened and then the sensor goes back to its original state, you can check that dashboard to see the history of all your leak sensors.

I used it to setup a dashboard of my room presence and distance information to troubleshoot when my presence stuff goes haywire, and it. Here’s a screen shot of what that looks like from a few days ago just to give you a sense of what you could do with it:

I see it has filters which will help with always showing a complete list of my leak sensors but I am not thrilled about how it shows binary sensors… I will have to play around with it to see what options are available. Thanks for the tip!

This gets me the closest:

type: custom:auto-entities
card:
  type: logbook
  title: Water Detection Log
  card_mod:
    style: |
      .card-header {
      font-size: 18px;
      padding: 2px 15px 2px 35px
      }
  hours_to_show: 48
filter:
  include:
    - entity_id: binary_sensor.*_(water|leak)_sensor
  exclude:
    - state: 'off'

If I filter on off and unavailable then the card is not displayed… while auto-entities has options to display the card with no entities, I figured that seeing a leak sensor that is unavailable in the log is equally important… I also found that some sensors show “cleared” (aka off) when in reality they are unavailable which explains why the log above shows a couple “cleared” entries even though I filtered those out.

The card_mod bit is not working… the title should be smaller, and I wish I could add a section line right under the title as I do on all my cards but I don’t know how to do it on this particular card…

Edit_x: Nevermind… the filter appears to include/exclude based on current state so if the sensor goes back to dry, and the log is filtered on sensors reporting a leak, the log will not show it as the sensor is now dry. What I really need is a logbook that can have states filtered out of it… and a filter that includes all applicable leak sensors as I did in the example above.