Thanks @123 - no, my requirements haven’t changed, but I was just trying to make a start & don’t know how to do what I ideally want.
EDITED #2 TO UPDATE ON FURTHER PROGRESS
Actually, it now does seem to work; one Lovelace Grid Card button (aimed at binary_sensor.mailbox_pir_motion
) changes from blue to yellow on first activation, stays yellow for maybe 10 seconds, then reverts back to blue. I will probably remove this button when I have improved the next one.
Meanwhile, in parallel, a Lovelace entity card (aimed at input_boolean.postbox_state
) changes from Off
to On
and remains like that until I cause a second activation of the PIR after more than 20 seconds (& not otherwise), when it goes from On
to Off
.
This is so close to what I want, but with two exceptions:
- How can I change the displayed state in the latter to be either Yes/No or FullEmpty, instead of Off/On?
- How can I get the mdi:mailbox icon to change to yellow in this card? This one stays on blue whether Off or On is shown.
- How might I code a reset at midnight, so even if no second activation happens on a particular day, at midnight the system is reset to Off (/Empty) as this would fit in to our needs better than a pure toggle.
TIA
.
.
.
EDITED #1 TO UPDATE PROGRESS
Following on from your input_boolean prompt, I have created a Helper & an entity input_boolean.postbox_state
(see below). I have created an Entity Card in Lovelace, and if I trigger(?) the Helper the Entity Card changes from Off to On & back again (but the colour of the icon doesn’t change, which I would like it to).
- id: '16256ccccc6'
alias: Postbox
description: ''
trigger:
- platform: state
entity_id: binary_sensor.mailbox_pir_motion
from: 'off'
to: 'on'
condition: []
action:
- service: input_boolean.toggle
target:
entity_id: input_boolean.postbox_state
- wait_template: ''
timeout: 00:00:20
mode: single
I have created an Automation called Postbox
, with the intention that if the Hue PIR senses motion it should trigger the 'input_boolean.postbox_state` and then wait for 20 seconds.
But it doesn’t work and I don’t see why not …
.
I am obviously missing something, but not sure what!