# HG changeset patch # User drewp@bigasterisk.com # Date 1719522044 25200 # Node ID 717d5b5e0d7d1d009cf03bd6cdeb40ac1494c5f2 # Parent f340f7a559dee1dfc2b4d0629a76a0a1858492b2 add first board diff -r f340f7a559de -r 717d5b5e0d7d do-rf-recv.yaml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/do-rf-recv.yaml Thu Jun 27 14:00:44 2024 -0700 @@ -0,0 +1,63 @@ +# 433mhz receiver board. Facing the board: +# pins: 3v3 | N.C. (cs) | D15 | gnd + +esphome: + # note for historical reasons, this doesn't match the mqtt topic + name: "do-rf-recv" + platform: esp32 + board: lolin32 + +logger: + level: INFO + +wifi: + networks: + - ssid: !secret wifi_ssid + password: !secret wifi_password + +ota: + platform: esphome + password: !secret ota_password + +mqtt: + id: mqtt_client + broker: "mqtt2.bigasterisk.com" + port: 1883 + +light: + - platform: status_led + id: "status_out" + pin: 2 + +remote_receiver: + - id: rf_in + pin: + number: GPIO15 + tolerance: 20% + filter: 250us + idle: 8ms + dump: rc_switch + on_rc_switch: + then: + # - logger.log: + # level: INFO + # tag: out + # format: "RF read; proto %d; code %08llx" + # args: [x.protocol, x.code] + - light.turn_on: + id: status_out + flash_length: 30ms + # legacy mode- read by nodered + - mqtt.publish_json: + topic: rf_switch_desk/rf_received + payload: !lambda |- + root["protocol"] = x.protocol; + root["code0"] = static_cast(x.code >> 32); + root["code1"] = static_cast(x.code & 0xffff); + - mqtt.publish: + topic: !lambda |- + return "rf_switch_desk/rf_received/" + + std::to_string(x.protocol) + + "/" + std::to_string(static_cast(x.code >> 32)) + + "/" + std::to_string(static_cast(x.code & 0xffff)); + payload: ""