Guest User

Untitled

a guest
Aug 22nd, 2024
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 4.56 KB | None | 0 0
  1. substitutions:
  2.   device_name: awesome-presence-office
  3.   device_name_pretty: Awesome Presence Office
  4.   pir_delay_on: 50ms
  5.   pir_delay_off: 500ms
  6.   combined_presence_delay_off: 15s
  7.  
  8.  
  9.  
  10. esphome:
  11.   name: $device_name
  12.   friendly_name: $device_name_pretty
  13.   platformio_options:
  14.    board_build.flash_mode: dio
  15.  
  16. esp32:
  17.   board: seeed_xiao_esp32c3
  18.   variant: esp32c3
  19.   framework:
  20.     type: arduino
  21.  
  22. # Enable logging
  23. logger:
  24. # Enable Home Assistant API
  25. api:
  26.   encryption:
  27.     key: !secret encryption_key
  28.  
  29. ota:
  30.   platform: esphome
  31.   password: !secret ota_password
  32.  
  33. wifi:
  34.   ssid: !secret wifi_ssid
  35.   password: !secret wifi_password
  36.  
  37.  
  38.  
  39. esp32_ble_tracker:
  40.   scan_parameters:
  41.     active: true
  42.  
  43. bluetooth_proxy:
  44.   active: true
  45.  
  46. esp32_improv:
  47.   authorizer: none
  48.  
  49.  
  50.  
  51.  
  52. ld2410:
  53.   id: ld2410_radar
  54.  
  55. uart:
  56.   tx_pin: 5
  57.   rx_pin: 4
  58.   baud_rate: 256000
  59.   parity: NONE
  60.   stop_bits: 1
  61.  
  62. number:
  63.   - platform: ld2410
  64.     timeout:
  65.       name: Radar Timeout
  66.     max_move_distance_gate:
  67.       name: Radar Max Move Distance
  68.     max_still_distance_gate:
  69.       name: Radar Max Still Distance
  70.     g0:
  71.       move_threshold:
  72.         name: g0 move threshold
  73.       still_threshold:
  74.         name: g0 still threshold
  75.     g1:
  76.       move_threshold:
  77.         name: g1 move threshold
  78.       still_threshold:
  79.         name: g1 still threshold
  80.     g2:
  81.       move_threshold:
  82.         name: g2 move threshold
  83.       still_threshold:
  84.         name: g2 still threshold
  85.     g3:
  86.       move_threshold:
  87.         name: g3 move threshold
  88.       still_threshold:
  89.         name: g3 still threshold
  90.     g4:
  91.       move_threshold:
  92.         name: g4 move threshold
  93.       still_threshold:
  94.         name: g4 still threshold
  95.     g5:
  96.       move_threshold:
  97.         name: g5 move threshold
  98.       still_threshold:
  99.         name: g5 still threshold
  100.     g6:
  101.       move_threshold:
  102.         name: g6 move threshold
  103.       still_threshold:
  104.         name: g6 still threshold
  105.     g7:
  106.       move_threshold:
  107.         name: g7 move threshold
  108.       still_threshold:
  109.         name: g7 still threshold
  110.     g8:
  111.       move_threshold:
  112.         name: g8 move threshold
  113.       still_threshold:
  114.         name: g8 still threshold
  115.  
  116. binary_sensor:
  117.   - platform: ld2410
  118.     has_target:
  119.       name: Radar Target
  120.       id: radar_has_target
  121.     has_moving_target:
  122.       name: Radar Moving Target
  123.     has_still_target:
  124.       name: Radar Still Target
  125.  
  126.   - platform: gpio
  127.     name: "PIR Sensor"
  128.     device_class: motion
  129.     pin:
  130.       number: 21
  131.       mode:
  132.         input: true
  133.         pulldown: true
  134.     id: pir_sensor
  135.     filters:
  136.       - delayed_on: $pir_delay_on
  137.       - delayed_off: $pir_delay_off
  138.  
  139.  
  140.  
  141.   - platform: template
  142.     name: "Combined Presence Sensor"
  143.     lambda: |-
  144.       if (id(pir_sensor).state) {
  145.         return true;
  146.       } else if (!id(radar_has_target).state) {
  147.         return false;
  148.       }
  149.       return {};
  150.     device_class: motion
  151.     filters:
  152.       - delayed_off: $combined_presence_delay_off
  153.  
  154. sensor:
  155.   - platform: ld2410
  156.     moving_distance:
  157.       name: Radar Moving Distance
  158.       id: moving_distance
  159.     still_distance:
  160.       name: Radar Still Distance
  161.       id: still_distance
  162.     moving_energy:
  163.       name: Radar Move Energy
  164.     still_energy:
  165.       name: Radar Still Energy
  166.     detection_distance:
  167.       name: Radar Detection Distance
  168.       id: radar_detection_distance
  169.     g0:
  170.       move_energy:
  171.         name: g0 move energy
  172.       still_energy:
  173.         name: g0 still energy
  174.     g1:
  175.       move_energy:
  176.         name: g1 move energy
  177.       still_energy:
  178.         name: g1 still energy
  179.     g2:
  180.       move_energy:
  181.         name: g2 move energy
  182.       still_energy:
  183.         name: g2 still energy
  184.     g3:
  185.       move_energy:
  186.         name: g3 move energy
  187.       still_energy:
  188.         name: g3 still energy
  189.     g4:
  190.       move_energy:
  191.         name: g4 move energy
  192.       still_energy:
  193.         name: g4 still energy
  194.     g5:
  195.       move_energy:
  196.         name: g5 move energy
  197.       still_energy:
  198.         name: g5 still energy
  199.     g6:
  200.       move_energy:
  201.         name: g6 move energy
  202.       still_energy:
  203.         name: g6 still energy
  204.     g7:
  205.       move_energy:
  206.         name: g7 move energy
  207.       still_energy:
  208.         name: g7 still energy
  209.     g8:
  210.       move_energy:
  211.         name: g8 move energy
  212.       still_energy:
  213.         name: g8 still energy
  214.  
  215.  
  216. switch:
  217.   - platform: ld2410
  218.     engineering_mode:
  219.       name: "engineering mode"
  220.     bluetooth:
  221.       name: "control bluetooth"
  222.      
  223. button:
  224.   - platform: restart
  225.     name: "Restart ESPHome Device"    
  226.  
Advertisement
Add Comment
Please, Sign In to add comment