annotate tt-console.yaml @ 19:075b7e4854ba

wip rocks
author drewp@bigasterisk.com
date Sat, 03 Aug 2024 17:24:17 -0700
parents 5a80f3f2be8d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
1 # mac 3c:71:bf:ab:6e:94
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
2
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
3 esphome:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
4 name: "tt-console"
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
5 platform: esp32
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
6 board: lolin32
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
7
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
8 logger:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
9 baud_rate: 0
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
10 level: DEBUG
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
11 logs:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
12 out: DEBUG
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
13
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
14 wifi:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
15 networks:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
16 - ssid: !secret wifi_ssid
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
17 password: !secret wifi_password
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
18
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
19 ota:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
20 platform: esphome
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
21
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
22 sensor:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
23 - platform: wifi_signal
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
24 name: "wifi_signal"
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
25 update_interval: 60s
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
26
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
27 mqtt:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
28 id: mqtt_client
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
29 broker: "mqtt2.bigasterisk.com"
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
30 on_json_message:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
31 - topic: theater_blaster/ir_out/volume_up
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
32 then:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
33 - remote_transmitter.transmit_nec:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
34 address: 0x4BB6
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
35 command: 0x40BF
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
36 repeat:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
37 times: !lambda |-
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
38 if (x.containsKey("times")) {
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
39 return x["times"];
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
40 }
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
41 return 1;
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
42 - topic: theater_blaster/ir_out/volume_down
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
43 then:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
44 - remote_transmitter.transmit_nec:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
45 address: 0x4BB6
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
46 command: 0xC03F
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
47 repeat:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
48 times: !lambda |-
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
49 if (x.containsKey("times")) {
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
50 return x["times"];
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
51 }
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
52 return 1;
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
53 on_message:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
54 - topic: theater_blaster/ir_out
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
55 payload: "input_bd"
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
56 then:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
57 - remote_transmitter.transmit_nec:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
58 address: 0x4B36
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
59 command: 0x31CE
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
60 - topic: theater_blaster/ir_out
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
61 payload: "input_cbl"
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
62 then:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
63 - remote_transmitter.transmit_nec:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
64 address: 0x4BB6
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
65 command: 0x708F
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
66 - topic: theater_blaster/ir_out
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
67 payload: "input_game"
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
68 then:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
69 - remote_transmitter.transmit_nec:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
70 address: 0x4BB6
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
71 command: 0xB04F
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
72 - topic: theater_blaster/ir_out
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
73 payload: "input_pc"
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
74 then:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
75 - remote_transmitter.transmit_nec:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
76 address: 0x4BB6
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
77 command: 0x39C6
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
78
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
79 remote_receiver:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
80 - id: ir_in
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
81 # CHO1838 receiver; sig|gnd|vcc 3v3
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
82 pin:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
83 number: GPIO27
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
84 mode: INPUT
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
85 inverted: True
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
86 dump: nec
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
87 - id: rf_in
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
88 pin: GPIO13
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
89 tolerance: 20%
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
90 filter: 250us
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
91 idle: 8ms
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
92 dump: rc_switch
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
93 on_rc_switch:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
94 then:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
95 - logger.log:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
96 level: INFO
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
97 tag: out
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
98 format: "RF read; proto %d; code %08llx"
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
99 args: [x.protocol, x.code]
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
100 - mqtt.publish:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
101 topic: !lambda |-
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
102 return "tt-console/rf_received/" +
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
103 std::to_string(x.protocol) +
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
104 "/" + std::to_string(static_cast<unsigned long>(x.code >> 32)) +
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
105 "/" + std::to_string(static_cast<unsigned long>(x.code & 0xffff));
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
106 payload: ""
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
107 remote_transmitter:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
108 id: ir_out
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
109 pin: GPIO14
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
110 carrier_duty_percent: 50%
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
111
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
112 #13 rf recv
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
113 #12 rf send
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
114 #https://www.passion-radio.com/img/cms/wifi-kit-32-pinout.png
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
115
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
116 #on_...:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
117 # - remote_transmitter.transmit_nec:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
118 # address: 0x1234
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
119 # command: 0x78AB
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
120
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
121 i2c:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
122 sda: 4
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
123 scl: 15
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
124
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
125 font:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
126 - file: "/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf"
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
127 id: font_vera
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
128 size: 20
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
129
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
130 display:
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
131 - platform: ssd1306_i2c
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
132 model: "SSD1306 128x64"
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
133 reset_pin: 16
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
134 address: 0x3C
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
135 lambda: |-
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
136 it.print(128/2, 0+6, id(font_vera), TextAlign::TOP_CENTER, "big cast erisk");
5a80f3f2be8d more boards, cams
drewp@bigasterisk.com
parents:
diff changeset
137 it.print(128/2, 64-6, id(font_vera), TextAlign::BOTTOM_CENTER ,"Volume 45");