forked from trip5/esphome-tm1650
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig_303wifilc01_minimal.yaml
71 lines (63 loc) · 1.52 KB
/
config_303wifilc01_minimal.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
esphome:
platform: ESP8266
board: esp01_1m
on_boot:
then:
- lambda: |-
id(tm_ds1302).read_time();
external_components:
- # Uncomment original repo when this PR is merged:
# - https://github.com/trombik/esphome-component-ds1302/pull/3
# source: github://trombik/esphome-component-ds1302@main
source: github://trip5/esphome-ds1302@main
components:
- ds1302
- source: github://buzzer13/esphome-components@main
components:
- tm1650
i2c:
- id: i2c_main
sda: 13
scl: 12
scan: true
time:
- platform: ds1302
id: tm_ds1302
cs_pin: GPIO5
dio_pin: GPIO14
clk_pin: GPIO16
update_interval: never
- platform: homeassistant
id: tm_hass
on_time_sync:
then:
- lambda: id(tm_ds1302).write_time();
status_led:
pin:
number: GPIO2
inverted: true
display:
- platform: tm1650
id: disp_tm1650
intensity: 1
length: 4
# Remapped due to the specific 303WIFILC01 wiring (described at the bottom)
segment_map: GBPEDCAF
update_interval: 500ms
lambda: |-
static int dot = 0;
if (++dot & 1) {
it.strftime("%H.%M", id(tm_ds1302).now());
} else {
it.strftime("%H%M", id(tm_ds1302).now());
}
# Segment mapping:
# Font Clock
# P 0b10000000 -> 0b00000001 G
# A 0b01000000 -> 0b00100000 B
# B 0b00100000 -> 0b10000000 P
# C 0b00010000 -> 0b00000100 E
# D 0b00001000 -> 0b00001000 D
# E 0b00000100 -> 0b00010000 C
# F 0b00000010 -> 0b01000000 A
# G 0b00000001 -> 0b00000010 F