i need help.
For my security in my home i need a button on my dashboard. I have Homematic IP for this.
So i want an automation thats lock my door if the door sensor is closed. Thats not the problem. I want a button on the default dashboard. I have a wall panel at the door. If i go out and push the button the door closed if the sensor is on “closed”. I want that the boolean reset after 5 Minutes automatically.
I dont want that the door closed every time if the sensor goes on closed, so i need a trigger that resets after X minutes (or seconds). THats my automation. Thats locks door every time.
a door sensor, which is the binary sensor in your trigger
Exactly. The sensor detects whether the door is open or closed
a door lock, which is the lock in the action.
The door should be locked at the end of automation.
what the button on the wall panel is or does (real button?);
The button should set a value to “True” or “False”, which I can incorporate into the automation. The automation currently works in such a way that the door is always locked as soon as the sensor detects that the door has been closed.
For this i have 2 devices from Homematic IP
Homematic IP Door Lock Drive
That locks the door.
Homematic IP Window and door contact – optical
Thats detect if the door open or close
The simplest thing to set up is an Input Boolean (Toggle) helper.
You can then create an automation that turns this off if it has been on for 5 minutes:
trigger:
- platform: state
entity_id: input_boolean.ID
to: 'on'
for: "00:05:00"
action:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.ID
In your main automation, I’d recommend using entity state triggers and actions rather than the device triggers and actions you currently have. It’s much easier to observe and debug these. So:
description: "Button: Tür Auto schließen"
mode: single
trigger:
- platform: state
entity_id: binary_sensor.DOOR_ID
for:
seconds: 10
action:
- service: lock.lock
target:
entity_id: lock.LOCK_ID