Finally, although still not know how or why, with this code everything works perfect.Anyway, I will keep trying to improve it, because there is an error with text on the push buttons, and will use switches.Obviously and I can not use a Esp8266-01, because I need more pins, therefore I will use Esp8266-12 or NodeMCU v.1.Also I want to add timers for some sockets.
The first step is already achieved.
We’ll be in touch.
Thanks a lot to all Blynkers !!!.
II had to remove the signs in include,to display everything.
include ESP8266WiFi.h>
include BlynkSimpleEsp8266.h>
include RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”; //insert here your token generated by Blynk
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, “xxxxxxxxx”, “xxxxxxxxx”); //insert here your SSID and password
I have removed all "Char*…,and i have put the codes into myswitch.send().
I have also removed myswitcht.SetProtocol,because de 1 is by default.I think tha’s all.
I already have my five remote sockets working fine.Now i want to use a timer on two of them,but this is not working.
I’m using timer widget in virtual pin,and a push button to trigger it.Also i’m using a led that illuminates when the timer goes on.When i press the button for timer,the socket and the led works,but only for one second.I have tried many times,with on and off times,but nothing works.Neither i have not found,a good example of use of timer widget.
I ned RTC?.Can you help me,please.
Thanks in advance.
Here i go with code:
BLYNK_WRITE(15)
{
if (param.asInt() == 1) {
mySwitch.send("010100000101010111000011");
Blynk.notify("RC433: Timer controlled Switch 2 is now ON");
led2.on();
}
else {
mySwitch.send("010100000101010111001100");
Blynk.notify("RC433: Timer controlled Switch 2 is now OFF");
led2.off();
}
}
Hi !!.
I have deleted the push button,and i left only timer widget and indicator led.The widget has the same virtual pin in code and the sketch.I have tried repeatedly differents on-off times,but the widget is not triggered.
Is the problem the time zone,or the time server?
I live in Puerto Rico,and here does not change hour for Summer/Winter.Now we have one hour more than Florida,or NY.
I also wanted to ask you about the text errors in push buttons.I have 1.16.4 version of Blynk app,and 0.3.8 version of library.
I guess the problem could relate to Summer / Winter time.
The way to test this is just to set your Smartphone as located in London (GMT) or pretty much anywhere other than Puerto Rico. Ensure your phone time is accurate apart from being many hours out due to the “move” to London. Set on for 2 minutes from now and off for 3 minutes.
I would also slip a couple of Serial print’s in V15 for the on and off signals.
I went out to eat with my wife,and OHHHHH SURPRISE !!!,the bulb into remote socket was ON.We went out at 3:00 PM,and i had put the timer at 4:00 PM.The OFF time was 6:00 PM,but now is 6:30 PM,and the llight still is ON.,i guess,this is for the time difference,so i have to keep trying.
The errors to wich i refer are about ON and OFF text inside push buttons,they don’t work properly,like switch buttons do.
Also,i must go out Blynk app to modify the on-off time,because while the app is running,i can’t do it.I don’t know if this is normal.
the new version 0.4.0 is stable, and has advantages?
If a button is in PUSH mode it can only ever show whatever you set for the OFF label i.e. pressing the button will send an ON followed by an OFF. You can use setProperty to change the ON and OFF label for buttons without stopping your project.
0.4.0 appears to be stable (0.3.9 certainly is) as long as you are not using any of the new Android sensors.
My question, apart from the buttons, was referring to the timer widget, if I have running the application,i can´t make changes in time settings, first I have to go to stop, make changes and go to play.
If the application, also doing other things, in real time, I guess these would be afected.For not have to change the clock on my phone, I calculated the time difference, and the timer works great.
The next step are the sensors.
That is right for the Timer widget but the clever Blynk guys also added the Time Input widget. Bit more complex but the time changes are done without stopping the app. It can be used as a fully fledged scheduler as it also includes the days of the week.
I would urge Blynkers to read the comprehensive docs thoroughly and familiarise themselves with all the widgets.