-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmj-s01.yaml
More file actions
159 lines (136 loc) · 3.41 KB
/
Copy pathmj-s01.yaml
File metadata and controls
159 lines (136 loc) · 3.41 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
---
###############################################################################
# Martin Jerry MJ-S01 Switch ESPHome configuration
###############################################################################
#
# Copyright (C) 2025 Joshua M. Boniface <joshua@boniface.me>
#
# Based on the original (no license provided) by @mjoshd and relicensed in
# good faith.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###############################################################################
esphome:
name: martin-jerry-mj-s01
name_add_mac_suffix: true
friendly_name: Martin Jerry MJ-S01
project:
name: "Joshua Boniface.Martin Jerry S01"
version: "1.0"
platformio_options:
build_flags:
- -DNDEBUG
- -Os
dashboard_import:
package_import_url: github://joshuaboniface/martinjerry-esphome/mj-s01/mj-s01.yaml
esp8266:
board: esp01_1m
restore_from_flash: true
logger:
level: WARN
baud_rate: 0
api:
reboot_timeout: 15min
ota:
platform: esphome
web_server:
port: 80
captive_portal:
mdns:
disabled: false
wifi:
ap: {}
domain: ""
reboot_timeout: 15min
power_save_mode: none
preferences:
flash_write_interval: 15s
button:
- platform: restart
name: "ESP8266 Restart"
icon: mdi:power-cycle
entity_category: diagnostic
- platform: factory_reset
name: "ESP8266 Factory Reset"
icon: mdi:restart-alert
entity_category: diagnostic
binary_sensor:
- platform: gpio
name: "Main Button"
id: main_button
pin:
number: GPIO13
mode: INPUT_PULLUP
inverted: true
on_press:
- if:
condition:
light.is_on: lightswitch
then:
- light.turn_off: lightswitch
else:
- light.turn_on: lightswitch
light:
- platform: binary
name: "Light"
id: lightswitch
output: relay
restore_mode: RESTORE_DEFAULT_OFF
on_turn_on:
- light.turn_on: blueled
- light.turn_off: redled
on_turn_off:
- light.turn_off: blueled
- light.turn_on: redled
- platform: status_led
name: "Status LED"
id: redled
restore_mode: RESTORE_DEFAULT_ON
pin:
number: GPIO04
inverted: true
- platform: status_led
name: "Power LED"
id: blueled
restore_mode: RESTORE_DEFAULT_OFF
pin:
number: GPIO05
inverted: true
output:
- platform: gpio
id: relay
pin:
number: GPIO12
sensor:
- platform: wifi_signal
name: "WiFi Signal"
update_interval: 60s
entity_category: diagnostic
- platform: uptime
name: "Uptime"
update_interval: 60s
entity_category: diagnostic
text_sensor:
- platform: version
name: "ESPHome Version"
entity_category: diagnostic
- platform: wifi_info
ip_address:
name: "WiFi IP Address"
ssid:
name: "WiFi SSID"
bssid:
name: "WiFi BSSID"
mac_address:
name: "WiFi MAC Address"