-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilament-lamp.yaml
63 lines (56 loc) · 1.32 KB
/
filament-lamp.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
substitutions:
device_name: "Filament Lamp"
max_power: "220.0"
max_temp: "70.0"
esphome:
name: filament-lamp
esp32:
board: esp32doit-devkit-v1
packages:
wifi: !include /config/esphome/common/wifi.yaml
network_diagnostics: !include /config/esphome/common/network_diagnostics.yaml
base_config: !include /config/esphome/common/base_config.yaml
switch:
- platform: gpio
pin: 25
name: "${device_name} Relay"
id: relay
# Sensors with general information.
sensor:
# Rotary encoder
- platform: rotary_encoder
name: ${device_name} Dimmer Knob
id: encoder
pin_a: 26
pin_b: 27
publish_initial_value: true
resolution: 1
min_value: 0
max_value: 100
on_value:
then:
- light.turn_on:
id: filamentlamp
transition_length: 1s
brightness: !lambda |-
return id(encoder).state / 100;
output:
- platform: ac_dimmer
id: filamentlamp_dimmer
gate_pin: 32
zero_cross_pin:
number: 33
mode:
input: true
light:
- platform: monochromatic
name: ${device_name}
icon: mdi:globe-light-outline
output: filamentlamp_dimmer
id: filamentlamp
default_transition_length: 10s
restore_mode: ALWAYS_OFF
on_turn_on:
- switch.turn_on: relay
on_turn_off:
- switch.turn_off: relay