Having a quick view of triggered sensors can be extremely handy (such as if you forgot to close a door or want to know where motion is currently occurring). In this post I will show how I accomplished this using the Entity Filter card for the Lovelace Home Assistant front-end.

Requirements

  • Various sensors (usually of type binary_sensor) that you want to display
  • Home Assistant

Setting it up

You will go to the top right from the UI and click the 3 dot menu and then press "Configure UI". From here you can now configure existing cards as well as add new ones to the current Home Assistant view. What you want to do is add a new card by press the plus + in the bottom right and click Manual Card. You will need need to paste in this YAML modifying it to match your setup (I left some entities in from my setup so you can see how it looks):

cards:
  - card:
      show_header_toggle: false
      title: Triggered Sensors
      type: glance
    entities:
      - entity: binary_sensor.north_backyard_motion
        show_last_changed: true
      - entity: binary_sensor.south_backyard_motion
        show_last_changed: true
      - entity: binary_sensor.driveway_motion
        show_last_changed: true
      - entity: binary_sensor.front_door_motion
        show_last_changed: true
    name: Triggered
    show_empty: false
    show_header_toggle: false
    state_filter:
      - 'on'
      - Detected
      - Open
    type: entity-filter
  - card:
      show_header_toggle: false
      title: Inactive Sensors
      type: entities
    entities:
      - entity: binary_sensor.north_backyard_motion
        show_last_changed: true
      - entity: binary_sensor.south_backyard_motion
        show_last_changed: true
      - entity: binary_sensor.driveway_motion
        show_last_changed: true
      - entity: binary_sensor.front_door_motion
        show_last_changed: true
    name: Triggered Sensors
    show_empty: false
    show_header_toggle: false
    state_filter:
      - 'off'
      - Clear
      - Closed
      - unavailable
    type: entity-filter
type: vertical-stack

Make sure to have the entities lists for both cards match so that entities are always displayed in either the Triggered or Inactive list. Once you get it configured and you save it you should start seeing sensors move to the Triggered list as they become active and see them move back down to the Inactive list when they are no longer triggered.

Conclusion

With how many devices I now have in Home Assistant finding ways to display in in the front-end efficiently is becoming more difficult. That is why I am really happy they are making so much progress with Lovelace lately.

I've really been liking what they have been doing with Lovelace recently. I do wish when using the show_last_changed that the last changed time would update more frequently (like every second would be nice). It seems to be almost worthless with how slow it responds currently (looks to be every 7-10 seconds). Since this feature is pretty new though I bet things like that will only get better over time.

Feedback

Feel free to leave a comment below if you have any feedback. I do love hearing back from my readers. If you are having any issues I will do my best to help you out as well.