LEDs, 433mhz, Home Assistant, NodeMCU

Cannot get the damn signal to send to the controller… One TX’er came busted are the other two broken as well? Connect to 5V [VIN & Gnd], DATA on D1. 17.3cm antenna.Controller is under the deckboard in the picture below

What am I doing wrong? Is WiFI messing with the signal? I have tried almost everything! Let me know if you need more info.


Amazon.ca


Amazon.ca


Codes from RC-SWITCH

Sending Binary using ESP-Home with following code:

remote_transmitter:
  pin: D1
  # RF uses a 100% carrier signal
  carrier_duty_percent: 100%
  
switch:
  - platform: template
    name: Patio_Lights_Power_Button
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '010000000100010100000001'
          protocol: 1
          repeat: 3

Maybe try first with the rcswitch basic example and see if you succeed. I would began by sending the decimal value with the pulselength and the protocol specified.

So!!! Basic example is working!!! Thanks for you reply 1technophile totally read your blog on MQTT and it was helpful. I cannot set pulse_length in esphome is anyone able to provide proper indentation or code for the YAML? Without it its not working. Could it be wifi?

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
 mySwitch.enableTransmit(0);
 mySwitch.setProtocol(1, 396); 
 Serial.begin(9600);
}

void loop() {
 mySwitch.send("010000000100010100000001");
 Serial.print("Sent Code On [4211969]\n");
 delay(5000);
 mySwitch.send("010000000100010100000011");
 Serial.print("Sent Code Off [4211971]\n");
 delay(5000);
}

That work in PlatformIO, I just cant get it to work with esphome… I feel like when I specify pulse length the other setting defaults aren’t correct. Or am I using esphome incorrectly? Is there anywyay to get home assistant to trigger the platformIO code? I am so close I can taste it.

remote_transmitter:
  pin: D1
  
  # RF uses a 100% carrier signal
  carrier_duty_percent: 100%
  
switch:
  - platform: template
    name: Patio_Lights_Power_Button
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '010000000100010100000001'
          protocol: 
            pulse_length: 396

ESPHOME Code

Found out how to pulse code but defaults still dont work. At the end of the day I could make it dumb and code everything platformIO but esphome is using rcswitch.h so I dont get it…

Opened an issue @ Github – this is starting to sound like a bug, it works in PlatformIO which is making me believe it could be RC-Switch’s version of implemented in ESPhome?

More info here:
https://github.com/esphome/issues/issues/508

I suppose you means, it works with platformio and rcswitch examples?

Correct! :slight_smile:

I am super lost though – hoping the dev can help me figure this one out because I have reached my top in terms of understanding. I don’t know what the difference between the two is. Someone else opened up a very similiar ticket a few days ago so maybe its not anything I am doing wrong. Going to try repeat: 10 as well.

The issue is that with raw you are not giving pulse length and protocol isn’t it?
That’s why it is working with the RCSwitch examples (on which you give these infos).

So if you click on the link [github ticket] youll see that I do infact specify the protocol and still nothing :frowning:

esphome:
  name: nodemcu_patiolights
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: --
  password: --
    
  manual_ip:
    static_ip: 192.168.1.198
    gateway: 192.168.1.1
    subnet: 255.255.255.0
# Enable logging
logger:

# Enable Home Assistant API
api:
  password: --

ota:
  password: --
  
remote_transmitter:
  pin: D1
  # RF uses a 100% carrier signal
  carrier_duty_percent: 100%
  
switch:
  - platform: template
    name: Patio_Lights_Power_Button
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '010000000100010100000001'
          protocol: 
            pulse_length: 396
# Dont really need to specify these because they are default but I do anyway
            sync: [1,31]
            zero: [1,3]
            one: [3,1]
            inverted: false
# tried this as well, but if PlatformIO&RCSwitch example no repeat is needed
          repeat: 10

Using known RCSwitch protocol-1 values from https://github.com/sui77/rc-switch/blob/a9da9c36820b02fc5613dfe2437e1187bcf5b402/RCSwitch.cpp#L76

Just keeping this thread updated with my own answers as a log for someone else…

Resolution

esphome:
  name: nodemcu_patiolights
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid:--
  password: --
    
  manual_ip:
    static_ip: 192.168.1.198
    gateway: 192.168.1.1
    subnet: 255.255.255.0
# Enable logging
logger:

# Enable Home Assistant API
api:
  password: --

ota:
  password: --
  
remote_transmitter:
  pin: D1
  # RF uses a 100% carrier signal
  carrier_duty_percent: 100%
  
switch:

  - platform: template
    name: LED_Controller_Power_ON
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '010000000100010100000001'
          protocol: 
            pulse_length: 396
            sync: [1,31]
            zero: [1,3]
            one: [3,1]
            inverted: false
          repeat: 3
  - platform: template
    name: LED_Controller_Power_OFF
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '010000000100010100000011'
          protocol: 
            pulse_length: 396
            sync: [1,31]
            zero: [1,3]
            one: [3,1]
            inverted: false
          repeat: 3
          
  - platform: template
    name: LED_Controller_Power_LIGHT
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '010000000100010100000100'
          protocol: 
            pulse_length: 396
            sync: [1,31]
            zero: [1,3]
            one: [3,1]
            inverted: false
          repeat: 3

  - platform: template
    name: LED_Controller_Power_100
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '010000000100010100000111'
          protocol: 
            pulse_length: 396
            sync: [1,31]
            zero: [1,3]
            one: [3,1]
            inverted: false
          repeat: 3
          
  - platform: template
    name: LED_Controller_Power_50
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '010000000100010100001000'
          protocol: 
            pulse_length: 396
            sync: [1,31]
            zero: [1,3]
            one: [3,1]
            inverted: false
          repeat: 3
          
  - platform: template
    name: LED_Controller_Power_25
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '010000000100010100001001'
          protocol: 
            pulse_length: 396
            sync: [1,31]
            zero: [1,3]
            one: [3,1]
            inverted: false
          repeat: 3

Description of Resolution:
Not sure if specifying the values for sync,zero,one, inverted made it work because the defaults weren’t ‘kicking in’. Or whether the repeat 3 is what did it. Not sure but if I had to make an educated guess my signal not transmitting is somehow related to this