Hello!

I´m a newbie on node-red and now I asking of your professional help.

I´m using the light-scheduler to turn on/off my lights. But now I also have a lux sensor that I want to implement in my nodes.

I still want the scheduler to trigger the right time but I also want the lux sensor to be true or false so I think there is a AND function I need? Please help.

```
[{"id":"9e428680.235468","type":"api-call-service","z":"a07e7a47.416498","name":"Köksfönster","server":"20909698.98f8da","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.koksfonster","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":970,"y":60,"wires":[[]]},{"id":"d51ba0e.24b576","type":"delay","z":"a07e7a47.416498","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":800,"y":60,"wires":[["9e428680.235468"]]},{"id":"c650875f.9e8278","type":"delay","z":"a07e7a47.416498","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":800,"y":360,"wires":[["9c72de08.52b12"]]},{"id":"155a9b0f.1b38b5","type":"switch","z":"a07e7a47.416498","name":"ON/OFF","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":640,"y":300,"wires":[["d51ba0e.24b576","58493cea.66a874","364714a0.00311c","15a0eef2.b66a01"],["c650875f.9e8278","beded214.d8fd6","64e2fbc5.7efc64","ea019097.34379"]]},{"id":"9c72de08.52b12","type":"api-call-service","z":"a07e7a47.416498","name":"Köksfönster","server":"20909698.98f8da","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.koksfonster","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":970,"y":360,"wires":[[]]},{"id":"3d82269e.36fb0a","type":"api-call-service","z":"a07e7a47.416498","name":"Tvättfönster","server":"20909698.98f8da","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.tvattfonster","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":970,"y":120,"wires":[[]]},{"id":"58493cea.66a874","type":"delay","z":"a07e7a47.416498","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":800,"y":120,"wires":[["3d82269e.36fb0a"]]},{"id":"21952889.9a6ae8","type":"api-call-service","z":"a07e7a47.416498","name":"Allrumsfönster","server":"20909698.98f8da","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.allrumfonster","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":980,"y":180,"wires":[[]]},{"id":"364714a0.00311c","type":"delay","z":"a07e7a47.416498","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":800,"y":180,"wires":[["21952889.9a6ae8"]]},{"id":"a13588b6.6233d8","type":"api-call-service","z":"a07e7a47.416498","name":"Hallbyrå/Slinga","server":"20909698.98f8da","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.hallbyra","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":980,"y":240,"wires":[[]]},{"id":"15a0eef2.b66a01","type":"delay","z":"a07e7a47.416498","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":800,"y":240,"wires":[["a13588b6.6233d8"]]},{"id":"beded214.d8fd6","type":"delay","z":"a07e7a47.416498","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":800,"y":420,"wires":[["384d8527.2f8b1a"]]},{"id":"384d8527.2f8b1a","type":"api-call-service","z":"a07e7a47.416498","name":"Tvättfönster","server":"20909698.98f8da","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.tvattfonster","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":970,"y":420,"wires":[[]]},{"id":"64e2fbc5.7efc64","type":"delay","z":"a07e7a47.416498","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":800,"y":480,"wires":[["c56c2733.c18308"]]},{"id":"c56c2733.c18308","type":"api-call-service","z":"a07e7a47.416498","name":"Allrumsfönster","server":"20909698.98f8da","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.allrumfonster","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":980,"y":480,"wires":[[]]},{"id":"ea019097.34379","type":"delay","z":"a07e7a47.416498","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":800,"y":540,"wires":[["af96f302.470f6"]]},{"id":"af96f302.470f6","type":"api-call-service","z":"a07e7a47.416498","name":"Hallbyrå/Slinga","server":"20909698.98f8da","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.hallbyra","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":980,"y":540,"wires":[[]]},{"id":"c432e301.721df","type":"change","z":"a07e7a47.416498","name":"Enable Light","rules":[{"t":"set","p":"light_enabled","pt":"flow","to":"yes","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":60,"wires":[[]]},{"id":"8d80b85.cb48748","type":"change","z":"a07e7a47.416498","name":"Disable Light","rules":[{"t":"set","p":"light_enabled","pt":"flow","to":"no","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":120,"wires":[[]]},{"id":"4a88cb0d.7a0324","type":"switch","z":"a07e7a47.416498","name":"Light Threshold Selector","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"2000","vt":"num"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":410,"y":80,"wires":[["c432e301.721df"],["8d80b85.cb48748"]]},{"id":"adb1c1e0.148f1","type":"poll-state","z":"a07e7a47.416498","name":"LUX","server":"20909698.98f8da","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"10","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":false,"entity_id":"sensor.resistance_sensor","state_type":"str","halt_if":"2000","halt_if_type":"num","halt_if_compare":"lt","outputs":2,"x":190,"y":80,"wires":[["4a88cb0d.7a0324"],[]]},{"id":"1bc4bdfa.dfc472","type":"change","z":"a07e7a47.416498","name":"Light Enabled?","rules":[{"t":"change","p":"light_enabled","pt":"flow","from":"yes","fromt":"str","to":"on","tot":"str"},{"t":"set","p":"payload","pt":"flow","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":360,"wires":[["155a9b0f.1b38b5"]]},{"id":"af89e6c8.33d5f8","type":"inject","z":"a07e7a47.416498","name":"","topic":"","payload":"auto","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":180,"wires":[["895ed5f8.506b98"]]},{"id":"bedea38e.18f8d","type":"inject","z":"a07e7a47.416498","name":"","topic":"","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":220,"wires":[["895ed5f8.506b98"]]},{"id":"895ed5f8.506b98","type":"light-scheduler","z":"a07e7a47.416498","settings":"cb1af3fc.bf21d","events":"[{\"start\":{\"dow\":1,\"mod\":300},\"end\":{\"dow\":1,\"mod\":570}},{\"start\":{\"dow\":2,\"mod\":300},\"end\":{\"dow\":2,\"mod\":570}},{\"start\":{\"dow\":3,\"mod\":300},\"end\":{\"dow\":3,\"mod\":570}},{\"start\":{\"dow\":4,\"mod\":300},\"end\":{\"dow\":4,\"mod\":570}},{\"start\":{\"dow\":5,\"mod\":300},\"end\":{\"dow\":5,\"mod\":570}},{\"start\":{\"dow\":6,\"mod\":300},\"end\":{\"dow\":6,\"mod\":570}},{\"start\":{\"dow\":0,\"mod\":300},\"end\":{\"dow\":0,\"mod\":570}},{\"start\":{\"dow\":1,\"mod\":780},\"end\":{\"dow\":2,\"mod\":0}},{\"start\":{\"dow\":2,\"mod\":780},\"end\":{\"dow\":3,\"mod\":0}},{\"start\":{\"dow\":3,\"mod\":780},\"end\":{\"dow\":4,\"mod\":0}},{\"start\":{\"dow\":4,\"mod\":780},\"end\":{\"dow\":5,\"mod\":0}},{\"start\":{\"dow\":5,\"mod\":780},\"end\":{\"dow\":6,\"mod\":0}},{\"start\":{\"dow\":6,\"mod\":780},\"end\":{\"dow\":0,\"mod\":0}},{\"start\":{\"dow\":0,\"mod\":780},\"end\":{\"dow\":1,\"mod\":0}},{\"start\":{\"dow\":1,\"mod\":0},\"end\":{\"dow\":1,\"mod\":120}},{\"start\":{\"dow\":2,\"mod\":0},\"end\":{\"dow\":2,\"mod\":120}},{\"start\":{\"dow\":3,\"mod\":0},\"end\":{\"dow\":3,\"mod\":120}},{\"start\":{\"dow\":4,\"mod\":0},\"end\":{\"dow\":4,\"mod\":120}},{\"start\":{\"dow\":5,\"mod\":0},\"end\":{\"dow\":5,\"mod\":120}},{\"start\":{\"dow\":6,\"mod\":0},\"end\":{\"dow\":6,\"mod\":120}},{\"start\":{\"dow\":0,\"mod\":0},\"end\":{\"dow\":0,\"mod\":120}}]","topic":"scheduler","name":"05.00 - Soluppgång & Solnedgång - 02.00","onPayload":"on","onPayloadType":"str","offPayload":"off","offPayloadType":"str","onlyWhenDark":true,"scheduleRndMax":0,"sunElevationThreshold":"5","sunShowElevationInStatus":true,"outputfreq":"output.statechange.startup","x":200,"y":360,"wires":[["1bc4bdfa.dfc472"]]},{"id":"20909698.98f8da","type":"server","z":"","name":"Hassio","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true},{"id":"cb1af3fc.bf21d","type":"light-scheduler-settings","z":"","name":"Hem","latitude":"58.420959","longitude":"14.189730"}]
```