ja mam to w ten sposób zrobione
[{"id":"b7cbb6df996af097","type":"mqtt in","z":"4d1d611d.bd4da","name":"Czujnik kuchnia","topic":"zigbee2mqtt/Czujka_kuchnia","qos":"2","datatype":"json","broker":"7f257382.e85b1c","nl":false,"rap":true,"rh":0,"inputs":0,"x":120,"y":1460,"wires":[["fc19928139cc3d26"]]},{"id":"fc19928139cc3d26","type":"switch","z":"4d1d611d.bd4da","name":"Czy ruch","property":"payload.occupancy","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"false","repair":false,"outputs":2,"x":300,"y":1460,"wires":[["974c78aa9bde8cfd","13b9f93feed27be3"],["706b1d5d82d9932f"]]},{"id":"13b9f93feed27be3","type":"change","z":"4d1d611d.bd4da","name":"Resetuj","rules":[{"t":"set","p":"reset","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":1520,"wires":[["706b1d5d82d9932f"]]},{"id":"706b1d5d82d9932f","type":"delay","z":"4d1d611d.bd4da","name":"2 minuty","pauseType":"delay","timeout":"2","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":500,"y":1520,"wires":[["48b138ea924a47f9"]]},{"id":"974c78aa9bde8cfd","type":"switch","z":"4d1d611d.bd4da","name":"Jasność","property":"payload.illuminance_lux","propertyType":"msg","rules":[{"t":"lte","v":"75","vt":"num"},{"t":"gt","v":"75","vt":"num"}],"checkall":"false","repair":false,"outputs":2,"x":500,"y":1460,"wires":[["bfdd3516deef0d18"],[]]},{"id":"48b138ea924a47f9","type":"switch","z":"4d1d611d.bd4da","name":"Czy przyciskiem","property":"pod_szafkami","propertyType":"flow","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":740,"y":1520,"wires":[["faaa17038ec6cfa9"],[]]},{"id":"faaa17038ec6cfa9","type":"change","z":"4d1d611d.bd4da","name":"Wyłącz pod szafkami","rules":[{"t":"set","p":"payload","pt":"msg","to":"off","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"shellies/shelly_pod_szafkami/relay/0/command","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":1520,"wires":[["28f9415e.21f1ae"]]},{"id":"bfdd3516deef0d18","type":"change","z":"4d1d611d.bd4da","name":"Włącz pod szafkami","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"shellies/shelly_pod_szafkami/relay/0/command","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":1460,"wires":[["28f9415e.21f1ae"]]},{"id":"7f257382.e85b1c","type":"mqtt-broker","name":"HA MQTT","broker":"localhost","port":"1883","clientid":"","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]
jeśli wykryje ruch z czujki włączam światło (o ile nie jest jasno) i włączam odliczanie jeśli czujka wykryje ruch restuje delay znowu na 2 minuty i tak w kółko jeśli nie będzie ruchu przez 2 minuty sprawdza czy nie włączyłem przełącznikiem (stan w zmiennej flow) i wyłącza.