Auto light with unlock

Hi All,
I am trying to automate a light coming on when there is motion at the front door followed by the door unlocking.
This is my current flow, the problem is that if I unlock the door then leave it still goes off so trying to have it as changes to unlocked instead of just being unlocked which is what I have now.

[{"id":"a33c49c7.2fa5b8","type":"tab","label":"Home Lights On","disabled":false,"info":""},{"id":"db888235.5bb6c","type":"trigger-state","z":"a33c49c7.2fa5b8","name":"Front Door Unlocked","server":"aafa0692.311388","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"lock.front_door_lock_locked","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"unlocked","propertyValue":"new_state.state"},{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"locked","propertyValue":"new_state.state"}],"outputs":2,"customoutputs":,"outputinitially":false,"state_type":"str","x":460,"y":300,"wires":[["c096476.aab35b8"],]},{"id":"ae3b09fe.6ccf28","type":"trigger-state","z":"a33c49c7.2fa5b8","name":"Front Door Motion","server":"aafa0692.311388","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"binary_sensor.front_door_motion","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"detected","propertyValue":"new_state.state"},{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"undetected","propertyValue":"new_state.state"}],"outputs":2,"customoutputs":,"outputinitially":false,"state_type":"str","x":150,"y":360,"wires":[["db888235.5bb6c"],]},{"id":"2bf354b2.5c1a4c","type":"api-call-service","z":"a33c49c7.2fa5b8","name":"Front Hall Light On","server":"aafa0692.311388","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.front_hall_light","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":980,"y":220,"wires":[]},{"id":"c096476.aab35b8","type":"trigger-state","z":"a33c49c7.2fa5b8","name":"Night time","server":"aafa0692.311388","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"sensor.time","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":">","comparatorValueDatatype":"str","comparatorValue":"19:00","propertyValue":"new_state.state"},{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"<","comparatorValueDatatype":"str","comparatorValue":"19:00","propertyValue":"new_state.state"}],"outputs":2,"customoutputs":,"outputinitially":false,"state_type":"str","x":730,"y":240,"wires":[["2bf354b2.5c1a4c"],]},{"id":"aafa0692.311388","type":"server","name":"Home Assistant","addon":true}]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.