"start" of the flow

Hi,
I’m trying set up a flow in node red to change tariffs for the utility meter integration. I’m stuck as to what to use to trigger this flow:

I have peak tariff from 6AM to 10PM during weekdays and offpeak from 10pm to 6AM weekdays and 24/7 during weekends.
thanks

This sounds like a perfect task for the Big Timer NR node. You can install it from the NR palette manager.

1 Like

Thanks! I gave it a try, but am unsure how to use it here. I am using it now for light automations with sunset/sunrise as triggers.

Just import this into NR, I set the big timer node up for you so you can look at it. It will turn on payload “peak” at 06:00 M-F and turn it to “off-peak” at 22:00. Since you want off peak all weekend I just unselected Sun and Sat in the bottom fo the node, so it won’t run on those days. Meaning Friday at 22:00 it will turn to “off-peak” an then won’t got to “peak” until Monday at 06:00.

Let me know if you have any questions.

[{"id":"7f51c65e.fc58c8","type":"bigtimer","z":"84b1cc62.4053","outtopic":"","outpayload1":"peak","outpayload2":"offpeak","name":"Tarriff Timer","comment":"peak tariff from 6AM to 10PM during weekdays and offpeak from 10pm to 6AM weekdays and 24/7 during weekends.","lat":"53.q2442","lon":"-1.14","starttime":"360","endtime":"1320","starttime2":0,"endtime2":0,"startoff":"0","endoff":"0","startoff2":0,"endoff2":0,"offs":0,"outtext1":"","outtext2":"","timeout":1440,"sun":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":false,"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":false,"atstart":true,"odd":false,"even":false,"x":330,"y":2013,"wires":[["cba669cf.22ee6"],[],[]]},{"id":"119f4d2c.a1022b","type":"debug","z":"84b1cc62.4053","name":"Attach to Peak Service Call","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":760,"y":1960,"wires":[]},{"id":"6b83518e.1ad2b8","type":"debug","z":"84b1cc62.4053","name":"Attach to Off Peak Service Call","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":770,"y":2040,"wires":[]},{"id":"cba669cf.22ee6","type":"switch","z":"84b1cc62.4053","name":"Peak or Off Peak","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"peak","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":2000,"wires":[["119f4d2c.a1022b"],["6b83518e.1ad2b8"]]}]

What requirements do you have for starting the flow? An Inject node can, well, inject, a scheduled message to start the flow. You can look into its options to see if it works for you.

1 Like

Yup you could also do this with two inject nodes and use different topics for “peak” and “non peak”.

Here is that also:

[{"id":"c89dbe89.49d1d","type":"inject","z":"e2f1e7d2.a210a8","name":"peak","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"00 06 * * 1,2,3,4,5","once":false,"onceDelay":0.1,"x":630,"y":2280,"wires":[[]]},{"id":"25f6e315.c7a08c","type":"inject","z":"e2f1e7d2.a210a8","name":"offpeak","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"00 22 * * 1,2,3,4,5","once":false,"onceDelay":0.1,"x":640,"y":2320,"wires":[[]]}]

I just use Big Timer in so many other complex timing flows that can’t be handled with inject nodes that I default to it for all my time based triggers for the most part.

went with injection nodes in the end and it’s working great. Thanks for all your help!