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