[
    {
        "id": "5aa6983c28fd164e",
        "type": "debug",
        "z": "01a2a01f208f82a3",
        "name": "aircon",
        "active": true,
        "tosidebar": true,
        "console": true,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1240,
        "y": 60,
        "wires": []
    },
    {
        "id": "06893efbb952d654",
        "type": "server-events",
        "z": "01a2a01f208f82a3",
        "name": "Home assistant start",
        "server": "47fda6e5630a2a77",
        "version": 1,
        "event_type": "home_assistant_client",
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "waitForRunning": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "eventData"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "$outputData(\"eventData\").event_type",
                "valueType": "jsonata"
            }
        ],
        "x": 130,
        "y": 60,
        "wires": [
            [
                "3d9b1e42d6e72a03"
            ]
        ]
    },
    {
        "id": "3d9b1e42d6e72a03",
        "type": "switch",
        "z": "01a2a01f208f82a3",
        "name": "Ready?",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "ready",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 100,
        "y": 120,
        "wires": [
            [
                "1c6fd7827757ba51"
            ]
        ]
    },
    {
        "id": "108a3d688f13b360",
        "type": "inject",
        "z": "01a2a01f208f82a3",
        "name": "Every 5 minutes",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "300",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 130,
        "y": 240,
        "wires": [
            [
                "1c6fd7827757ba51"
            ]
        ]
    },
    {
        "id": "1c6fd7827757ba51",
        "type": "api-current-state",
        "z": "01a2a01f208f82a3",
        "name": "Water sensor wet?",
        "server": "47fda6e5630a2a77",
        "version": 3,
        "outputs": 2,
        "halt_if": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "binary_sensor.air_conditioning_tank_full",
        "state_type": "str",
        "blockInputOverrides": false,
        "outputProperties": [
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "",
                "valueType": "triggerId"
            },
            {
                "property": "state",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 370,
        "y": 120,
        "wires": [
            [
                "f24ade09cf2b6bbe"
            ],
            [
                "5b7445aea9248335"
            ]
        ]
    },
    {
        "id": "f24ade09cf2b6bbe",
        "type": "api-call-service",
        "z": "01a2a01f208f82a3",
        "name": "Run pump",
        "server": "47fda6e5630a2a77",
        "version": 5,
        "debugenabled": false,
        "domain": "switch",
        "service": "turn_on",
        "areaId": [],
        "deviceId": [
            "a69a8b5499c73cb411674fb75b9d15a4"
        ],
        "entityId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [
            {
                "property": "action",
                "propertyType": "msg",
                "value": "run_pump",
                "valueType": "str"
            }
        ],
        "queue": "none",
        "x": 610,
        "y": 60,
        "wires": [
            [
                "2f4d5572a9b4cd86",
                "5aa6983c28fd164e"
            ]
        ],
        "icon": "font-awesome/fa-toggle-on"
    },
    {
        "id": "2f4d5572a9b4cd86",
        "type": "delay",
        "z": "01a2a01f208f82a3",
        "name": "",
        "pauseType": "delay",
        "timeout": "15",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 900,
        "y": 100,
        "wires": [
            [
                "52bb7283aa9232d2"
            ]
        ]
    },
    {
        "id": "52bb7283aa9232d2",
        "type": "api-call-service",
        "z": "01a2a01f208f82a3",
        "name": "Stop pump",
        "server": "47fda6e5630a2a77",
        "version": 5,
        "debugenabled": false,
        "domain": "switch",
        "service": "turn_off",
        "areaId": [],
        "deviceId": [
            "a69a8b5499c73cb411674fb75b9d15a4"
        ],
        "entityId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [
            {
                "property": "action",
                "propertyType": "msg",
                "value": "stop_pump",
                "valueType": "str"
            }
        ],
        "queue": "none",
        "x": 1070,
        "y": 140,
        "wires": [
            [
                "5aa6983c28fd164e"
            ]
        ],
        "icon": "font-awesome/fa-toggle-off"
    },
    {
        "id": "5b7445aea9248335",
        "type": "api-current-state",
        "z": "01a2a01f208f82a3",
        "name": "Pump running?",
        "server": "47fda6e5630a2a77",
        "version": 3,
        "outputs": 2,
        "halt_if": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "switch.air_conditioning_pump_on_off",
        "state_type": "str",
        "blockInputOverrides": false,
        "outputProperties": [],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 620,
        "y": 140,
        "wires": [
            [
                "52bb7283aa9232d2"
            ],
            []
        ]
    },
    {
        "id": "d9aa0e5c14d5d3b4",
        "type": "server-state-changed",
        "z": "01a2a01f208f82a3",
        "name": "Water sensor",
        "server": "47fda6e5630a2a77",
        "version": 4,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfilter": "binary_sensor.air_conditioning_tank_full",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 1,
        "output_only_on_state_change": true,
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "ignorePrevStateNull": true,
        "ignorePrevStateUnknown": true,
        "ignorePrevStateUnavailable": true,
        "ignoreCurrentStateUnknown": true,
        "ignoreCurrentStateUnavailable": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "eventData"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "",
                "valueType": "triggerId"
            }
        ],
        "x": 110,
        "y": 180,
        "wires": [
            [
                "1c6fd7827757ba51"
            ]
        ]
    },
    {
        "id": "47fda6e5630a2a77",
        "type": "server",
        "name": "Home Assistant",
        "version": 4,
        "addon": false,
        "rejectUnauthorizedCerts": false,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true,
        "heartbeat": false,
        "heartbeatInterval": "30",
        "areaSelector": "friendlyName",
        "deviceSelector": "friendlyName",
        "entitySelector": "friendlyName",
        "statusSeparator": ": ",
        "statusYear": "hidden",
        "statusMonth": "short",
        "statusDay": "numeric",
        "statusHourCycle": "default",
        "statusTimeFormat": "h:m:s.ms"
    }
]
