"SONOFF Clone" - Mini-ESP8266 Power AC Relay Controller

it means how strong your wifi is. -65dB is about the minimum for a decent wifi connection. -70dB is a lousy connection and everything above -60dB is considered good enough for streaming applications like VOIP and video

1 Like

thanks

1 Like

Sorry. Perhaps I took the word ā€œcloneā€ too literally. Obviously, more sophisticated switching devices are useful variants of the Sonoff, but donā€™t fall under a strict definition of the word clone.

On a side note, the Blynk discussion forum is usually a pretty friendly place. We can always disagree without resorting to insult. :grimacing:

1 Like

Agreedā€¦ @PiWiFio please edit last line in your post, thanks.

woah ragey mc rager over hereā€¦

1 Like

Best wishes to you and your future.

Iā€™m retired. :wink:

Haha lucky for some!

And from this forum as well :wink: Thanks for restoring his deleted posts @Jamin

Hello there. What part of sketch do I need to change to make it work with normally open connection? Meaning SWITCH_PIN LOW instead of HIGH and vice versa? I tried to do that with no luck
BR

Hey Zbx!

Sorry its taken so long to reply.

You just need to invert the bits on the following lines:

^^ Change 1 to 0

^^ Change 0 to 1

Inverted! :slight_smile:

in code where i put ssid and pass ssid? and which ouput pins are selected in the blynk app? I do not run for a local serverā€¦thx

All in settings.h

@Jamin

HI
here is part of my sketch for a (+ve) activated Relay

/******************************************************************************
 *
 *                             switch.h
 *
 *****************************************************************************/

  BlynkTimer timer;

  int SwitchState, timer1, SwitchDelay;

  WidgetBridge gate(vPIN_BRIDGE_GATE);

  BLYNK_CONNECTED() {
gate.setAuthToken("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
  }

  void Switch_OFF() {
digitalWrite(RELAY_PIN, 0);
Blynk.virtualWrite(vPIN_BUTTON_MANUAL, 0);
Blynk.virtualWrite(vPIN_LED, 0);
  }

  void Switch_ON() {
digitalWrite(RELAY_PIN, 1);
Blynk.virtualWrite(vPIN_BUTTON_MANUAL, 1);
Blynk.virtualWrite(vPIN_LED, 255);
  }

  void Switch_Toggle(bool state) {
digitalWrite(RELAY_PIN, state);
SwitchState = digitalRead(RELAY_PIN);
if (SwitchState) { SwitchState = 255;
Blynk.virtualWrite(vPIN_LED, SwitchState);
  }else{  SwitchState = 0; 
Blynk.virtualWrite(vPIN_LED, SwitchState);
  }
  }

  BLYNK_WRITE(vPIN_BUTTON_TIMEOUT) { // remote delay Switch
if ((digitalRead(RELAY_PIN))== 0)  
  Switch_ON();
  timer.setTimeout(SwitchDelay, Switch_OFF);
}

  BLYNK_WRITE(vPIN_BUTTON_MANUAL) { // manual button
Switch_Toggle(param.asInt());
  }

  BLYNK_WRITE(vPIN_TIMER) { // timer Switch
if (param.asInt()) {
  Switch_ON();
  gate.virtualWrite(vPIN_BRIDGE_GATE, param.asInt());
} else {
  Switch_OFF();
}
  }

  BLYNK_WRITE(vPIN_SLIDER_TIMEOUT) {
SwitchDelay = param[0].asInt() * 60000;
Blynk.syncVirtual(vPIN_BUTTON_TIMEOUT);
  }
/*---------------------------------------------------------------------------*/

My Smart Plug
Thanks to Jamin

3 Likes

That is awesome @Ze_Pico! I need to make a smaller package like this :slight_smile:

May I ask what you used as a power supply for the esp :slight_smile:

@Jamin
@Fettkeewl

A cube ā€œChineseā€ USB Charger + 3.3V Regulator

1 Like

Thanks. Love the title, dangerous :stuck_out_tongue:

1 Like

Looks cool! :clap:

Whatā€™s the BOM?