-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathm5stamps3-device.yaml
98 lines (88 loc) · 2.09 KB
/
m5stamps3-device.yaml
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
86
87
88
89
90
91
92
93
94
95
96
97
98
esphome:
# Don't forget to change the name to something more meaningful
name: m5stamps3-device
# Flash mode 'dio' ist needed for M5StampS3 / ESP32 S3
platformio_options:
board_build.flash_mode: dio
# Action to start with a red status led after supplying power to the board
on_boot:
- priority: 600
then:
- light.turn_on:
id: status_led
red: 100%
green: 0%
blue: 0%
# Config for M5StampS3
esp32:
board: esp32-s3-devkitc-1
flash_size: 8MB
framework:
type: esp-idf
# Make the the onboard WS2812 / Neopixel LED on M5StampS3 usable.
# color_correct limits the max.brightness of the LED
light:
- platform: esp32_rmt_led_strip
id: status_led
internal: true
pin: GPIO21
num_leds: 1
rmt_channel: 0
rgb_order: GRB
chipset: ws2812
color_correct: [30%, 40%, 50%]
default_transition_length: 0s
effects:
- flicker:
# Use button in M5StampS3
# Flicker the LED for a short time when the button is pressed
binary_sensor:
- platform: gpio
id: surface_button
internal: true
pin:
number: GPIO0
inverted: true
mode:
input: true
pullup: false
pulldown: false
filters:
- delayed_on_off: 20ms
on_press:
then:
- light.turn_on:
id: status_led
flash_length: 200ms
red: 0%
green: 0%
blue: 100%
# Enable logging
logger:
# Enable Home Assistant API
api:
password: [YOUR API PASSWORD]
ota:
- platform: esphome
password: [YOUR OTA PASSWORD]
wifi:
ssid: [YOUR SSID]
password: [YOUR WIFI PASSWORD]
# Use some actions to show successfull wifi connection via status led
on_connect:
- light.turn_on:
id: status_led
red: 0%
green: 100%
blue: 0%
on_disconnect:
- light.turn_on:
id: status_led
red: 100%
green: 0%
blue: 0%
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "M5StampS3-Device"
password: [YOUR FALLBACK WIFI PASSWORD]
captive_portal: