Advertisement
jesserockz

garage.yaml

Jan 27th, 2021
1,004
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.72 KB | None | 0 0
  1. - platform: ultrasonic
  2.   trigger_pin: GPIO5
  3.   echo_pin: GPIO4
  4.   update_interval: 100ms
  5.   # name: "${friendly_name} Door Distance"
  6.   id: distance
  7.   timeout: 3m
  8.   filters:
  9.   - median:
  10.       window_size: 5
  11.       send_every: 5
  12.       send_first_at: 3
  13.   - sliding_window_moving_average:
  14.       window_size: 5
  15.       send_every: 2
  16.       send_first_at: 1
  17.   - delta: 0.05
  18.   on_value:
  19.   - lambda: 'id(internal_door_position).publish_state(x);'
  20.  
  21. - platform: template
  22.   id: internal_door_position
  23.   update_interval: never
  24.   filters:
  25.   - calibrate_linear:
  26.     # < 0.8m = 1.0 so the cover knows it is open
  27.     - 0.8 -> 1.0
  28.     # > 2.8m = 0.0 so the cover knows it is closed
  29.     - 2.8 -> 0.0
  30.   - lambda: 'return clamp(x, 0.0, 1.0);'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement