{Problem}Bigtimer

Hi everyone, I am recently using node-red and therefore I am very inexperienced with this type of programming. I have created a project that consists in switching on a relay thanks to node-red and now I should visualize the BigTimer on the web interface. Can you help me? I really don't know how to do it!

Welcome to the forum. It would be helpful if you could post your flow here, that will make it easier for us to make suggestions to help you.

"fc1a6598.792f18"
Yes, excuse me ... I should create a schedule by creating precise time intervals ...

I don't think you can in any automated way because I don't think bigtimer outputs its settings.

I think that the cron-plus node is more likely to expose the data you want and there is a thread elsewhere where someone is talking about building (indeed having built) a web interface to complement cron-plus for her own needs.

Hi, so with cron plus should I be able to do what I want?

One question, do you just want to control the relay with BigTimer?

They assigned me an exercise where I have to control the relay following precise time portions, set by any device from the web interface!

By a web interface or from the node-red editor?

Well, it isn't that easy. Building a scheduling web interface is actually quite hard. But at least the node supports the data flow as far as I'm aware. I've not yet done it myself.

That is possible with node-red-contrib-cron-plus.

Read the built help info after you install it and import the sample demo for tips on how to use it.

By a web interface!

OK, then see @Steve-Mcl's post above.

okay, thanks for helping me!

okay, you were very kind!

I know, plus I'm very inexperienced!:sweat_smile:

Well, you've certainly been pushed in at the deep end!

I would look at how you could simplify the schedule as much as possible. Then build the UI. Once you have that, you will need to translate the data from the UI to/from the cron-plus data structure. As the name implies, it uses CRON format which you can lookup.

Building the UI is what will take the most time. Try to define it as simply as possible. Can you get away with a single on/off event for each working day for example? Do you need exact times or can you get away with hours? etc.

Yes, I need to create for example an ignition that goes from 16:00 in the afternoon to 18: 00. I tried but I really can't ... you could guide me or link me to sites that explain step by step what I have to do? that I'm asking a little too much but I don't know how to get out of it)

Well I would start simply and create a Dashboard page with two inputs for the times then see how data flows out and how you can make it flow in.

Then expand the UI if you need to.

Here is the simplest possible input for a start and end time:

[{"id":"6b009717.947618","type":"debug","z":"63281c77.40a064","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":490,"y":1420,"wires":[]},{"id":"1b4b05f0.7fdf3a","type":"ui_text_input","z":"63281c77.40a064","name":"","label":"Start","tooltip":"","group":"fa3eee85.b8eb1","order":3,"width":0,"height":0,"passthru":false,"mode":"time","delay":300,"topic":"start","x":310,"y":1420,"wires":[["6b009717.947618"]]},{"id":"818949b1.1eff98","type":"ui_text_input","z":"63281c77.40a064","name":"","label":"End","tooltip":"","group":"fa3eee85.b8eb1","order":3,"width":0,"height":0,"passthru":false,"mode":"time","delay":300,"topic":"end","x":310,"y":1460,"wires":[["eaba0840.cc84f8"]]},{"id":"eaba0840.cc84f8","type":"debug","z":"63281c77.40a064","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":490,"y":1460,"wires":[]},{"id":"fa3eee85.b8eb1","type":"ui_group","z":"","name":"Time","tab":"70bd0808.2b4f68","disp":true,"width":"18","collapse":false},{"id":"70bd0808.2b4f68","type":"ui_tab","z":"","name":"Schedule-Test","icon":"dashboard","disabled":false,"hidden":false}]

You need to know how to translate the two inputs into CRON formats, this may help:

https://www.freeformatter.com/cron-expression-generator-quartz.html

For example, to specify something that will happen every day at 4pm: 0 0 0,16 ? * * *

2 Likes

And because you caught me bored at the end of the week and because it was an interesting excercise, here is a more complete example:

[{"id":"9be1f49f.37f098","type":"subflow","name":"UI Time Input To Cron","info":"","category":"","in":[{"x":60,"y":80,"wires":[{"id":"fb4ea2b7.8f275"}]}],"out":[{"x":320,"y":80,"wires":[{"id":"fb4ea2b7.8f275","port":0}]}],"env":[],"color":"#DDAA99"},{"id":"fb4ea2b7.8f275","type":"function","z":"9be1f49f.37f098","name":"","func":"const out = {}\n\nout.input = msg.payload\n\nconst dt = new Date(msg.payload)\n\nout.hour = dt.getUTCHours()\nout.minute = dt.getUTCMinutes()\n\nout.cron = `0 ${out.minute} 0,${out.hour} ? * * *`\n\nmsg.payload = out\n\nreturn msg;","outputs":1,"noerr":0,"x":190,"y":80,"wires":[[]]},{"id":"6b009717.947618","type":"debug","z":"63281c77.40a064","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":710,"y":1420,"wires":[]},{"id":"1b4b05f0.7fdf3a","type":"ui_text_input","z":"63281c77.40a064","name":"","label":"Start","tooltip":"","group":"fa3eee85.b8eb1","order":3,"width":0,"height":0,"passthru":false,"mode":"time","delay":300,"topic":"start","x":310,"y":1420,"wires":[["42c8160e.52b738"]]},{"id":"818949b1.1eff98","type":"ui_text_input","z":"63281c77.40a064","name":"","label":"End","tooltip":"","group":"fa3eee85.b8eb1","order":3,"width":0,"height":0,"passthru":false,"mode":"time","delay":300,"topic":"end","x":310,"y":1460,"wires":[["cfa735d3.457d78"]]},{"id":"eaba0840.cc84f8","type":"debug","z":"63281c77.40a064","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":710,"y":1460,"wires":[]},{"id":"177ea815.3a30f8","type":"inject","z":"63281c77.40a064","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":1420,"wires":[["1b4b05f0.7fdf3a","818949b1.1eff98"]]},{"id":"42c8160e.52b738","type":"subflow:9be1f49f.37f098","z":"63281c77.40a064","x":500,"y":1420,"wires":[["6b009717.947618"]]},{"id":"cfa735d3.457d78","type":"subflow:9be1f49f.37f098","z":"63281c77.40a064","x":500,"y":1460,"wires":[["eaba0840.cc84f8"]]},{"id":"fa3eee85.b8eb1","type":"ui_group","z":"","name":"Time","tab":"70bd0808.2b4f68","disp":true,"width":"6","collapse":false},{"id":"70bd0808.2b4f68","type":"ui_tab","z":"","name":"Schedule-Test","icon":"dashboard","disabled":false,"hidden":false}]

Just needs cron-plus adding in now.

2 Likes

you were too kind,thanks!
I apologize for boring you !!:rofl::rofl: