Card showing event (fx smoke alarm going off) which wont disappear until user signs off on it?

Beginner here.
Got two smoke alarms (Heiman Smart Smoke Sensor (HEIEHS1SA)) which now are part of the family.
I also got a Aqara Water Leak Sensor since before.

What I am trying to do:
I would like to have a card that shows events like a triggered smoke alarm which doesn’t go away until someone has acknowledged it (by clicking on the event in the card?).

Is this possible? How would you solve this?

If this is to be a simple warning signal, you could create an input boolean and then add an action input_boolean.turn_on to your existing smoke detection automation. Afterwards you create a new lovelace button card and the input boolean entity.

If the alarm shall be stopped you let your button call a service.

Hi, I have setup exactly what you are describing using input_booleans.

Here’s the automation to turn the input_boolean on, when smoke is detected

alias: Basement Smoke Boolean
description: ''
mode: single
trigger:
  - platform: state
    entity_id: binary_sensor.basement_smoke
    from: 'off'
    to: 'on'
condition: []
action:
  - service: input_boolean.turn_on
    target:
      entity_id: input_boolean.basement_smoke

Here is a part of my lovelace configuration for that matter:

type: 'custom:auto-entities'
show_empty: false
card:
  type: entities
  card_mod:
    style: |
      ha-card {
        font-weight: bold;
        color: #a81120;
        --paper-item-icon-color: #a81120;
filter:
  include:
    - entity_id: input_boolean.basement_smoke
      state: 'on'
      options:
        name: Basement Smoke Alarm
        icon: 'mdi:fire'
        type: 'custom:multiple-entity-row'
        show_state: false
        secondary_info: last-changed
        tap_action:
          action: none
        entities:
          - icon: 'mdi:check'
            tap_action:
              action: call-service
              service: input_boolean.toggle
              service_data:
                entity_id: input_boolean.basement_smoke




It uses two custom cards, which are the auto-entities card and the multiple-entity-row.
And also, the card-mod card to handle the colors:

And here’s a photo example.

When you click the ‘check’ button, the input_boolean turns off and the card disappears:

smoke

5 Likes

@valvex Love your card. I’m wondering if you just use it for the smoke alarm? I have 25+ sensors around the house and would hate to do this config for each and everyone one of them. HAve you templatised it by any chance and do you think it is possible? (I am by no means a templating guru).

Idea is in the automation list multiple entities and then depending on which one triggers set that specific boolean.

In the card depending on the sensor that triggered adjust the name and icon

@Marcweemer
Let’s suppose that you have some smoke binary_sensors. For example,

binary_sensor.basement_smoke
binary_sensor.kitchen_smoke

Then you must create your input_booleans, so that the second part is identical to the binary sensor entity_id.

input_boolean.basement_smoke
input_boolean.kitchen_smoke

Here’s the automation to turn on your input_booleans using templates:

alias: Smoke booleans
description: ''
mode: single
trigger:
  - platform: state
    entity_id: binary_sensor.basement_smoke
    from: 'off'
    to: 'on'
  - platform: state
    entity_id: binary_sensor.kitchen_smoke
    from: 'off'
    to: 'on'
condition: []
action:
  - service: input_boolean.turn_on
    target:
      entity_id: |
        {{ trigger.entity_id | replace('binary_sensor','input_boolean') }}

And here’s the auto-entities card to automatically show the input booleans that are on.

type: custom:auto-entities
show_empty: false
card:
  type: entities
  card_mod:
    style: |
      ha-card {
        font-weight: bold;
        color: #a81120;
        --paper-item-icon-color: #a81120;
        }
filter:
  include:
    - entity_id: /smoke/
      domain: input_boolean
      state: 'on'
      options:
        icon: mdi:fire
        type: custom:multiple-entity-row
        show_state: false
        secondary_info: last-changed
        tap_action:
          action: none
        entities:
          - icon: mdi:check
            tap_action:
              action: call-service
              service: input_boolean.toggle
              service_data:
                entity_id: this.entity_id

Take notice that we now do not specify individual entities, but we include any entity that has “smoke” on its entity_id and is of the input_boolean domain.
Also on the check action, we specify “entity_id: this.entity_id”.

2 Likes

That worked like a charm. Do you know where the text from the actual notification comes from? It looks like it is the name of the boolean. Is there a way to template that and use a friendly name or the name of the triggering device?

Thank you for sharing @valvex .

This is really useful. What I am wondering, looking at the code (sorry, I am travelling and cannot test it out myself :frowning: ):

  • If there are multiple entities reporting smoke, will this then not confirm all at once rather than give you the possibility to check them one by one? Would just using auto-entities without the multiple-entity-row card not create multiple cards that can be individually confirmed?
  • Is the button then empty, when no smoke alarm is triggered? Maybe I am reading it wrongly.

I would like to piggy-back of this and am thinking if it is possible to simply create multiple buttons in a horizontal stack without tap_action when state is ‘off’ and a tap_action when state is ‘on’.
Would this then not also remove the need for input booleans and automations?

That way you can see all alarms (has the advantage that I know that they are in fact reporting and not e.g. out off battery).

@Marcweemer
After creating your input_boolean, specify its “Name” so that it appears correctly in the auto-entities card.

@AleXSR7001
The configuration that I posted above will only create entity rows for the active smoke alarms (ie the input_booleans that are turned on).
For each entity row, there will be a button to dismiss only the desired one (as long as you have correctly configured “this.entity_id” in the tap_action).

auto-entities