Light relay turn on with sunset and turn off with sunrise

Try Timer Widget for this instead and manually set the time in the app.

Ie stop and stop time.

Start at around sunset at 8pm and finish around sunrise at 6am.

The Timer Widget simply sends a 1 or 0 depending if it is active or not.

Simple as!

if you can help me with the control it will be great.

Timer Widget is the easiest way but you need to change the start and stop time every now and then.

for the time being i am using IFTTT sending sunrise and sunset time from a WEMO switch to my hardware.

You mean sunrise / sunset control or control generally?

sunrise / sunset control using Time Input widget on V1.

I got it from the http://examples.blynk.cc/

thanks

@Ze_Pico look through this thread for sketches that actually control hardware with Time Input.

Watch for Blynk days being different to regular time library days and look up the library hack to set TimeInput as “off” when no days are selected.

Then just do the same for sunrise / sunset.

Just an FYI @Costas, links aren’t color coded for phones, could be a bit hard for some to understand :slight_smile:

@Ze_Pico see my image if you missed it

Recently I have noticed that both links and now @mentions are monochromatic as well, even on Chrome PC browser… really adds to the fun :wink:

1 Like

I think I will go back to posting links in full like this Timezone conversion for the Time Input widget rather than invisible links like this.

The links are still not hightlighted in Chrome or on Smartphones but at least when Blynkers see the http://… it gives a strong indication that there is something to click on.

Nice to see the SKETCH BUILDER link at the top of each forum page.

2 Likes

@Pavel please fix.

Fixed

1 Like

Highlighted link test.

Doesn’t look very fixed to me @Pavel

Ok for me. Maybe just browser cache issue.

Cache cleared, all good now thanks.

@Costas
today i tried to run your sketch on my nodeMCU but i received many errors.
because i am not a programmer and i left C & C++ 40 years ago I don’t know how to correct errors.
so please tell me what I am missing here.
thanks.

Build options changed, rebuilding all
In file included 
                from C:\Users\jo\Documents\Arduino\libraries\Blynk\src/WidgetLED.h:13:0,

                 from C:\Users\jo\Documents\Arduino\libraries\Blynk\src/BlynkWidgets.h:10,

                 from C:\Users\jo\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp8266.h:94,

                 from C:\Users\jo\Documents\Arduino\LEARN & TEST\Time_Input_widget_with_Output\Time_Input_widget_with_Output.ino:11:

C:\Users\jo\Documents\Arduino\LEARN & TEST\Time_Input_widget_with_Output\Time_Input_widget_with_Output.ino: In function 'void BlynkWidgetWrite0(BlynkReq&, const BlynkParam&)':

C:\Users\jo\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkWidgetBase.h:50:33: error: 'class WidgetRTC' has no member named 'onWrite'

     BLYNK_WRITE(pin) { (widget).onWrite(request, param); }

                                 ^

C:\Users\jo\Documents\Arduino\LEARN & TEST\Time_Input_widget_with_Output\Time_Input_widget_with_Output.ino:20:1: note: in expansion of macro 'BLYNK_ATTACH_WIDGET'

 BLYNK_ATTACH_WIDGET(rtc, V0);

 ^

C:\Users\jo\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkWidgetBase.h: In instantiation of 'BlynkAttachWidgetHelper::BlynkAttachWidgetHelper(T&, uint8_t) [with T = WidgetRTC; uint8_t = unsigned char]':

C:\Users\jo\Documents\Arduino\LEARN & TEST\Time_Input_widget_with_Output\Time_Input_widget_with_Output.ino:20:1:   required from here

C:\Users\jo\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkWidgetBase.h:43:9: error: 'class WidgetRTC' has no member named 'setVPin'

         widget.setVPin(vPin);

         ^

exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).

The RTC widget was changed a couple of months ago. It no longer uses a virtual pin.

Remove this line:

BLYNK_ATTACH_WIDGET(rtc, V0);

@Costas
Thanks a lot Costas
I test it, Working Great
my best Regards.

@Dmitriy

Negative and Positive Time zone offset for the sketch “Time Input widget on V1” needs revision.

Start at sunset
Stop at sunrise
Time zone: Etc/GMT-12
Time zone offset: 12 Hour(s)
Day 6 is selected
Day 7 is selected

Start at sunset
Stop at sunrise
Time zone: Etc/GMT+12
Time zone offset: 1193034 Hour(s)
Day 6 is selected
Day 7 is selected

Which sketch is giving you this data?

Is that iOs or Android?