/** * Central definitions for lift status sensors. * * `SENSOR` maps every known sensor to a human readable name so the codebase can * refer to `SENSOR.RearDoorPosition` instead of the magic number `503`. * * The value maps (`HealthStatus`, `DoorPosition`, `MovementState`) together with * the type guards below replace the scattered `Number()`/`String()` casts and the * hard coded comparisons against `1`, `0`, `"1"`, `"0"`, `"U"`, `"C"`, etc. */ /** * Named sensor IDs. Values are the raw numeric IDs used by the API. * Names are derived from the English sensor labels. */ export declare const SENSOR: { /** Sense module connected to SenseCloud (1 = connected) */ readonly SensecloudConnectionHealthy: 10; /** Mobile signal strength (percentage) */ readonly MobileSignalStrength: 23; /** SenseCloud Round Trip Time - past hour (ms) */ readonly SensecloudRttLastHour: 25; /** SenseCloud Round Trip Time - past 24 hours (ms) */ readonly SensecloudRttLast24Hours: 26; /** Controller connection with Sense module healthy (1 = healthy) */ readonly ControllerSenseModuleConnectionHealthy: 50; /** Energy meter 3-phase connection healthy (1 = healthy) */ readonly EnergyMeter3Phase: 54; /** Energy meter 1-phase connection healthy (1 = healthy) */ readonly EnergyMeter1Phase: 55; /** Trip counter */ readonly TripCounter: 100; /** Installation unavailable (1 = unavailable) */ readonly InstallationUnavailable: 103; /** Visit */ readonly Visit: 104; /** Available */ readonly Available: 105; /** Elevator in fault */ readonly ElevatorInFault: 106; /** Aggregated emergency stop */ readonly EmergencyStopAggregated: 107; /** Installation power */ readonly InstallationPower: 108; /** Energy consumption counter */ readonly EnergyConsumptionCounter: 109; /** Status reset contact */ readonly StatusResetContact: 110; /** Fault contact */ readonly FaultContact: 201; /** Aggregated fault (with availability impact) */ readonly AggregatedFault: 210; /** Aggregated message (without availability impact) */ readonly AggregatedMessage: 211; /** Technically available */ readonly TechnicallyAvailable: 212; /** Movement state */ readonly MovementState: 500; /** Current stop (doors open) */ readonly CurrentStopDoorsOpen: 501; /** Front door position (status) */ readonly FrontDoorPosition: 502; /** Rear door position (status) */ readonly RearDoorPosition: 503; /** Door line */ readonly DoorLine: 505; /** Temperature controller (-100 to 200) */ readonly TemperatureController: 506; /** Direction change counter */ readonly DirectionChangeCounter: 507; /** Door cycle counter - front door */ readonly DoorCycleCounterFront: 508; /** Door cycle counter - rear door */ readonly DoorCycleCounterRear: 509; /** Door cycle counter per stop - front door */ readonly DoorCycleCounterPerStopFront: 510; /** Door cycle counter per stop - rear door */ readonly DoorCycleCounterPerStopRear: 511; /** Stop counter */ readonly StopCounter: 512; /** Status messages */ readonly StatusMessages: 513; /** Last passed stop */ readonly LastPassedStop: 514; /** Current stop */ readonly CurrentStop: 515; /** Door movement counter - front door */ readonly DoorMovementCounterFront: 516; /** Door movement counter - rear door */ readonly DoorMovementCounterRear: 517; /** Door movement counter per stop - front door */ readonly DoorMovementCounterPerStopFront: 518; /** Door movement counter per stop - rear door */ readonly DoorMovementCounterPerStopRear: 519; /** Door reversal counter - front door */ readonly DoorReversalCounterFront: 520; /** Door reversal counter - rear door */ readonly DoorReversalCounterRear: 521; /** Door reversal counter per stop - front door */ readonly DoorReversalCounterPerStopFront: 522; /** Door reversal counter per stop - rear door */ readonly DoorReversalCounterPerStopRear: 523; /** Controller connection healthy (1 = healthy) */ readonly ControllerConnectionHealthy: 524; /** No response after call (carcall request no response) */ readonly NoResponseAfterCall: 550; /** Controller info */ readonly ControllerInfo: 590; /** Maximum number of floors/stops the lift serves (value is zero-based) */ readonly MaxFloors: 591; /** Lift plugin: name of the loaded plugin, equal to the prefix of the S513 codes produced by the plugin */ readonly LiftPlugin: 592; }; export type SENSOR = (typeof SENSOR)[keyof typeof SENSOR]; /** * Health status of a "connection healthy" style sensor (e.g. 10, 54, 55, 524). * The raw value is `1` (healthy), `0` (unhealthy) or `null`/`undefined`/empty * (the sensor never reported a value, i.e. not connected). */ export declare const HealthStatus: { readonly NotConnected: "NOT_CONNECTED"; readonly Healthy: "HEALTHY"; readonly Unhealthy: "UNHEALTHY"; }; export type HealthStatus = (typeof HealthStatus)[keyof typeof HealthStatus]; /** * Door position values as reported by sensors 502 and 503. */ export declare const DoorPosition: { readonly Unknown: ""; readonly Error: "?"; readonly Closed: "C"; readonly Open: "O"; readonly Closing: "-"; readonly Opening: "+"; readonly Locked: "X"; }; export type DoorPosition = (typeof DoorPosition)[keyof typeof DoorPosition]; /** * Movement state values as reported by sensor 500. */ export declare const MovementState: { readonly Unknown: ""; readonly Error: "?"; readonly Inactive: "I"; readonly Up: "U"; readonly Down: "D"; }; export type MovementState = (typeof MovementState)[keyof typeof MovementState]; /** * Sensors that report a binary "connection healthy" value (1 = healthy). */ export declare const HEALTH_SENSORS: (10 | 50 | 54 | 55 | 524)[]; /** * "Normal check" sensors where 1 is the good/green state. */ export declare const NORMAL_CHECK_SENSORS: (10 | 104 | 524)[]; /** * "Inverted check" sensors where 1 is the bad/red state. */ export declare const INVERTED_CHECK_SENSORS: (105 | 212 | 550)[]; /** * Energy meter connection-health sensors. */ export declare const ENERGY_METER_SENSORS: (54 | 55)[]; /** * Sensors whose value is zero-based and needs +1 for display. */ export declare const ZERO_BASED_STOP_SENSORS: (501 | 514 | 515)[]; /** * Sensors the 3D scene reads to drive its movement / stop / door display state. */ export declare const SCENE_SENSOR_IDS: (500 | 502 | 503 | 514 | 515)[]; /** * Raw values of a binary "connection healthy" sensor (e.g. 10, 54, 55, 524). */ export declare const HealthSensorValue: { readonly Unhealthy: 0; readonly Healthy: 1; }; export type HealthSensorValue = (typeof HealthSensorValue)[keyof typeof HealthSensorValue]; /** * Default sensors shown by the swimlane view. */ export declare const SWIMLANE_SENSOR_IDS: number[]; /** * Default sensors shown by the status grid (swimlane sensors + controller info). */ export declare const STATUS_SENSOR_IDS: number[]; /** * All sensors requested from the API/socket by `ls-data`. */ export declare const DATA_REQUEST_SENSOR_IDS: number[]; /** Serialize a list of sensor IDs to the comma-separated string props expect. */ export declare const sensorIdsToString: (ids: readonly number[]) => string; /** * Raw sensor values that must be substituted for display purposes. * The inverted question mark `"¿"` is shown as a regular `"?"` because the * font does not support the upside-down glyph. */ export declare const SENSOR_DISPLAY_VALUE_OVERRIDES: Record; /** Apply display-only substitutions to a raw sensor value. */ export declare const getDisplaySensorValue: (value: T) => T | string; /** * Whether `sensorId` is one of the given sensors. The rest parameter widens the * literal `SENSOR.*` values, so both inline lists and spread arrays work without * a cast or annotation: * `isSensorId(id, SENSOR.EnergyMeter3Phase, SENSOR.EnergyMeter1Phase)` * `isSensorId(id, ...HEALTH_SENSORS)` */ export declare const isSensorId: (sensorId: number, ...sensors: number[]) => boolean; /** Whether the sensor reports a binary "connection healthy" value. */ export declare const isHealthSensor: (sensorId: number) => boolean; /** Whether the sensor is a "normal check" sensor (1 = good). */ export declare const isNormalCheckSensor: (sensorId: number) => boolean; /** Whether the sensor is an "inverted check" sensor (1 = bad). */ export declare const isInvertedCheckSensor: (sensorId: number) => boolean; /** Whether the sensor value is zero-based and needs +1 for display. */ export declare const isZeroBasedStopSensor: (sensorId: number) => boolean; /** * Derive the {@link HealthStatus} from a raw "connection healthy" sensor value. * `null`/`undefined`/empty means the sensor never reported (not connected), * `1` means healthy and anything else means unhealthy. */ export declare const getHealthStatus: (value: string | number | boolean | null | undefined) => HealthStatus; /** Type guard: whether the value is a known {@link DoorPosition}. */ export declare const isDoorPosition: (value: string | number | null | undefined) => value is DoorPosition; /** Type guard: whether the value is a known {@link MovementState}. */ export declare const isMovementState: (value: string | number | null | undefined) => value is MovementState;