-
Notifications
You must be signed in to change notification settings - Fork 3
/
print_progress_display.yaml
55 lines (47 loc) · 1.06 KB
/
print_progress_display.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
esphomeyaml:
name: print_progress_display
platform: ESP8266
board: d1_mini
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_psk
api:
logger:
ota:
binary_sensor:
- platform: homeassistant
id: prusa_printing
entity_id: binary_sensor.prusa_printing
filters:
- delayed_off: 1h
- platform: homeassistant
id: ender_printing
entity_id: binary_sensor.ender_printing
filters:
- delayed_off: 1h
sensor:
- platform: homeassistant
id: prusa_job_percentage
entity_id: sensor.prusa_job_percentage
- platform: homeassistant
id: ender_job_percentage
entity_id: sensor.ender_job_percentage
spi:
clk_pin: D0
mosi_pin: D1
display:
- platform: max7219
id: seg_display
cs_pin: D2
num_chips: 1
lambda: |-
if(id(prusa_printing).state) {
it.printf("%.0f", id(prusa_job_percentage).state);
} else {
it.print(" ");
}
if(id(ender_printing).state) {
it.printf(4, "%4.0f", id(ender_job_percentage).state);
} else {
it.print(4, " ");
}