Hi,
I'm looking for an example of a function node (or other solution) to do the following
- Use 7 x boolean inputs from HA ( 1 for each day of the week) to include or skip a run sequence for solenoids for an irrigation system.
- If Monday boolean is set true, then run irrigation sequence if current day (based on timestamp) is Monday for example.
- If boolean is set true for a particular day then run sequence otherwise stop sequence.
I cant seem to find a sequence of code to do this.
This is what I have tried so far. Any help would be great
[{"id":"a1d9470d505dd25e","type":"function","z":"45fa8931a015c6c3","name":"","func":"var d=new Date()\nvar weekday=d.getDay()\nif (weekday == 6 && \"input_boolean.saturday1\" == true)\n{\n msg.payload =\"on\";\n{\n elseif\n msg.payload =\"off\";\n}\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":240,"y":240,"wires":[[]]}]