Is this an efficient way to run this flow?

This is my very first flow and I’ve been putting it together from information I’ve been reading from various sources. I’m at work, so I don’t really have a way to test it yet, but I was wondering if there is a more efficient way to set this up?


Currently, it’s:
Slider open - if it’s after dusk/before dawn - turn on light
Slider closed - wait 10 minutes - turn off light

Is big timer able to both turn the light on after dusk and then turn it off after 10 minutes? I looked and I"m not seeing a way.

There is light-scheduler node which can output on or off state and many other settings. Check it out.

1 Like

Hmm… I’m still learning node red - but I believe if you use the if state of the state node (slider) you can have two branches right off that. This basically removes the need for the switch node.

image

As far as the time of day and timer, etc. I haven’t used anything like that yet, so can’t really suggest much.

Cheers!
DeadEnd

1 Like

I thought that might’ve been the case, but I wasn’t sure, thank you!

I’m also embarrassed to say that I have no idea what the blue dots mean.

Here ya go:
https://nodered.org/docs/user-guide/editor/workspace/nodes

“If a node has any undeployed changes, it displays a blue circle above it. If there are errors with its configuration, it displays a red triangle.”

So the blue dot means you changes something - you need to deploy the flow before the change will take effect.

1 Like

I had no idea I could install new nodes, much less that there are over 2000 of them available. Thank you!

1 Like

Makes total sense, thanks for telling me something that I should/could have easily found out myself, lol.

Yeah, there are a HUGE amount of nodes you can use to connect to different systems.
I’ve played with MQTT, Dahua (cameras), timers, loops, and more.

You can do some interesting stuff if you spend the time on it.

1 Like

You can also add a Current State node to your flow before each of the call service nodes. It can check to see if your light is already on (or off), and if it is, halt the flow at that point. Here is an example.

1 Like

I will mess with that, thank you.

Turns out, this flow doesn’t work. I must have it programmed wrong. Looking into why that might be now. ACtually, not a single flow I put together works, but I wanted to focus on this one because it’s the simplest one I have.

Maybe someone can point me in the right direction? When it was deployed, it did absolutely nothing. I tried random things, and couldn’t get it. I think I may be using BigTimer wrong, but I’m not seeing it.

[{"id":"df2a34fc.1b1348","type":"tab","label":"Slider open when dark out","disabled":false,"info":"Turn on the backyard flood light when slider is opened after dusk, and before dawn. "},{"id":"c93a7896.149678","type":"server-state-changed","z":"df2a34fc.1b1348","name":"Slider","server":"26956a45.92d866","version":1,"entityidfilter":"binary_sensor.slider_contact","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":90,"y":220,"wires":[["8f8eb913.1c5378"],["7ba443cc.d9f43c"]]},{"id":"2944f2b8.138d4e","type":"api-call-service","z":"df2a34fc.1b1348","name":"Flood Light On","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"light.flood","data":"{\"brightness_pct\":100}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":402,"y":167,"wires":[[]]},{"id":"90a7e364.38359","type":"api-call-service","z":"df2a34fc.1b1348","name":"Flood Light Off","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_off","entityId":"light.flood","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":423,"y":253,"wires":[[]]},{"id":"8f8eb913.1c5378","type":"bigtimer","z":"df2a34fc.1b1348","outtopic":"","outpayload1":"","outpayload2":"","name":"Dark Out?","comment":"","lat":"27.918981","lon":"-81.866833","starttime":5001,"endtime":"5000","starttime2":0,"endtime2":0,"startoff":0,"endoff":0,"startoff2":0,"endoff2":0,"offs":0,"outtext1":"","outtext2":"","timeout":1440,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":0,"month1":0,"day2":0,"month2":0,"day3":0,"month3":0,"day4":0,"month4":0,"day5":0,"month5":0,"day6":0,"month6":0,"d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"d6":0,"w6":0,"xday1":0,"xmonth1":0,"xday2":0,"xmonth2":0,"xday3":0,"xmonth3":0,"xday4":0,"xmonth4":0,"xday5":0,"xmonth5":0,"xday6":0,"xmonth6":0,"xd1":0,"xw1":0,"xd2":0,"xw2":0,"xd3":0,"xw3":0,"xd4":0,"xw4":0,"xd5":0,"xw5":0,"xd6":0,"xw6":0,"suspend":false,"random":false,"repeat":true,"atstart":false,"odd":false,"even":false,"x":237,"y":180,"wires":[["2944f2b8.138d4e"],[],[]]},{"id":"7ba443cc.d9f43c","type":"stoptimer","z":"df2a34fc.1b1348","duration":"10","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":248,"y":260,"wires":[["90a7e364.38359"],[]]},{"id":"26956a45.92d866","type":"server","z":"","name":"Home Assistant"}]