If ( var1 = true and var2 = true ) then / else

#21

so how are you setting timerOn and timerActive?

You are testing them to be a value but they are an object

#22

yes I can see this but not understand correctly!

Object >> payload "true" or "false" must be expected

but may be is this function wrong,
for Timer:

var newMsg = { payload: msg.payload};
flow.set('timeOn',newMsg);
return newMsg;

and for timerActive:

var newMsg = { payload: msg.payload};
flow.set('timerActive',newMsg);
return newMsg;

#23

So you set timeOn to be an object { payload: msg.payload}

which means that timeOn can never be timeOn === true

Try changing where you set your flow value to:

flow.set('timeOn',msg.payload);

flow.set('timerActive',msg.payload);

#24

HAAARIIIIKAAA. thank you, it works :grin:

[{„id":"61e29655.5ff498","type":"timerswitch","z":"a61d422a.aa2ce8","name":"Irrigation-Plan","ontopic":"","offtopic":"","onpayload":"true","offpayload":"false","disabled":false,"schedules":[{"on_h":"13","on_m":"56","on_s":"00","off_h":"21","off_m":"00","off_s":"00","valid":true}],"x":135,"y":185,"wires":[["34757b35.ef72d4"]]},{"id":"4862840d.9c7bdc","type":"ui_switch","z":"a61d422a.aa2ce8","name":"Automatik","label":"Zeitschaltung","group":"48fa5d97.39c614","order":1,"width":0,"height":0,"passthru":false,"decouple":"false","topic":"Auto","style":"","onvalue":"true","onvalueType":"str","onicon":"","oncolor":"","offvalue":"false","offvalueType":"str","officon":"","offcolor":"","x":125,"y":79,"wires":[["f3310232.74d2b"]]},{"id":"ff80c323.425db","type":"debug","z":"a61d422a.aa2ce8","name":"Automatik","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":792.5,"y":79,"wires":[]},{"id":"bd8caa84.46ea3","type":"function","z":"a61d422a.aa2ce8","name":"Auto","func":"var timerActive = flow.get('timerActive');\nvar timeOn = flow.get('timeOn');\nnode.warn(\"timerActive is \" + timerActive)\nnode.warn(\"timerOn is \" + timeOn)\n\n\n if (timerActive === \"true\" && timeOn === \"true\") {\n msg.payload = 1;\n } \n else {\n msg.payload = 0;\n}\n\treturn msg;","outputs":1,"noerr":0,"x":607.5,"y":79,"wires":[["ff80c323.425db"]]},{"id":"cc1e768f.7c3a7","type":"debug","z":"a61d422a.aa2ce8","name":"TimerON","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":618,"y":183,"wires":[]},{"id":"b142b2e1.1e07a","type":"debug","z":"a61d422a.aa2ce8","name":"Timer","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":607.5,"y":232,"wires":[]},{"id":"34757b35.ef72d4","type":"function","z":"a61d422a.aa2ce8","name":"Flow Set TimerOn","func":"var newMsg = { payload: msg.payload};\nflow.set('timeOn',msg.payload);\nreturn newMsg;","outputs":1,"noerr":0,"x":360,"y":185,"wires":[["b142b2e1.1e07a","bd8caa84.46ea3"]]},{"id":"f3310232.74d2b","type":"function","z":"a61d422a.aa2ce8","name":"Flow Set TimerActive","func":"var newMsg = { payload: msg.payload};\nflow.set('timerActive',msg.payload);\nreturn newMsg;","outputs":1,"noerr":0,"x":335,"y":79,"wires":[["bd8caa84.46ea3","cc1e768f.7c3a7"]]},{"id":"48fa5d97.39c614","type":"ui_group","z":"","name":"Automation","tab":"4db4f194.142aa","order":1,"disp":true,"width":"6","collapse":false},{"id":"4db4f194.142aa","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order“:1}]

thank you all once again!!!
best regards
Max