Room Occupancy

[
    {
        "id": "5ff89e5dc5bdb673",
        "type": "group",
        "z": "a51638c2.321cb",
        "name": "Room Occupancy",
        "style": {
            "fill": "#d1d1d1",
            "label": true,
            "color": "#ff0000",
            "stroke": "#ff0000"
        },
        "nodes": [
            "892f5bd40ea34fa7",
            "d8e8a190bec8e31e",
            "8eb972f3fb64d911",
            "557f56aa9c1a3d6e",
            "57645e74c93042ad",
            "551141c24385e2ad",
            "115d8674395891fb",
            "1b2ac0d050ad3653",
            "72fa1f75e1120c22",
            "89630bb4080e9dae",
            "9038e23a574b2a88",
            "31af033674c144cd",
            "32baa180a2940f91",
            "8c18cb7ae6fb2dbf",
            "d6a0b695b1b80573",
            "987197a4e81d8535",
            "68e149fe26bc603e",
            "259770596be8690c",
            "d9709e5d57e78534"
        ],
        "x": 114,
        "y": 859,
        "w": 1632,
        "h": 482
    },
    {
        "id": "892f5bd40ea34fa7",
        "type": "trigger-state",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "Presence_Computer_sensor  FP1",
        "server": "",
        "version": 2,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfiltertype": "exact",
        "debugenabled": false,
        "constraints": [
            {
                "targetType": "this_entity",
                "targetValue": "",
                "propertyType": "current_state",
                "propertyValue": "new_state.state",
                "comparatorType": "is",
                "comparatorValueDatatype": "str",
                "comparatorValue": "on"
            }
        ],
        "inputs": 0,
        "outputs": 2,
        "customoutputs": [],
        "outputinitially": false,
        "state_type": "str",
        "enableInput": false,
        "x": 270,
        "y": 900,
        "wires": [
            [
                "68e149fe26bc603e"
            ],
            [
                "259770596be8690c"
            ]
        ]
    },
    {
        "id": "d8e8a190bec8e31e",
        "type": "trigger-state",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "Computer Motion Detection up",
        "server": "",
        "version": 2,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfiltertype": "exact",
        "debugenabled": false,
        "constraints": [
            {
                "targetType": "this_entity",
                "targetValue": "",
                "propertyType": "current_state",
                "propertyValue": "new_state.state",
                "comparatorType": "is",
                "comparatorValueDatatype": "str",
                "comparatorValue": "on"
            }
        ],
        "inputs": 0,
        "outputs": 2,
        "customoutputs": [],
        "outputinitially": false,
        "state_type": "str",
        "enableInput": false,
        "x": 260,
        "y": 980,
        "wires": [
            [
                "68e149fe26bc603e"
            ],
            [
                "259770596be8690c"
            ]
        ]
    },
    {
        "id": "8eb972f3fb64d911",
        "type": "api-call-service",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "Room Occupancy - On",
        "server": "",
        "version": 5,
        "debugenabled": false,
        "domain": "input_boolean",
        "service": "turn_on",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "input_boolean.computer_room_occupancy"
        ],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 800,
        "y": 920,
        "wires": [
            []
        ]
    },
    {
        "id": "557f56aa9c1a3d6e",
        "type": "api-current-state",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "motion_computer_sensor_up 5 Seconds",
        "server": "",
        "version": 3,
        "outputs": 2,
        "halt_if": "off",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "binary_sensor.motion_computer_sensor_up",
        "state_type": "str",
        "blockInputOverrides": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "5",
        "forType": "num",
        "forUnits": "seconds",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 620,
        "y": 1240,
        "wires": [
            [
                "115d8674395891fb"
            ],
            [
                "1b2ac0d050ad3653"
            ]
        ]
    },
    {
        "id": "57645e74c93042ad",
        "type": "delay",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "",
        "pauseType": "delay",
        "timeout": "1",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 520,
        "y": 1100,
        "wires": [
            [
                "557f56aa9c1a3d6e"
            ]
        ]
    },
    {
        "id": "551141c24385e2ad",
        "type": "api-call-service",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "Room Occupancy - Off",
        "server": "",
        "version": 5,
        "debugenabled": false,
        "domain": "input_boolean",
        "service": "turn_off",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "input_boolean.computer_room_occupancy"
        ],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 1260,
        "y": 1240,
        "wires": [
            []
        ]
    },
    {
        "id": "115d8674395891fb",
        "type": "api-current-state",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "Presence_Computer_sensor FP1",
        "server": "",
        "version": 3,
        "outputs": 2,
        "halt_if": "off",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "binary_sensor.lumi_motion_ac01",
        "state_type": "str",
        "blockInputOverrides": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "1",
        "forType": "num",
        "forUnits": "seconds",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 920,
        "y": 1180,
        "wires": [
            [
                "551141c24385e2ad"
            ],
            [
                "89630bb4080e9dae"
            ]
        ]
    },
    {
        "id": "1b2ac0d050ad3653",
        "type": "link out",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "",
        "mode": "link",
        "links": [
            "72fa1f75e1120c22"
        ],
        "x": 795,
        "y": 1300,
        "wires": []
    },
    {
        "id": "72fa1f75e1120c22",
        "type": "link in",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "",
        "links": [
            "1b2ac0d050ad3653"
        ],
        "x": 395,
        "y": 1300,
        "wires": [
            [
                "57645e74c93042ad"
            ]
        ]
    },
    {
        "id": "89630bb4080e9dae",
        "type": "link out",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "",
        "mode": "link",
        "links": [
            "9038e23a574b2a88"
        ],
        "x": 1185,
        "y": 1120,
        "wires": []
    },
    {
        "id": "9038e23a574b2a88",
        "type": "link in",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "",
        "links": [
            "89630bb4080e9dae"
        ],
        "x": 695,
        "y": 1140,
        "wires": [
            [
                "57645e74c93042ad"
            ]
        ]
    },
    {
        "id": "31af033674c144cd",
        "type": "trigger-state",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "Presence_sensor_FP1",
        "server": "",
        "version": 2,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfiltertype": "exact",
        "debugenabled": false,
        "constraints": [
            {
                "targetType": "this_entity",
                "targetValue": "",
                "propertyType": "current_state",
                "propertyValue": "new_state.state",
                "comparatorType": "is",
                "comparatorValueDatatype": "str",
                "comparatorValue": "on"
            },
            {
                "targetType": "entity_id",
                "targetValue": "input_boolean.computer_room_occupancy",
                "propertyType": "current_state",
                "propertyValue": "new_state.state",
                "comparatorType": "is",
                "comparatorValueDatatype": "str",
                "comparatorValue": "on"
            }
        ],
        "inputs": 0,
        "outputs": 2,
        "customoutputs": [],
        "outputinitially": false,
        "state_type": "str",
        "enableInput": false,
        "x": 260,
        "y": 1080,
        "wires": [
            [
                "57645e74c93042ad"
            ],
            []
        ]
    },
    {
        "id": "32baa180a2940f91",
        "type": "api-call-service",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "Room Occupancy - off",
        "server": "",
        "version": 5,
        "debugenabled": false,
        "domain": "input_boolean",
        "service": "turn_off",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "input_boolean.computer_room_occupancy"
        ],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 1620,
        "y": 920,
        "wires": [
            []
        ]
    },
    {
        "id": "8c18cb7ae6fb2dbf",
        "type": "join-wait",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "",
        "paths": "[\"binary_sensor.lumi_motion_ac01\",\"binary_sensor.motion_computer_sensor_up\"]",
        "pathsToExpire": "",
        "useRegex": false,
        "warnUnmatched": true,
        "pathTopic": "topic",
        "pathTopicType": "msg",
        "correlationTopic": "",
        "correlationTopicType": "undefined",
        "timeout": "5",
        "timeoutUnits": "60000",
        "exactOrder": "false",
        "firstMsg": "true",
        "mapPayload": "false",
        "disableComplete": false,
        "persistOnRestart": false,
        "x": 1420,
        "y": 980,
        "wires": [
            [
                "32baa180a2940f91"
            ],
            [
                "987197a4e81d8535"
            ]
        ]
    },
    {
        "id": "d6a0b695b1b80573",
        "type": "trigger-state",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "Computer Motion Detection up",
        "server": "",
        "version": 2,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfiltertype": "exact",
        "debugenabled": false,
        "constraints": [
            {
                "targetType": "this_entity",
                "targetValue": "",
                "propertyType": "current_state",
                "propertyValue": "new_state.state",
                "comparatorType": "is",
                "comparatorValueDatatype": "str",
                "comparatorValue": "on"
            },
            {
                "targetType": "entity_id",
                "targetValue": "input_boolean.computer_room_occupancy",
                "propertyType": "current_state",
                "propertyValue": "new_state.state",
                "comparatorType": "is",
                "comparatorValueDatatype": "str",
                "comparatorValue": "off"
            }
        ],
        "inputs": 0,
        "outputs": 2,
        "customoutputs": [],
        "outputinitially": false,
        "state_type": "str",
        "enableInput": false,
        "x": 1100,
        "y": 920,
        "wires": [
            [],
            [
                "8c18cb7ae6fb2dbf"
            ]
        ]
    },
    {
        "id": "987197a4e81d8535",
        "type": "delay",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "",
        "pauseType": "rate",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "5",
        "rateUnits": "minute",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": true,
        "allowrate": false,
        "outputs": 1,
        "x": 1380,
        "y": 900,
        "wires": [
            [
                "32baa180a2940f91",
                "8c18cb7ae6fb2dbf"
            ]
        ]
    },
    {
        "id": "68e149fe26bc603e",
        "type": "trigger",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "",
        "op1": "",
        "op2": "40",
        "op1type": "nul",
        "op2type": "str",
        "duration": "40",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 570,
        "y": 920,
        "wires": [
            [
                "8eb972f3fb64d911"
            ]
        ]
    },
    {
        "id": "259770596be8690c",
        "type": "change",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "reset",
                "pt": "msg",
                "to": "reset",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 560,
        "y": 980,
        "wires": [
            [
                "68e149fe26bc603e",
                "8c18cb7ae6fb2dbf"
            ]
        ]
    },
    {
        "id": "d9709e5d57e78534",
        "type": "trigger-state",
        "z": "a51638c2.321cb",
        "g": "5ff89e5dc5bdb673",
        "name": "Presence_Computer_sensor FP1",
        "server": "f22f6e73.21e16",
        "version": 2,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityid": "binary_sensor.lumi_motion_ac01",
        "entityidfiltertype": "exact",
        "debugenabled": false,
        "constraints": [
            {
                "targetType": "this_entity",
                "targetValue": "",
                "propertyType": "current_state",
                "propertyValue": "new_state.state",
                "comparatorType": "is",
                "comparatorValueDatatype": "str",
                "comparatorValue": "on"
            }
        ],
        "inputs": 0,
        "outputs": 2,
        "customoutputs": [],
        "outputinitially": false,
        "state_type": "str",
        "enableInput": false,
        "x": 1110,
        "y": 1040,
        "wires": [
            [],
            [
                "8c18cb7ae6fb2dbf"
            ]
        ]
    },
    {
        "id": "f22f6e73.21e16",
        "type": "server",
        "name": "yuval_Home Assistant",
        "version": 4,
        "addon": false,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true,
        "heartbeat": false,
        "heartbeatInterval": "30",
        "areaSelector": "friendlyName",
        "deviceSelector": "friendlyName",
        "entitySelector": "friendlyName",
        "statusSeparator": "at: ",
        "statusYear": "hidden",
        "statusMonth": "short",
        "statusDay": "numeric",
        "statusHourCycle": "h23",
        "statusTimeFormat": "h:m"
    }
]

Occupancy of rooms - I did automation but it is not the most accurate, I would be happy for help.

The sensors I use with are
1 - aqara sensor, normal motion that refreshes every 5 minutes (I think)
2- The second sensor is aqara FP1

Thanks

???No one works this way? I am the child of the world

Could you explain what the exact problems you are having and what you are trying to achieve.

Perhaps the automation can be improved… I want to make sure that the sensors are not messed up… I mean… if I am in a room where motion/presence sensors will constantly check because they are alert

So I want to do the 2 sensors that were more accurate and if less missed