Private constructorPrivate Optional currentReadonly interfacePrivate Optional realtimePrivate runningReadonly settingsReadonly api: stringThe URL to the api. E.g. http://localhost:8000/api. Corresponding environment variable: API
Readonly baudThe baud rate to use. Default is 19200. This has to match your weather station's settings! Corresponding environment variable: BAUD_RATE
Readonly consoleWhether the console log is enabled. Default is true. Corresponding environment variable: CONSOLE_LOG
Readonly fileWhether file logging is enabled. Default is true. Corresponding environment variable: FILE_LOG
Readonly key: stringThe api key used to communicate with the api. Corresponding environment variable: API_KEY
Readonly logWhether to log detailed error information. Default is true. Corresponding environment variable: `LOG_ERROR_INFORMATION´
Readonly logThe minimimum log level that will be output. Default is "info". Corresponding environment variable: LOG_LEVEL
Readonly model: AdvancedModelThe weather station model. Default is PRO2. Corresponding environment variable: MODEL
Readonly path: stringThe serial path to the weather station. E.g. COM3. Corresponding environment variable: SERIAL_PATH
Readonly preferWhether to prefer environment variables configured in the .env file. Default is false.
Optional Readonly rainThe weather station's rain collector size.
Readonly units: { readonly rain: RainUnit; readonly wind: WindUnit; readonly temperature: TemperatureUnit; readonly solarRadiation: "W/m²"; readonly pressure: PressureUnit; }The default units. Important: Has to match the configured vant-api units! Corresponding environment variables: RAIN_UNIT, TEMPERATURE_UNIT, ...
Configures the current conditions task. This is related to the /api/v1/current route.
Pass your desired settings to configure and enable the task, pass false to disable it.
It is also possible to configure your recorder using a .env file. To enable this feature pass useEnvironmentVariables: true.
To start all your configured tasks run start().
InvalidRecorderConfigurationError if the settings are invalid
Static createCreates a new recorder with the passed settings. Throws an InvalidRecorderConfigurationError if the settings are invalid.
It is also possible to configure your recorder using a .env file. To enable this feature pass useEnvironmentVariables: true.
Example:
// create recorder
const recorder = await Recorder.create({
path: "COM5",
api: "http://localhost:8000/api",
rainCollectorSize: "0.2mm",
model: "Pro2",
....
});
// configure realtime recordings
recorder.configureRealtimeRecording({ interval: 10 });
// start recorder
recorder.start();
a recorder instance
InvalidRecorderConfigurationError if the settings are invalid
Static Private createStatic Private loadStatic Private validateGenerated using TypeDoc
The recorder is the counter-part to the
startVantageAPI()function. It repeatedly sends weather data to a running vant-api instance via HTTP requests.To get the weather data is utilizes a VantPro2Interface or a VantVueInterface. Only works on Vantage Pro 2 and Vue (having firmware dated after April 24, 2002 / v1.90 or above).
The recorder is structured in multiple tasks which are responsibly for different kinds of weather data. Currently there are following tasks:
1s) [route:api/v1/current]To create a recorder write:
To configure the current conditions task write:
To start the recorder write: