I wanted a “heat map” to show the activity of my PIRs (passive infrared detectors).
For each PIR, I set up an input_select with five options in my configuration.yaml
0_office_pir:
options:
- Level-1
- Level-2
- Level-3
- Level-4
- Level-5
initial: Level-1
I created different .pngs for each option:
- Level 5 Bright green when the PIR was triggered in the last 30 seconds.
- Level 4 (reserved)
- Level 3 Blue when triggered between 30 seconds and 60 seconds ago.
- Level 2 Gray when triggered between 1 and 5 minutes ago.
- Level 1 Faint gray
My Lovelace looks like this:
- type: picture-elements
title: Terrace
aspect_ratio: 1:1.74
image: /local/Floorplan0.png
elements:
- type: image
entity: input_select.0_patio_pir
state_image:
'Level-1': /local/PIR01.png
'Level-2': /local/PIR02.png
'Level-3': /local/PIR03.png
'Level-5': /local/PIR05.png
style:
top: 16%
left: 33%
transform: rotate(1deg)
In Node Red (where I’m already monitoring my PIRs for motion-sensitive lighting) my flow starts whenever my PIR is violated and triggers the following:
- immediately set the value of my input_select to Level-5
- wait 30 seconds, then set the input_select to Level-3
- wait 60 seconds, then set the input_select to Level-2
- wait 300 seconds, then set the input_select to Level-1
Works perfectly.
Cheers, Richard