42 lines
819 B
YAML
42 lines
819 B
YAML
---
|
|
at581x:
|
|
id: "Radar"
|
|
i2c_id: bus_a
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: ${pin_presence}
|
|
name: "Presence detect"
|
|
disabled_by_default: false
|
|
device_class: "occupancy"
|
|
filters:
|
|
- delayed_off: !lambda return id(radar_delayed_off).state * 1000;
|
|
on_press:
|
|
then:
|
|
- light.turn_on: led
|
|
on_release:
|
|
then:
|
|
- light.turn_off: led
|
|
|
|
number:
|
|
- platform: template
|
|
name: "Presence duration"
|
|
id: radar_delayed_off
|
|
icon: mdi:account-clock
|
|
optimistic: true
|
|
restore_value: true
|
|
initial_value: 60
|
|
min_value: 0
|
|
step: 5
|
|
max_value: 300
|
|
unit_of_measurement: s
|
|
entity_category: config
|
|
mode: box
|
|
|
|
switch:
|
|
# Switch to turn on/off RF emission
|
|
- platform: at581x
|
|
at581x_id: "Radar"
|
|
name: "Enable Radar"
|