{
    "general": {
        "name": {
            "default": "Pumping Station",
            "rules": {
                "type": "string",
                "description": "A human-readable name or label for this pumping station configuration."
            }
        },
        "id": {
            "default": null,
            "rules": {
                "type": "string",
                "nullable": true,
                "description": "A unique identifier for this pumping station configuration. If not provided, defaults to null."
            }
        },
        "unit": {
            "default": "m3/h",
            "rules": {
                "type": "string",
                "description": "The default flow unit used for reporting station throughput."
            }
        },
        "logging": {
            "logLevel": {
                "default": "info",
                "rules": {
                    "type": "enum",
                    "values": [
                        {
                            "value": "debug",
                            "description": "Log verbose diagnostic messages that aid in troubleshooting the station."
                        },
                        {
                            "value": "info",
                            "description": "Log general informational messages about station behavior."
                        },
                        {
                            "value": "warn",
                            "description": "Log warnings when station behavior deviates from expected ranges."
                        },
                        {
                            "value": "error",
                            "description": "Log only error level messages for critical failures."
                        }
                    ],
                    "description": "Defines the minimum severity that will be written to the log."
                }
            },
            "enabled": {
                "default": true,
                "rules": {
                    "type": "boolean",
                    "description": "If true, logging is active for the pumping station node."
                }
            }
        }
    },
    "functionality": {
        "softwareType": {
            "default": "pumpingstation",
            "rules": {
                "type": "string",
                "description": "Specified software type used to locate the proper default configuration."
            }
        },
        "role": {
            "default": "StationController",
            "rules": {
                "type": "string",
                "description": "Describes the station's function within the EVOLV ecosystem."
            }
        },
        "positionVsParent": {
            "default": "atEquipment",
            "rules": {
                "type": "enum",
                "description": "Defines how the station is positioned relative to its parent process or site.",
                "values": [
                    {
                        "value": "atEquipment",
                        "description": "The station is controlled at the equipment level and represents the primary pumping asset."
                    },
                    {
                        "value": "upstream",
                        "description": "The station governs flows entering upstream of the parent asset."
                    },
                    {
                        "value": "downstream",
                        "description": "The station influences conditions downstream of the parent asset, such as discharge or transfer."
                    }
                ]
            }
        },
        "tickIntervalMs": {
            "default": 1000,
            "rules": {
                "type": "number",
                "min": 100,
                "description": "Interval in milliseconds between internal evaluation cycles and output refreshes."
            }
        },
        "supportsSimulation": {
            "default": true,
            "rules": {
                "type": "boolean",
                "description": "Indicates whether the station can operate using simulated inflow and level data."
            }
        },
        "supportedChildSoftwareTypes": {
            "default": [
                "measurement"
            ],
            "rules": {
                "type": "set",
                "itemType": "string",
                "description": "List of child node software types that may register with the station."
            }
        }
    },
    "asset": {
        "uuid": {
            "default": null,
            "rules": {
                "type": "string",
                "nullable": true,
                "description": "Asset tag number which is a universally unique identifier for this pumping station."
            }
        },
        "tagCode": {
            "default": null,
            "rules": {
                "type": "string",
                "nullable": true,
                "description": "Asset tag code which uniquely identifies the pumping station. May be null if not assigned."
            }
        },
        "category": {
            "default": "station",
            "rules": {
                "type": "enum",
                "values": [
                    {
                        "value": "station",
                        "description": "Represents a dedicated pumping station asset."
                    }
                ],
                "description": "High level classification for asset reporting."
            }
        },
        "type": {
            "default": "pumpingstation",
            "rules": {
                "type": "string",
                "description": "Specific asset type used to identify this configuration."
            }
        },
        "model": {
            "default": "Unknown",
            "rules": {
                "type": "string",
                "description": "Manufacturer or integrator model designation for the station."
            }
        },
        "supplier": {
            "default": "Unknown",
            "rules": {
                "type": "string",
                "description": "Primary supplier or maintainer responsible for the station."
            }
        },
        "geoLocation": {
            "default": {
                "x": 0,
                "y": 0,
                "z": 0
            },
            "rules": {
                "type": "object",
                "description": "Coordinate reference for locating the pumping station.",
                "schema": {
                    "x": {
                        "default": 0,
                        "rules": {
                            "type": "number",
                            "description": "X coordinate in meters or site units."
                        }
                    },
                    "y": {
                        "default": 0,
                        "rules": {
                            "type": "number",
                            "description": "Y coordinate in meters or site units."
                        }
                    },
                    "z": {
                        "default": 0,
                        "rules": {
                            "type": "number",
                            "description": "Z coordinate in meters or site units."
                        }
                    }
                }
            }
        }
    },
    "basin": {
        "volume": {
            "default": "1",
            "rules": {
                "type": "number",
                "description": "Total volume of empty basin in m3"
            }
        },
        "height": {
            "default": "1",
            "rules": {
                "type": "number",
                "description": "Total height of basin in m"
            }
        },
        "levelUnit": {
            "default": "m",
            "rules": {
                "type": "string",
                "description": "Unit used for level related setpoints and thresholds."
            }
        },
        "heightInlet": {
            "default": 2,
            "rules": {
                "type": "number",
                "min": 0,
                "description": "Height of the inlet pipe measured from the basin floor (m)."
            }
        },
        "heightOutlet": {
            "default": 0.2,
            "rules": {
                "type": "number",
                "min": 0,
                "description": "Height of the outlet pipe measured from the basin floor (m)."
            }
        },
        "heightOverflow": {
            "default": 2.5,
            "rules": {
                "type": "number",
                "min": 0,
                "description": "Height of the overflow point measured from the basin floor (m)."
            }
        },
        "inletPipeDiameter": {
            "default": 0.4,
            "rules": {
                "type": "number",
                "min": 0,
                "description": "Nominal inlet pipe diameter (m)."
            }
        },
        "outletPipeDiameter": {
            "default": 0.4,
            "rules": {
                "type": "number",
                "min": 0,
                "description": "Nominal outlet pipe diameter (m)."
            }
        }
    },
    "hydraulics": {
        "maxInflowRate": {
            "default": 200,
            "rules": {
                "type": "number",
                "min": 0,
                "description": "Maximum expected inflow during peak events (m3/h)."
            }
        },
        "refHeight": {
            "default": "NAP",
            "rules": {
                "type": "enum",
                "values": [
                    {
                        "value": "NAP",
                        "description": "NAP (Normaal Amsterdams Peil)"
                    },
                    {
                        "value": "EVRF",
                        "description": "EVRF (European Vertical Reference Frame)"
                    },
                    {
                        "value": "EGM2008",
                        "description": "EGM2008 / EGM96 (satellietmetingen) Geopotentieel model earth "
                    }
                    
                ],
                "description": "Reference height to use to identify the height vs other basins with. This will say something more about the expected pressure loss in m head"
            }
        },
        "staticHead": {
            "default": 12,
            "rules": {
                "type": "number",
                "min": 0,
                "description": "Static head between station suction and discharge point (m)."
            }
        },
        "maxDischargeHead": {
            "default": 24,
            "rules": {
                "type": "number",
                "min": 0,
                "description": "Maximum allowable discharge head before calling for alarms (m)."
            }
        },
        "pipelineLength": {
            "default": 80,
            "rules": {
                "type": "number",
                "min": 0,
                "description": "Length of the discharge pipeline considered in calculations (m)."
            }
        },
        "defaultFluid": {
            "default": "wastewater",
            "rules": {
                "type": "enum",
                "values": [
                    {
                        "value": "wastewater",
                        "description": "The wet well is primarily cylindrical."
                    },
                    {
                        "value": "water",
                        "description": "The wet well is rectangular or box shaped."
                    }
                ]
            }
        },
        "temperatureReferenceDegC": {
            "default": 15,
            "rules": {
                "type": "number",
                "description": "Reference fluid temperature for property lookups (degC)."
            }
        }
    },
    "control": {
        "controlStrategy": {
            "default": "levelBased",
            "rules": {
                "type": "enum",
                "values": [
                    {
                        "value": "levelBased",
                        "description": "Lead and lag pumps are controlled by basin level thresholds."
                    },
                    {
                        "value": "pressureBased",
                        "description": "Pumps target a discharge pressure setpoint."
                    },
                    {
                        "value": "flowTracking",
                        "description": "Pumps modulate to match measured inflow or downstream demand."
                    },
                    {
                        "value": "manual",
                        "description": "Pumps are operated manually or by an external controller."
                    }
                ],
                "description": "Primary control philosophy for pump actuation."
            }
        },
        "levelSetpoints": {
            "default": {
                "startLeadPump": 1.2,
                "stopLeadPump": 0.8,
                "startLagPump": 1.8,
                "stopLagPump": 1.4,
                "alarmHigh": 2.3,
                "alarmLow": 0.3
            },
            "rules": {
                "type": "object",
                "description": "Level thresholds that govern pump staging and alarms (m).",
                "schema": {
                    "startLeadPump": {
                        "default": 1.2,
                        "rules": {
                            "type": "number",
                            "description": "Level that starts the lead pump."
                        }
                    },
                    "stopLeadPump": {
                        "default": 0.8,
                        "rules": {
                            "type": "number",
                            "description": "Level that stops the lead pump."
                        }
                    },
                    "startLagPump": {
                        "default": 1.8,
                        "rules": {
                            "type": "number",
                            "description": "Level that starts the lag pump."
                        }
                    },
                    "stopLagPump": {
                        "default": 1.4,
                        "rules": {
                            "type": "number",
                            "description": "Level that stops the lag pump."
                        }
                    },
                    "alarmHigh": {
                        "default": 2.3,
                        "rules": {
                            "type": "number",
                            "description": "High level alarm threshold."
                        }
                    },
                    "alarmLow": {
                        "default": 0.3,
                        "rules": {
                            "type": "number",
                            "description": "Low level alarm threshold."
                        }
                    }
                }
            }
        },
        "pressureSetpoint": {
            "default": 250,
            "rules": {
                "type": "number",
                "min": 0,
                "description": "Target discharge pressure when operating in pressure control (kPa)."
            }
        },
        "alarmDebounceSeconds": {
            "default": 10,
            "rules": {
                "type": "number",
                "min": 0,
                "description": "Time a condition must persist before raising an alarm (seconds)."
            }
        },
        "equalizationTargetPercent": {
            "default": 60,
            "rules": {
                "type": "number",
                "min": 0,
                "max": 100,
                "description": "Target fill percentage of the basin when operating in equalization mode."
            }
        },
        "autoRestartAfterPowerLoss": {
            "default": true,
            "rules": {
                "type": "boolean",
                "description": "If true, pumps resume based on last known state after power restoration."
            }
        },
        "manualOverrideTimeoutMinutes": {
            "default": 30,
            "rules": {
                "type": "number",
                "min": 0,
                "description": "Duration after which a manual override expires automatically (minutes)."
            }
        },
        "flowBalanceTolerance": {
            "default": 5,
            "rules": {
                "type": "number",
                "min": 0,
                "description": "Allowable error between inflow and outflow before adjustments are triggered (m3/h)."
            }
        }
    },
    "alarms": {
        "default": {
            "highLevel": {
                "enabled": true,
                "threshold": 2.3,
                "delaySeconds": 30,
                "severity": "critical",
                "acknowledgmentRequired": true
            },
            "lowLevel": {
                "enabled": true,
                "threshold": 0.2,
                "delaySeconds": 15,
                "severity": "warning",
                "acknowledgmentRequired": false
            }
        },
        "rules": {
            "type": "object",
            "description": "Alarm configuration for the pumping station.",
            "schema": {
                "highLevel": {
                    "default": {
                        "enabled": true,
                        "threshold": 2.3,
                        "delaySeconds": 30,
                        "severity": "critical",
                        "acknowledgmentRequired": true
                    },
                    "rules": {
                        "type": "object",
                        "schema": {
                            "enabled": {
                                "default": true,
                                "rules": {
                                    "type": "boolean",
                                    "description": "Enable or disable the high level alarm."
                                }
                            },
                            "threshold": {
                                "default": 2.3,
                                "rules": {
                                    "type": "number",
                                    "description": "Level threshold that triggers the high level alarm (m)."
                                }
                            },
                            "delaySeconds": {
                                "default": 30,
                                "rules": {
                                    "type": "number",
                                    "min": 0,
                                    "description": "Delay before issuing the high level alarm (seconds)."
                                }
                            },
                            "severity": {
                                "default": "critical",
                                "rules": {
                                    "type": "enum",
                                    "values": [
                                        {
                                            "value": "info",
                                            "description": "Informational notification."
                                        },
                                        {
                                            "value": "warning",
                                            "description": "Warning condition requiring attention."
                                        },
                                        {
                                            "value": "critical",
                                            "description": "Critical alarm requiring immediate intervention."
                                        }
                                    ],
                                    "description": "Severity associated with the high level alarm."
                                }
                            },
                            "acknowledgmentRequired": {
                                "default": true,
                                "rules": {
                                    "type": "boolean",
                                    "description": "If true, this alarm must be acknowledged by an operator."
                                }
                            }
                        }
                    }
                },
                "lowLevel": {
                    "default": {
                        "enabled": true,
                        "threshold": 0.2,
                        "delaySeconds": 15,
                        "severity": "warning",
                        "acknowledgmentRequired": false
                    },
                    "rules": {
                        "type": "object",
                        "schema": {
                            "enabled": {
                                "default": true,
                                "rules": {
                                    "type": "boolean",
                                    "description": "Enable or disable the low level alarm."
                                }
                            },
                            "threshold": {
                                "default": 0.2,
                                "rules": {
                                    "type": "number",
                                    "description": "Level threshold that triggers the low level alarm (m)."
                                }
                            },
                            "delaySeconds": {
                                "default": 15,
                                "rules": {
                                    "type": "number",
                                    "min": 0,
                                    "description": "Delay before issuing the low level alarm (seconds)."
                                }
                            },
                            "severity": {
                                "default": "warning",
                                "rules": {
                                    "type": "enum",
                                    "values": [
                                        {
                                            "value": "info",
                                            "description": "Informational notification."
                                        },
                                        {
                                            "value": "warning",
                                            "description": "Warning condition requiring attention."
                                        },
                                        {
                                            "value": "critical",
                                            "description": "Critical alarm requiring immediate intervention."
                                        }
                                    ],
                                    "description": "Severity associated with the low level alarm."
                                }
                            },
                            "acknowledgmentRequired": {
                                "default": false,
                                "rules": {
                                    "type": "boolean",
                                    "description": "If true, this alarm must be acknowledged by an operator."
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "simulation": {
        "enabled": {
            "default": false,
            "rules": {
                "type": "boolean",
                "description": "If true, the station operates in simulation mode using generated inflow and level data."
            }
        },
        "mode": {
            "default": "diurnal",
            "rules": {
                "type": "enum",
                "values": [
                    {
                        "value": "static",
                        "description": "Use constant inflow and level conditions."
                    },
                    {
                        "value": "diurnal",
                        "description": "Use a typical diurnal inflow curve to drive simulation."
                    },
                    {
                        "value": "storm",
                        "description": "Use an elevated inflow profile representing a storm event."
                    }
                ],
                "description": "Defines which synthetic profile drives the simulation."
            }
        },
        "seed": {
            "default": 42,
            "rules": {
                "type": "number",
                "description": "Seed used for pseudo-random components in simulation."
            }
        },
        "applyRandomNoise": {
            "default": true,
            "rules": {
                "type": "boolean",
                "description": "If true, adds small noise to simulated measurements."
            }
        },
        "inflowProfile": {
            "default": [
                80,
                110,
                160,
                120,
                90
            ],
            "rules": {
                "type": "array",
                "itemType": "number",
                "minLength": 1,
                "description": "Relative inflow profile used when mode is set to diurnal or storm (percentage of design inflow)."
            }
        }
    }
}
