On the ESPHome side, this is what I have. I did not find any info at all on how to do what I need, so this is what I am starting with.
esphome:
name: esp-01s-1
friendly_name: ESP-01S-1
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "[REDACTED]"
ota:
- platform: esphome
password: "[REDACTED]"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp-01S-1 Fallback Hotspot"
password: "[REDACTED]"
captive_portal:
web_server:
port: 80
binary_sensor:
- platform: gpio
name: "GE Wireless Outlet"
pin:
number: GPIO3
inverted: false
mode:
input: true
pullup: false
remote_receiver:
dump: "all" # I haven't figured out the actual protocol.
filter: 150us
pin:
number: GPIO2
inverted: false
mode:
input: true
pullup: true
remote_transmitter:
pin: GPIO1
carrier_duty_percent: 100%
What I need to do is receive data on GPIO2. If the data matches what I have set as the correct info, then send that out GPIO1. It’s not specific to RF or IR. It should work with any data coming in on a pin. But my use case is RF, obviously.
For Tasmota, there is no code (that I know of). It’s just UI configs and dropdowns. And in the pin assignment screen, Tasmota offers no option for a simple digital input, or at least I haven’t figured out which one it is. The Tasmota data forwarding setup was trivial, using rules:
Rule1 on RfReceived#Data=0x12 do RfSend {"data":0x12,"bits":24,"protocol":1,"repeat":4,"pulse":211} endon
Rule2 on RfReceived#Data=0x14 do RfSend {"data":0x14,"bits":24,"protocol":1,"repeat":4,"pulse":211} endon
But I can’t find any way to make GPIO3 connected to the relay a binary sensor in Tasmota. It needs to just tell me that the relay is engaged or not, and look like something useful, but read-only in HA. All the options I’ve tried (switch, button, light and relay) result in something the user is expected to be able to set, which is not right. Or it doesn’t show up in HA at all.
At the moment, I need to take the device apart and re-flash it over serial. I tried going from ESPHome to Tasmota with the Tasmota minimal firmware. But I failed to remember the Tasmota firmware would not have any network config, and the minimal firmware doesn’t have the captive portal for setting up the WiFi. So, until re-flashed, it’s down. Will be doing that tonight.