-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtruck_locker.yml
85 lines (71 loc) · 1.75 KB
/
truck_locker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
substitutions:
name: "truck-locker"
friendly_name: Truck Locker
esphome:
name: ${name}
friendly_name: ${friendly_name}
min_version: 2024.6.0
name_add_mac_suffix: false
project:
name: esphome.web
version: '1.0'
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
# Allow Over-The-Air updates
ota:
- platform: esphome
# Allow provisioning Wi-Fi via serial
improv_serial:
wifi:
# Set up a wifi access point
ap: {}
# In combination with the `ap` this allows the user
# to provision wifi credentials to the device via WiFi AP.
captive_portal:
dashboard_import:
package_import_url: github://esphome/example-configs/esphome-web/esp8266.yaml@main
import_full_config: true
# Enable web server
web_server:
# Define the GPIO output
output:
- platform: gpio
pin: GPIO5
id: momentary_output
# Define the switch to control the output
switch:
- platform: output
name: "Momentary Output"
output: momentary_output
id: momentary_switch
internal: true
# Define the button on the web server
button:
- platform: template
name: "Momentary Button"
on_press:
then:
- switch.turn_on: momentary_switch
- delay: 500ms
- switch.turn_off: momentary_switch
# Schedule the button press at 12:30 AM using time-based automation
time:
- platform: homeassistant
id: homeassistant_time
on_time:
- seconds: 0
minutes: 05
hours: 0
then:
- logger.log: "Locked via Automation"
- switch.turn_on: momentary_switch
- delay: 500ms
- switch.turn_off: momentary_switch
- delay: 1000ms
- switch.turn_on: momentary_switch
- delay: 500ms
- switch.turn_off: momentary_switch