annotate li-rf-recv.yaml @ 17:93387cf78ad3

more modeling
author drewp@bigasterisk.com
date Fri, 02 Aug 2024 22:43:18 -0700
parents 7914d368d7b2
children
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 name: "li-rf-recv"
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
6 platform: esp32
5
7914d368d7b2 more boards
drewp@bigasterisk.com
parents: 3
diff changeset
7 board: lolin32
3
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
8
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
9 logger:
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
10 level: INFO
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
11
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
12 wifi:
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
13 networks:
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
14 - ssid: !secret wifi_ssid
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
15 password: !secret wifi_password
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
16
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
17 ota:
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
18 platform: esphome
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
19 password: !secret ota_password_1
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
20
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
21 mqtt:
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
22 id: mqtt_client
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
23 broker: "mqtt2.bigasterisk.com"
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
24
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
25 light:
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
26 - platform: status_led
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
27 id: "status_out"
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
28 pin: 2
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
29
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
30 remote_receiver:
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
31 - id: rf_in
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
32 pin:
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
33 number: GPIO15
5
7914d368d7b2 more boards
drewp@bigasterisk.com
parents: 3
diff changeset
34 tolerance: 30%
3
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
35 filter: 250us
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
36 idle: 8ms
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
37 dump: rc_switch
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
38 on_rc_switch:
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
39 then:
5
7914d368d7b2 more boards
drewp@bigasterisk.com
parents: 3
diff changeset
40 # - logger.log:
7914d368d7b2 more boards
drewp@bigasterisk.com
parents: 3
diff changeset
41 # level: INFO
7914d368d7b2 more boards
drewp@bigasterisk.com
parents: 3
diff changeset
42 # tag: out
7914d368d7b2 more boards
drewp@bigasterisk.com
parents: 3
diff changeset
43 # format: "RF read; proto %d; code %08llx"
7914d368d7b2 more boards
drewp@bigasterisk.com
parents: 3
diff changeset
44 # args: [x.protocol, x.code]
3
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
45 - light.turn_on:
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
46 id: status_out
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
47 flash_length: 30ms
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
48 - mqtt.publish:
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
49 topic: !lambda |-
5
7914d368d7b2 more boards
drewp@bigasterisk.com
parents: 3
diff changeset
50 return "li-rf-recv/rf_received/" +
3
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
51 std::to_string(x.protocol) +
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
52 "/" + std::to_string(static_cast<unsigned long>(x.code >> 32)) +
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
53 "/" + std::to_string(static_cast<unsigned long>(x.code & 0xffff));
711019bc4357 more boards
drewp@bigasterisk.com
parents:
diff changeset
54 payload: ""