Template sensor how to display logbook list?

I have created a template sensor to monitor house security status which displays secure / insecure and is working great however when I click on it in lovelace I get the horizontal bar with a history of events but not the logbook list I get with other sensors created automatically by HA such as my door

no logboock entries

with logbook entries

The history is there in my sensor but I can’t figure out how to get it to present a list like the lock does.

Any help would be appreciated

I am not sure why, but it looks like the Logbook is only shown with template binary sensors and not with template sensors.
So is your sensor indeed not a binary sensor?
Since the sensor only has two possible states (secure and unsecure) you should be able to convert it into a binary sensor?

1 Like

Thanks, that’s useful information, I’ve tried to convert that into a binary sensor but not having any success. The sensor is defined in a separate sensors.yaml the current code looks like this

  - platform: template
        friendly_name: "House Security Status"
        value_template: >-
          {% if is_state('input_boolean.house_secure', 'on') %}
          {% else %}
          {% endif %}

I keep getting errors when trying to turn that into a binary sensor (check configuration before restart throws errors) I have tried to search the documentation for binary_sensor but it’s not making any sense to me. Does anyone know how to turn the above code into a binary sensor?


A binary_sensor’s nominal states are exclusively on and off. These two state values can be displayed differently using the device_class option.

For example, a binary_sensor with its device_class set to door will display on/off as Open/Closed.

Unfortunately, for your application, there’s no device_class that reports Secure/Insecure so you can’t convert your existing Template Sensor into a Template Binary Sensor.

Binary Sensor Device Class

Because a binary_sensor’s states can only be on/off.

1 Like

It looks like you are using the Legacy formatting, so the check out the Legacy binary sensor configuration format.
It is not shown in your yaml code, so could it be that you have the sensor configured below the sensor: entry instead of the binary_sensor: entry?

1 Like

I recreated the sensor in configuration.yaml as a binary sensor and the logbook entries are showing up now, so definitely needs to be a binary sensor. I was trying to create it in sensors.yaml I see my mistake now.

I can’t get it to show secure or insecure just on or off but I’m at least back on track.

Appreciate the help, thanks a lot.

A compromise might be to use the device_class: safety
Then you will have Safe/Unsafe instead of Secure/Insecure

As explained above, that’s not possible.

What is the purpose of creating a Template Binary Sensor, which displays on/off, for an Input Boolean that already displays on/off? It seems like an unnecessary duplication.


An Input Boolean already shows the “logbook list” you desire to see.

Creating a Template Binary Sensor to duplicate that functionality seems needless, especially when you consider the fact it cannot even display the desired Secure/Insecure states.

The suggested use of the terms Safe/Unsafe implies something very different; “Security system is unsafe”. It’s not an industry standard way of referring to a security system’s state (and for good reason).

I have this issue as well, but with a standard template (not binary) sensor. How can I get it to display logbook entries each time the value of the sensor changes?