Aircoookie / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi!
https://kno.wled.ge
MIT License
14.68k stars 3.16k forks source link

(Request) RF remotes 433Mhz #3269

Open th3alex14 opened 1 year ago

th3alex14 commented 1 year ago

there are some 433mh led remote controls. Is there a way to use them. so you can have longer range

blazoncek commented 1 year ago

Not without additional hardware and custom usermod.

th3alex14 commented 1 year ago

i got the hardware and the codes in binary or hex of the remote and tried to write a user mod maybe someone with programming knowledge could take a look

include

include "wled.h"

include "led.cpp"

include "ir.cpp"

include "ir_codes.h"

RCSwitch mySwitch = RCSwitch();

define on_1 2803457

define auto_1 2803458

define Off_1 2803459

define S_plus 2803460

define M_plus 2803461

define brig_plus 2803462

define S_minus 2803463

define M_minus 2803464

define brig_minus 2803465

define red 2803466

define green 2803467

define lila 2803468

define yellow 2803469

define yellow2 2803470

define orange 2803471

define baech 2803472

define blue 2803473

define blue2 2803474

define lila2 2803475

define green2 280376

define white 2803477

define Pin 23

class rfresiver : public Usermod { private: uint8_t lastValidCode = 0;

public: void setup() { Serial.begin(9600); mySwitch.enableReceive(32); }

void loop() { if (mySwitch.available()) { uint32_t value = mySwitch.getReceivedValue(); if (value != lastValidCode) { Serial.print("Received value: "); Serial.println(value); lastValidCode = value;

    switch (value) {
      case on_1:
        bri = briLast;
        break;
      case Off_1:
        toggleOnOff() ; 
        break;
      case auto_1:
        presetFallback(3, FX_MODE_FIRE_FLICKER, 0); 
        break;
      case S_plus:
        changeEffectSpeed( 16);
        break;
      case S_minus:
         changeEffectSpeed(-16); 
        break;
      case M_plus:
        changeEffect(relativeChange(effectCurrent, 1, 0, strip.getModeCount() -1));
        break;
      case M_minus:
         changePalette(relativeChange(effectPalette, 1, 0, strip.getPaletteCount() -1));
        break;
      case brig_plus:
        incBrightness(); 
        break;
      case brig_minus:
        decBrightness();    
        break;
      case red:
        changeColor(COLOR_RED);   
        break;
      case green:
         changeColor(COLOR_GREEN);  
        break;
      case lila:
        changeColor(COLOR_PURPLE); 
        break;
      case yellow:
        changeColor(COLOR_YELLOW);
        break;
      case yellow2:
        changeColor(COLOR_YELLOWISH);
        break;
      case orange:
        changeColor(COLOR_ORANGE); 
        break;
      case baech:
        changeColor(COLOR_WARMWHITE2); 
        break;
      case blue:
        changeColor(COLOR_BLUE); 
        break;
      case blue2:
        changeColor(COLOR_DEEPBLUE); 
        break;
      case lila2:
        changeColor(COLOR_PINK);   
        break;
      case green2:
        changeColor(COLOR_GREENISH); 
        break;
      case white:
        changeColor(COLOR_WHITE);  
        break;
      default:
        break;
    }
  }
  mySwitch.resetAvailable();
}

} };

blazoncek commented 1 year ago

Take a look at #3237

tarontop commented 1 year ago

Athom has this kind of controller, you can try

https://www.athom.tech/blank-1/wled-esp32-rf433-music-addressable-led-strip-controller

dosipod commented 1 year ago

Take a look at #3237 Is it possible to connect two MCUs running wled with espnow

blazoncek commented 1 year ago

Not yet, but perhaps in the future.

th3alex14 commented 1 year ago

I'm trying to write a usermod but for some reason the rc-switch libery works on esp32-3 but not on esp32 wroom Many i figure it out

softhack007 commented 1 year ago

You can grab a usermod here: https://github.com/athom-tech/Sound-Reactive-WLED/tree/master/usermods/RF433