-
Notifications
You must be signed in to change notification settings - Fork 0
/
krachmacher.yaml
88 lines (76 loc) · 1.7 KB
/
krachmacher.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
esphome:
name: krachmacher
friendly_name: krachmacher
esp8266:
board: esp01_1m
# Enable logging
logger:
ota:
platform: esphome
password: "8fd5374e68bff81e309da69b0b102ebf"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 10.0.8.13
subnet: 255.255.252.0
gateway: 10.0.8.1
dns1: 10.0.8.1
dns2: 1.1.1.1
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Krachmacher Fallback Hotspot"
password: "Gp4sfpJWpOfU"
captive_portal:
status_led:
pin:
number: RX
inverted: True
# Enable Home Assistant API
api:
encryption:
key: "+p5LV+KTeHkISiXVReysu3dYTBbS6aqCDojCiEeDdXk="
services:
- service: ring_cymbal
variables:
frequency_hz: int
duty_cycle: float
duration_ms: int
then:
- output.turn_on: cymbal
- output.set_level:
id: cymbal
level: !lambda "return duty_cycle;"
- output.esp8266_pwm.set_frequency:
id: cymbal
frequency: !lambda "return frequency_hz;"
- lambda: "id(cymbal_off_delay_ms) = duration_ms;"
- script.execute: turn_off_cymbal
mqtt:
broker: mqtt.int.vspace.one
globals:
- id: cymbal_off_delay_ms
type: int
restore_value: no
initial_value: '100'
script:
- id: turn_off_cymbal
mode: restart
then:
- delay: !lambda "return id(cymbal_off_delay_ms);"
- output.turn_off: cymbal
output:
- platform: esp8266_pwm
pin:
number: 2
inverted: True
id: cymbal
frequency: 10Hz
switch:
- platform: gpio
pin:
number: 0
inverted: True
name: "Spaceglocke"
icon: "mdi:bell"
id: bell