Mercurial > code > home > repos > homeauto
annotate espNode/rf_switch_desk.yaml @ 1739:28a3e35bc23f
mqtt server & options
author | drewp@bigasterisk.com |
---|---|
date | Fri, 01 Sep 2023 17:12:06 -0700 |
parents | c480732442ec |
children | e9f3c2317cf8 |
rev | line source |
---|---|
1701 | 1 # facing the receiver board, |
2 # pins: 3v3 | (cs) | D15 | gnd | |
3 | |
804
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
4 esphome: |
1701 | 5 name: rf_switch_desk |
804
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
6 platform: esp32 |
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
7 board: lolin32 |
1701 | 8 |
804
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
9 logger: |
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
10 baud_rate: 115200 |
1705 | 11 level: INFO |
804
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
12 |
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
13 wifi: |
1701 | 14 networks: |
1737 | 15 - ssid: !secret wifi_ssid |
16 password: !secret wifi_password | |
804
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
17 |
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
18 ota: |
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
19 |
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
20 mqtt: |
1739 | 21 broker: "mqtt2.bigasterisk.com" |
804
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
22 port: 1883 |
1737 | 23 username: "" |
24 password: "" | |
804
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
25 |
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
26 remote_receiver: |
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
27 - id: rf_in |
1701 | 28 pin: |
29 number: GPIO15 | |
804
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
30 tolerance: 20% |
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
31 filter: 250us |
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
32 idle: 8ms |
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
33 dump: rc_switch |
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
34 on_rc_switch: |
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
35 then: |
1737 | 36 # - logger.log: |
37 # level: INFO | |
38 # tag: out | |
39 # format: "RF read; proto %d; code %08llx" | |
40 # args: [x.protocol, x.code] | |
804
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
41 - mqtt.publish_json: |
1701 | 42 topic: rf_switch_desk/rf_received |
804
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
43 payload: !lambda |- |
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
44 root["protocol"] = x.protocol; |
1701 | 45 root["code0"] = static_cast<unsigned long>(x.code >> 32); |
804
771f19d632f6
working receiver for 433mhz wall switches
drewp@bigasterisk.com
parents:
diff
changeset
|
46 root["code1"] = static_cast<unsigned long>(x.code & 0xffff); |