Schedule and luminance?

Hi, could someone help me with an AND function for my flow? I´m total newbie on this and tried for 3 days now with no luck.

I want the light-scheduler node to be true and my lux sensor to be true, then the light should turn on.

Please help.

A little more information or context would be good.

What lux?

Trigger on both turning to state you want. Condition AND that they are both in that state. That way, the action will fire when either is switched if the other is already in correct state.

This is what I made today without the illuminance sensor.

Could someone show with blocks how this should be done?

Please if someone could look at this:

[{"id":"d26906c5.c791e8","type":"poll-state","z":"6ba2293.298a9d8","name":"","server":"20909698.98f8da","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"10","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":true,"entity_id":"sensor.resistance_sensor","state_type":"str","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":220,"y":200,"wires":[[]]},{"id":"5b6e9e68.1d0c9","type":"light-scheduler","z":"6ba2293.298a9d8","settings":"cb1af3fc.bf21d","events":"[{\"start\":{\"dow\":1,\"mod\":780},\"end\":{\"dow\":1,\"mod\":1320}},{\"start\":{\"dow\":2,\"mod\":780},\"end\":{\"dow\":2,\"mod\":1320}},{\"start\":{\"dow\":3,\"mod\":780},\"end\":{\"dow\":3,\"mod\":1320}},{\"start\":{\"dow\":4,\"mod\":780},\"end\":{\"dow\":4,\"mod\":1320}},{\"start\":{\"dow\":5,\"mod\":780},\"end\":{\"dow\":5,\"mod\":1320}},{\"start\":{\"dow\":6,\"mod\":780},\"end\":{\"dow\":6,\"mod\":1320}},{\"start\":{\"dow\":0,\"mod\":780},\"end\":{\"dow\":0,\"mod\":1320}}]","topic":"","name":"Solnedgånd - 22.00","onPayload":"on","onPayloadType":"str","offPayload":"off","offPayloadType":"str","onlyWhenDark":true,"scheduleRndMax":"5","sunElevationThreshold":"10","sunShowElevationInStatus":true,"outputfreq":"output.statechange.startup","x":270,"y":340,"wires":[[]]},{"id":"d00d2753.d1cb28","type":"api-call-service","z":"6ba2293.298a9d8","name":"Kontorsfönster","server":"20909698.98f8da","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.kontorsfonster","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":980,"y":200,"wires":[[]]},{"id":"b1735bd2.2c98d8","type":"api-call-service","z":"6ba2293.298a9d8","name":"Kontorsfönster","server":"20909698.98f8da","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.kontorsfonster","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":980,"y":340,"wires":[[]]},{"id":"42406dca.ab53f4","type":"delay","z":"6ba2293.298a9d8","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":820,"y":200,"wires":[["d00d2753.d1cb28"]]},{"id":"910279a6.8cad58","type":"delay","z":"6ba2293.298a9d8","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":820,"y":340,"wires":[["b1735bd2.2c98d8"]]},{"id":"27e0b59f.01403a","type":"comment","z":"6ba2293.298a9d8","name":"SENSOR","info":"","x":280,"y":140,"wires":[]},{"id":"9eb76cec.30c06","type":"comment","z":"6ba2293.298a9d8","name":"SCHEDULE","info":"","x":270,"y":280,"wires":[]},{"id":"721bbd97.265514","type":"comment","z":"6ba2293.298a9d8","name":"ON","info":"","x":930,"y":140,"wires":[]},{"id":"9ce49ee0.f38f","type":"comment","z":"6ba2293.298a9d8","name":"OFF","info":"","x":930,"y":280,"wires":[]},{"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"}]

I have bin working on this a little by my self. But now I´m looking for a new thing.

Now when my sensor gets below the restricted value it sends true. But I want it like: When the sensor has bin below the restricted value for example 5 min, I want it to be true.

[{"id":"17be435c.8c082d","type":"light-scheduler","z":"f4fe45ba.4473d8","settings":"cb1af3fc.bf21d","events":"[{\"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\":540}},{\"start\":{\"dow\":1,\"mod\":0},\"end\":{\"dow\":1,\"mod\":765}},{\"start\":{\"dow\":3,\"mod\":0},\"end\":{\"dow\":3,\"mod\":765}},{\"start\":{\"dow\":4,\"mod\":0},\"end\":{\"dow\":4,\"mod\":765}},{\"start\":{\"dow\":5,\"mod\":0},\"end\":{\"dow\":5,\"mod\":765}},{\"start\":{\"dow\":6,\"mod\":0},\"end\":{\"dow\":6,\"mod\":765}},{\"start\":{\"dow\":0,\"mod\":0},\"end\":{\"dow\":0,\"mod\":765}},{\"start\":{\"dow\":2,\"mod\":0},\"end\":{\"dow\":2,\"mod\":765}}]","topic":"schema","name":"Solnedgång - Soluppgång","onPayload":"true","onPayloadType":"bool","offPayload":"false","offPayloadType":"bool","onlyWhenDark":false,"scheduleRndMax":"5","sunElevationThreshold":"6","sunShowElevationInStatus":false,"outputfreq":"output.statechange.startup","x":150,"y":120,"wires":[["83bc1047.fe758"]]},{"id":"99fe5741.04b368","type":"api-call-service","z":"f4fe45ba.4473d8","name":"Entré","server":"20909698.98f8da","version":1,"debugenabled":false,"service_domain":"light","service":"turn_{{payload}}","entityId":"light.entre","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":910,"y":120,"wires":[["afea605d.13cb8"]]},{"id":"7cd81b53.8dcc34","type":"delay","z":"f4fe45ba.4473d8","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":760,"y":120,"wires":[["99fe5741.04b368"]]},{"id":"fd2420b3.2eeb2","type":"poll-state","z":"f4fe45ba.4473d8","name":"","server":"20909698.98f8da","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"20","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":false,"entity_id":"sensor.resistance_sensor","state_type":"str","halt_if":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"x":160,"y":60,"wires":[["b2b9ce0f.98b24"]]},{"id":"b2b9ce0f.98b24","type":"switch","z":"f4fe45ba.4473d8","name":"<3100","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"3100","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":370,"y":60,"wires":[["12c496bb.9ffb29"]]},{"id":"12c496bb.9ffb29","type":"change","z":"f4fe45ba.4473d8","name":"True","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":60,"wires":[["83bc1047.fe758"]]},{"id":"83bc1047.fe758","type":"BooleanLogicUltimate","z":"f4fe45ba.4473d8","name":"AND","filtertrue":"both","persist":true,"sInitializeWith":"false","triggertopic":"trigger","outputtriggeredby":"all","inputCount":2,"topic":"result","x":400,"y":120,"wires":[["4a3132c.b3177cc"],[],[]]},{"id":"4a3132c.b3177cc","type":"change","z":"f4fe45ba.4473d8","name":"Change","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"on","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"false","fromt":"bool","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":120,"wires":[["7cd81b53.8dcc34"]]},{"id":"afea605d.13cb8","type":"debug","z":"f4fe45ba.4473d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1050,"y":200,"wires":[]},{"id":"cb1af3fc.bf21d","type":"light-scheduler-settings","z":"","name":"Hem","latitude":"58.420959","longitude":"14.189730"},{"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}]

I used to use trigger nodes for that, you set one to do nothing on the 1st message, wait five minutes and reset if another message comes in where the state has changed back.

Now, I more often use wait until, from the home asssitant websocket palette. It didn’t exist when I started.