I have a FS1000A transmitter which I would like to get working with an ESPHome. The transmitter itself has been tested to work fine on a raspberry pi using the following code:
RCSwitch mySwitch = RCSwitch();
mySwitch.setProtocol(4);
mySwitch.setPulseLength(320);
mySwitch.send("0110010110011010001101000110");
I tried to get the transmitter working on both ESP32 and ESP32C3, here’s the config from my ESP32C3:
esphome:
name: esphome-dev
friendly_name: esphome-dev
esp32:
board: esp32-c3-devkitm-1
framework:
type: arduino
# 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
remote_transmitter:
pin: GPIO1
rmt_channel: 1
# RF uses a 100% carrier signal
carrier_duty_percent: 100%
remote_receiver:
pin: GPIO0
dump: rc_switch
# Settings to optimize recognition of RF devices
tolerance: 50%
filter: 250us
idle: 4ms
rmt_channel: 2
# buffer_size: 2kb # only for ESP8266
binary_sensor:
- platform: remote_receiver
name: "D_ON"
rc_switch_raw:
code: '0110010110011010001101000110'
protocol:
pulse_length: 320
filters:
- delayed_off:
500ms
button:
- platform: template
name: RF Power Button
on_press:
- remote_transmitter.transmit_rc_switch_raw:
code: '0110010110011010001101000110'
protocol:
pulse_length: 320
sync: [1,6]
zero: [1,3]
one: [3,1]
inverted: False
I also tried it without having a receiver attached simultaneously, but that did not change anything. Potential problems:
- in the code on the raspi, I set protocol to 4 and changed the pulse length. On esphome, only one of the two is possible, I think. Therefore, I defined the protocol completely to correspond with the RCSwitch protocol 4.
- esphome seems to swallow the last bit of the payload. If I click the button defined above, I see the following in the log:
[11:09:35][D][button:010]: 'RF Power Button' Pressed.
[11:47:09][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=4 data='011001011001101000110100011'
In comparison, when I send the signal from the raspi the plug is switched on and the binary_sensor defined above is triggered. The log I get is the following:
[11:48:22][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='0110010110011010001101000110'
Interestingly, it’s caught as protocol 1, whereas the above is caught as protocol 4.
Obviously, the plug is not turning on with the ESPHome which is the reason fot this thread…
Another strange thing: the signals sent from the ESP are not showing up in an openmqttgateway I have running. However, it cannot be an antenna problem, because if I use this transmitter on my raspi and execute the code above, openmqttgateway catches the signal.