3
|
1 # 433mhz receiver board. Facing the board:
|
|
2 # pins: 3v3 | N.C. (cs) | D15 | gnd
|
|
3
|
|
4 esphome:
|
|
5 name: "li-rf-recv"
|
|
6 platform: esp32
|
5
|
7 board: lolin32
|
3
|
8
|
|
9 logger:
|
|
10 level: INFO
|
|
11
|
|
12 wifi:
|
|
13 networks:
|
|
14 - ssid: !secret wifi_ssid
|
|
15 password: !secret wifi_password
|
|
16
|
|
17 ota:
|
|
18 platform: esphome
|
|
19 password: !secret ota_password_1
|
|
20
|
|
21 mqtt:
|
|
22 id: mqtt_client
|
|
23 broker: "mqtt2.bigasterisk.com"
|
|
24
|
|
25 light:
|
|
26 - platform: status_led
|
|
27 id: "status_out"
|
|
28 pin: 2
|
|
29
|
|
30 remote_receiver:
|
|
31 - id: rf_in
|
|
32 pin:
|
|
33 number: GPIO15
|
5
|
34 tolerance: 30%
|
3
|
35 filter: 250us
|
|
36 idle: 8ms
|
|
37 dump: rc_switch
|
|
38 on_rc_switch:
|
|
39 then:
|
5
|
40 # - logger.log:
|
|
41 # level: INFO
|
|
42 # tag: out
|
|
43 # format: "RF read; proto %d; code %08llx"
|
|
44 # args: [x.protocol, x.code]
|
3
|
45 - light.turn_on:
|
|
46 id: status_out
|
|
47 flash_length: 30ms
|
|
48 - mqtt.publish:
|
|
49 topic: !lambda |-
|
5
|
50 return "li-rf-recv/rf_received/" +
|
3
|
51 std::to_string(x.protocol) +
|
|
52 "/" + std::to_string(static_cast<unsigned long>(x.code >> 32)) +
|
|
53 "/" + std::to_string(static_cast<unsigned long>(x.code & 0xffff));
|
|
54 payload: ""
|