in the condition bit
condition:
- condition: state
entity_id: sensor.day_night
state: Night
- condition: state
entity_id: light.garage
state: 'off'
above saying is it Night and the garge light is off when both are true do the next bit
thats the hard off is the off bit
Your logic should
if motion turn light on after a delay of ??? mins turn off then if more motion with in the ??? mins Extend the off longer hope that make cents
now this is something I can not get HA to do
BUT
I used nodered
this flow put a delay of 3mins
each time there is a motion it just send a new ON and reset the OFF
if no motion for 3min send the OFF
this is my work around works for me.
[{"id":"b70f2601.75f3d8","type":"debug","z":"88b0cdb8.1b02a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":570,"y":180,"wires":[]},{"id":"d2afe3ce.63891","type":"delay","z":"88b0cdb8.1b02a","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":140,"y":280,"wires":[["645b8ccf.d17ef4"]]},{"id":"4a18849.797197c","type":"mqtt out","z":"88b0cdb8.1b02a","name":"","topic":"nodered/motion","qos":"","retain":"","broker":"382381db.f5a70e","x":580,"y":100,"wires":[]},{"id":"f25fa27a.8e9b6","type":"function","z":"88b0cdb8.1b02a","name":"","func":"if (msg.payload ==\"ON\") {\n msg.reset = true;\n msg.payload = \"ON\"\n}\nelse{\n \n msg.payload = \"ON\"\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":100,"wires":[["4a18849.797197c","b70f2601.75f3d8","d2afe3ce.63891"]]},{"id":"41f90787.387518","type":"mqtt out","z":"88b0cdb8.1b02a","name":"","topic":"nodered/motion","qos":"","retain":"","broker":"382381db.f5a70e","x":580,"y":280,"wires":[]},{"id":"645b8ccf.d17ef4","type":"function","z":"88b0cdb8.1b02a","name":"","func":"if (msg.payload ==\"ON\") {\n msg.payload = \"OFF\"\n}\nelse{\n msg.payload = \"OFF\"\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":280,"wires":[["41f90787.387518","b70f2601.75f3d8"]]},{"id":"c8d8d2f6.e8e0c","type":"mqtt in","z":"88b0cdb8.1b02a","name":"Office Motion","topic":"stat/SONOFF-FAN/POWER","qos":"2","datatype":"utf8","broker":"382381db.f5a70e","x":110,"y":100,"wires":[["f25fa27a.8e9b6"]]},{"id":"382381db.f5a70e","type":"mqtt-broker","z":"","name":"Hassio MQTT","broker":"192.168.1.240","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]