Turn on fan only if both phones are charging

Do I have the logic here right? I want the ceiling fan to turn on only if both phones are being charged, and then turn off only if both phones are not being charged.

[
    {
        "id": "1c43178ce79561f9",
        "type": "tab",
        "label": "Test Flows",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "142960ea6b0cd901",
        "type": "server-state-changed",
        "z": "1c43178ce79561f9",
        "name": "Samsung Charging",
        "server": "4e3730d1.5341d",
        "version": 4,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfilter": "sensor.sm_s906u_battery_state",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "charging",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 2,
        "output_only_on_state_change": true,
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "ignorePrevStateNull": false,
        "ignorePrevStateUnknown": false,
        "ignorePrevStateUnavailable": false,
        "ignoreCurrentStateUnknown": false,
        "ignoreCurrentStateUnavailable": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "eventData"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "",
                "valueType": "triggerId"
            }
        ],
        "x": 190,
        "y": 160,
        "wires": [
            [
                "f54d211f8c307c1d"
            ],
            [
                "cf10b2b8285b9c29"
            ]
        ]
    },
    {
        "id": "cf10b2b8285b9c29",
        "type": "api-call-service",
        "z": "1c43178ce79561f9",
        "name": "",
        "server": "4e3730d1.5341d",
        "version": 5,
        "debugenabled": false,
        "domain": "fan",
        "service": "turn_off",
        "areaId": [],
        "deviceId": [
            "7bd734ad91a848408f4105ba0c31012d"
        ],
        "entityId": [
            "switch.fan_controller"
        ],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 750,
        "y": 300,
        "wires": [
            []
        ]
    },
    {
        "id": "023369e359e027a9",
        "type": "api-call-service",
        "z": "1c43178ce79561f9",
        "name": "",
        "server": "4e3730d1.5341d",
        "version": 5,
        "debugenabled": false,
        "domain": "fan",
        "service": "turn_on",
        "areaId": [],
        "deviceId": [
            "7bd734ad91a848408f4105ba0c31012d"
        ],
        "entityId": [
            "switch.fan_controller"
        ],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 750,
        "y": 220,
        "wires": [
            []
        ]
    },
    {
        "id": "d149619704489160",
        "type": "server-state-changed",
        "z": "1c43178ce79561f9",
        "name": "Iphone Charging",
        "server": "4e3730d1.5341d",
        "version": 4,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfilter": "sensor.iphone_battery_state",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "charging",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 2,
        "output_only_on_state_change": true,
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "ignorePrevStateNull": false,
        "ignorePrevStateUnknown": false,
        "ignorePrevStateUnavailable": false,
        "ignoreCurrentStateUnknown": false,
        "ignoreCurrentStateUnavailable": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "eventData"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "",
                "valueType": "triggerId"
            }
        ],
        "x": 180,
        "y": 320,
        "wires": [
            [
                "950ae9404f64280b"
            ],
            [
                "cf10b2b8285b9c29"
            ]
        ]
    },
    {
        "id": "f54d211f8c307c1d",
        "type": "api-current-state",
        "z": "1c43178ce79561f9",
        "name": "Iphone Battery State",
        "server": "4e3730d1.5341d",
        "version": 3,
        "outputs": 2,
        "halt_if": "charging",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "sensor.iphone_battery_state",
        "state_type": "str",
        "blockInputOverrides": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 440,
        "y": 160,
        "wires": [
            [
                "023369e359e027a9"
            ],
            [
                "cf10b2b8285b9c29"
            ]
        ]
    },
    {
        "id": "950ae9404f64280b",
        "type": "api-current-state",
        "z": "1c43178ce79561f9",
        "name": "Samsung Battery State",
        "server": "4e3730d1.5341d",
        "version": 3,
        "outputs": 2,
        "halt_if": "charging",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "sensor.sm_s906u_battery_state",
        "state_type": "str",
        "blockInputOverrides": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 390,
        "y": 260,
        "wires": [
            [
                "023369e359e027a9"
            ],
            [
                "cf10b2b8285b9c29"
            ]
        ]
    },
    {
        "id": "4e3730d1.5341d",
        "type": "server",
        "name": "Home Assistant",
        "addon": true,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "",
        "connectionDelay": false,
        "cacheJson": false,
        "heartbeat": false,
        "heartbeatInterval": "",
        "statusSeparator": "",
        "enableGlobalContextStore": false
    }
]