-
Notifications
You must be signed in to change notification settings - Fork 7
/
epaper.yaml
87 lines (71 loc) · 1.79 KB
/
epaper.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
esphome:
name: board1
platform: ESP32
board: esp32dev
<<: !include base.yaml
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pass
ap:
ssid: "Ttg Fallback Hotspot"
password: "zvmjI13rzTGs"
#captive_portal:
logger:
ota:
# Enable Home Assistant API
api:
### CUSTOM!!
binary_sensor:
- platform: homeassistant
entity_id: switch.tasmota_2
id: plug_204_state
#- platform: gpio
# pin:
# number: GPIO9
# inverted: true
# id: esp32_button_input_0
# on_click:
# then:
# - homeassistant.service:
# service: switch.toggle
# data:
# entity_id: switch.tasmota_2
sensor:
- platform: homeassistant
id: plug_204_power
entity_id: sensor.tasmota_energy_power_2
unit_of_measurement: 'W'
- platform: homeassistant
id: plug_204_voltage
unit_of_measurement: 'V'
entity_id: sensor.tasmota_energy_voltage_2
# Example configuration entry
spi:
clk_pin: GPIO23
mosi_pin: GPIO19
display:
- platform: waveshare_epaper
cs_pin: GPIO18
dc_pin: GPIO5
busy_pin: GPIO16
reset_pin: GPIO17
model: 1.54inv2
rotation: 90°
update_interval: 10s
lambda: |-
it.print(0,0,id(font_arial_12), "Hello!!!!!");
if(id(plug_204_state).has_state()) {
if (id(plug_204_state).state) {
it.print(16, 18, id(font_bebas_56), "TV CAMA: ON");
} else {
it.print(16, 18, id(font_bebas_56), "TV CAMA: OFF");
}
}
if (id(plug_204_power).has_state()) {
float pwr = id(plug_204_power).state;
if (pwr > 10.0) {
it.printf(16, 72, id(font_bebas_56), "%.1f W", id(plug_204_power).state);
} else {
it.printf(16, 72, id(font_bebas_56), "%.1f W", id(plug_204_power).state);
}
}