annotate li-rf-recv.yaml @ 3:711019bc4357

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