Note that the send command takes the number as a 16bit integer.
When I move the 315 MHz transmitter to the Raspberry Pi hosting my Hassio HomeAssistant, the implementation of RCSwitch doesn’t expose the bit length variable in the configuration. The variable is present in the HA python source just not available in the configuration.
I used the Etcher image on an SD card for a Raspberry Pi. My Docker skills are beginner level so I will need a tutorial to modify my HA image. I couldn’t find one on the forum.
The source code for HA core/switch.py looks straightforward. It calls the rpi-rf module so the bitlength variable is accessible.
A different solution solved my problem. The ESPHome remote_transmitter is an implementation of rc-switch for ESP chips that allows different word lengths.
I used an inexpensive Selae Logic Analyzer with the transmitter that came with the wireless outlet and captured the signals for on and off.
I then wrote this in the ESPHome yaml file for the ESP8266 device
The nice thing is that I can move the ESP8266 close to the receiver switch and I am not limited to keeping the transmitter next to the Raspberry Pi HA server. For the transmitter I am connecting the Vcc pin to the nodeMCU ESP8266 Vin pin- which has USB 5V rather than the 3.3V from the other pins.
The only issue is that the sync pulses are after the signal- where the keyfob transmitter sends sync followed by signal. The receiver outlet works but I don’t understand why the ESPHome remote_transmitter code doesn’t start the transmission with sync.