-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteckin.sp20.yaml
52 lines (45 loc) · 945 Bytes
/
teckin.sp20.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
<<: !include chip.esp8266.yaml
<<: !include common.yaml
sensor: !include_dir_merge_list teckin.sp20.sensor
# teckin1-pending.yaml
#substitutions:
# id: teckin1
# plug_type: teckin.sp20
# board: esp01_1m
# display_name: "Teckin1"
# relay_restore: "RESTORE_DEFAULT_OFF"
#<<: !include "esphome_templates/teckin.sp20.yaml"
#debug:
#logger:
# level: debug
# GPIO0 - red led
# GPIO2 - blue led
status_led:
pin:
number: GPIO0
inverted: true
switch:
- platform: gpio
id: led2
pin:
number: GPIO2
inverted: true
- platform: gpio
id: relay
restore_mode: "${relay_restore}"
pin: GPIO4
name: "${display_name}"
on_turn_on:
- switch.turn_on: led2
on_turn_off:
- switch.turn_off: led2
binary_sensor:
- platform: gpio
id: button
pin:
number: GPIO13
inverted: true
name: "${display_name} Button"
on_press:
- switch.toggle: relay
internal: true