Zobacz sobie mój flow. można załączyć przez przycisk wtedy nie wyłączy nawet jak będzie brak ruchu. Jak włączy przez czujkę to można wyłączyć przyciskiem.
[
{
"id": "993657678892c48a",
"type": "tab",
"label": "Pod szafkami",
"disabled": false,
"info": "",
"env": []
},
{
"id": "47c5e15748d078b1",
"type": "mqtt in",
"z": "993657678892c48a",
"name": "Czujnik kuchnia",
"topic": "zigbee2mqtt/Czujka_kuchnia",
"qos": "2",
"datatype": "json",
"broker": "9ece249d0e2b4a72",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 120,
"y": 80,
"wires": [
[
"d21a6d3b9a6c7a6b"
]
]
},
{
"id": "d21a6d3b9a6c7a6b",
"type": "switch",
"z": "993657678892c48a",
"name": "Czy ruch",
"property": "payload.occupancy",
"propertyType": "msg",
"rules": [
{
"t": "true"
},
{
"t": "false"
}
],
"checkall": "false",
"repair": false,
"outputs": 2,
"x": 320,
"y": 80,
"wires": [
[
"42ac13977a8706c4",
"66aa897a988b7a8f"
],
[
"0b07b4989dc538fe"
]
]
},
{
"id": "66aa897a988b7a8f",
"type": "change",
"z": "993657678892c48a",
"name": "Resetuj",
"rules": [
{
"t": "set",
"p": "reset",
"pt": "msg",
"to": "1",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 320,
"y": 140,
"wires": [
[
"0b07b4989dc538fe"
]
]
},
{
"id": "0b07b4989dc538fe",
"type": "delay",
"z": "993657678892c48a",
"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": 140,
"wires": [
[
"4fc7b5c3d45c1386"
]
]
},
{
"id": "42ac13977a8706c4",
"type": "switch",
"z": "993657678892c48a",
"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": 80,
"wires": [
[
"8a66312efbba8560"
],
[]
]
},
{
"id": "4fc7b5c3d45c1386",
"type": "switch",
"z": "993657678892c48a",
"name": "Czy przyciskiem",
"property": "kuchnia_p",
"propertyType": "flow",
"rules": [
{
"t": "false"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 700,
"y": 140,
"wires": [
[
"ec2bbe41d6879802"
]
]
},
{
"id": "ec2bbe41d6879802",
"type": "change",
"z": "993657678892c48a",
"name": "Wyłącz pod szafkami",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"state\":\"OFF\",\"brightness\":0}",
"tot": "json"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "zigbee2mqtt/Ledy pod szafkami/set",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 940,
"y": 140,
"wires": [
[
"75a76fa1600d6a1f"
]
]
},
{
"id": "8a66312efbba8560",
"type": "change",
"z": "993657678892c48a",
"name": "Włącz pod szafkami",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"state\":\"ON\",\"brightness\":254}",
"tot": "json"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "zigbee2mqtt/Ledy pod szafkami/set",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 940,
"y": 80,
"wires": [
[
"75a76fa1600d6a1f"
]
]
},
{
"id": "75a76fa1600d6a1f",
"type": "mqtt out",
"z": "993657678892c48a",
"name": "Wyślij do MQTT",
"topic": "",
"qos": "0",
"retain": "false",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "9ece249d0e2b4a72",
"x": 1180,
"y": 80,
"wires": []
},
{
"id": "f75a3e049b36ff45",
"type": "mqtt in",
"z": "993657678892c48a",
"name": "Kuchnia",
"topic": "shellies/shelly_pod_szafkami/input_event/0",
"qos": "2",
"datatype": "json",
"broker": "9ece249d0e2b4a72",
"nl": false,
"rap": false,
"inputs": 0,
"x": 100,
"y": 260,
"wires": [
[
"c63e395b04210f83"
]
]
},
{
"id": "c63e395b04210f83",
"type": "switch",
"z": "993657678892c48a",
"name": "Czy krótkie",
"property": "payload.event",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "S",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 290,
"y": 260,
"wires": [
[
"075bfe0375954c14"
]
]
},
{
"id": "5fefd929ef59ca4d",
"type": "inject",
"z": "993657678892c48a",
"name": "Po uruchomieniu",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 130,
"y": 380,
"wires": [
[
"c0f573d277771c16"
]
]
},
{
"id": "c0f573d277771c16",
"type": "change",
"z": "993657678892c48a",
"name": "Ustaw start",
"rules": [
{
"t": "set",
"p": "kuchnia_p",
"pt": "flow",
"to": "false",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 350,
"y": 380,
"wires": [
[]
]
},
{
"id": "c12eb83dfad45b20",
"type": "change",
"z": "993657678892c48a",
"name": "",
"rules": [
{
"t": "set",
"p": "kuchnia_p",
"pt": "flow",
"to": "false",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 670,
"y": 240,
"wires": [
[
"ec2bbe41d6879802"
]
]
},
{
"id": "e6b8bf9143fdb92e",
"type": "change",
"z": "993657678892c48a",
"name": "",
"rules": [
{
"t": "set",
"p": "kuchnia_p",
"pt": "flow",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 670,
"y": 280,
"wires": [
[
"8a66312efbba8560"
]
]
},
{
"id": "16cb7c1b6538dd5d",
"type": "mqtt in",
"z": "993657678892c48a",
"name": "Ledy pod szafkami",
"topic": "zigbee2mqtt/Ledy pod szafkami/action",
"qos": "2",
"datatype": "auto-detect",
"broker": "9ece249d0e2b4a72",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 130,
"y": 460,
"wires": [
[
"ded6d9eac74d3ef0"
]
]
},
{
"id": "be181dae6e39762b",
"type": "change",
"z": "993657678892c48a",
"name": "Ledy on",
"rules": [
{
"t": "set",
"p": "kuchnia_on",
"pt": "flow",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 500,
"y": 460,
"wires": [
[]
]
},
{
"id": "2bf4bf66b99c38d8",
"type": "change",
"z": "993657678892c48a",
"name": "Ledy off",
"rules": [
{
"t": "set",
"p": "kuchnia_on",
"pt": "flow",
"to": "false",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 500,
"y": 500,
"wires": [
[]
]
},
{
"id": "ded6d9eac74d3ef0",
"type": "switch",
"z": "993657678892c48a",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "on",
"vt": "str"
},
{
"t": "eq",
"v": "off",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 330,
"y": 460,
"wires": [
[
"be181dae6e39762b"
],
[
"2bf4bf66b99c38d8"
]
]
},
{
"id": "075bfe0375954c14",
"type": "switch",
"z": "993657678892c48a",
"name": "",
"property": "kuchnia_on",
"propertyType": "flow",
"rules": [
{
"t": "true"
},
{
"t": "false"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 470,
"y": 260,
"wires": [
[
"c12eb83dfad45b20"
],
[
"e6b8bf9143fdb92e"
]
]
},
{
"id": "9ece249d0e2b4a72",
"type": "mqtt-broker",
"name": "mqtt_HA_core",
"broker": "192.168.10.63",
"port": "1883",
"clientid": "nodered_core",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
}
]