Skip to content

Commit

Permalink
Restart btproxy if no scan within 10 minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
dotdoom committed Jan 23, 2025
1 parent 202fd92 commit d060aa8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions templates/btproxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,19 @@ esp32_ble_tracker:
- sensor.template.publish:
id: ble_scans_finished
state: !lambda 'return ++id(ble_scans);'
- script.execute: restart_after_delay

bluetooth_proxy:
id: btproxy
active: true

script:
- id: restart_after_delay
mode: restart
then:
- delay: 10min
- button.press: restart_button

sensor:
- platform: template
name: "btproxy connections free"
Expand Down
1 change: 1 addition & 0 deletions templates/restart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ button:
- platform: restart
name: "ESP chip restart"
entity_category: diagnostic
id: restart_button

0 comments on commit d060aa8

Please sign in to comment.