Class WeatherStationAdvanced

More feature rich interface to any Vantage Pro 2 or Vantage Vue weather station with firmware dated after April 24, 2002 (v1.90 or above). Is built on top of the WeatherStation.

Offers station dependent features like WeatherStationAdvanced.getDetailedRealtimeData, WeatherStationAdvanced.getLOOP1, WeatherStationAdvanced.getLOOP2, WeatherStationAdvanced.isSupportingLOOP2Packages and WeatherStationAdvanced.getFirmwareVersion.

Hierarchy

Properties

The used interface settings. These control the addressed serialport, the baud rate, the used units, etc. They are immutable.

See

WeatherStationSettings

defaultMaxListeners: number

By default, a maximum of 10 listeners can be registered for any single event. This limit can be changed for individual WeatherStation instances using the setMaxListeners method.

To change the default for all EventEmitter instances, this property can be used. If this value is not a positive number, a RangeError is thrown.

defaultSettings: WeatherStationSettings = ...

The WeatherStation's default settings.

Accessors

Methods

  • Validates the connection to the console by running the TEST command. No error is thrown on failure, instead false is resolved.

    Parameters

    • Optional timeout: number

    Returns Promise<boolean>

    whether the connection is valid

  • Creates a basic realtime data container. If there already is a basic realtime container this function returns the existing one and ignores the passed settings.

    This basic realtime data container repeatedly calls .getBasicRealtimeData() (and .getHighsAndLows()) in the background to update it's properties. On every (valid) update the (valid-)update is emitted.

    You can listen to them using standard event listeners:

    realtime.on("update", (err?) => console.log(`It's ${realtime.tempOut}°F outside!`)) 
    

    or wait for them asynchroniously:

    await realtime.waitForUpdate();
    console.log(`It's ${realtime.tempOut}°F outside!`);

    Parameters

    Returns BasicRealtimeDataContainer

    the new or existing realtime data container

    Example

    const realtime = WeatherStation.connectBasicRealtimeDataContainer({
    updateInterval: 1,
    });
    await realtime.waitForUpdate();

    console.log(`It's ${realtime.tempOut}°F outside!`);
    realtime.pause();
  • Creates a detailed realtime data container. If there already is a detailed realtime container this function returns the existing one and ignores the passed settings.

    This detailed realtime data container repeatedly calls .getDetailedRealtimeData() (and .getHighsAndLows()) in the background to update it's properties. On every (valid) update the (valid-)update is emitted.

    You can listen to them using standard event listeners:

    realtime.on("update", (err?) => console.log(`It's ${realtime.tempOut}°F outside!`)) 
    

    or wait for them asynchroniously:

    await realtime.waitForUpdate();
    console.log(`It's ${realtime.tempOut}°F outside!`);

    Parameters

    Returns AdvancedRealtimeDataContainer

    the new or existing realtime data container

    Example

    const realtime = WeatherStation.connectDetailedRealtimeDataContainer({
    updateInterval: 1,
    });
    await realtime.waitForUpdate();

    console.log(`It's ${realtime.tempOut}°F outside!`);
    realtime.pause();
  • Gets the console's firmware version in the "vX.XX" format (e.g. "v3.80").

    Parameters

    • Optional timeout: number

    Returns Promise<[string, undefined] | [null, VantError]>

    the console's firmware version

    Link

    Following errors are possible:

  • Gets the backwards compatible weather station type as string.

    • Wizard III
    • Wizard II
    • Monitor
    • Perception
    • GroWeather
    • Energy Enviromontor
    • Health Enviromonitor
    • Vantage Pro / Pro 2
    • Vantage Vue
    • null (an error occurred)

    Parameters

    • Optional timeout: number

    Returns Promise<[null, VantError] | ["Wizard III" | "Wizard II" | "Monitor" | "Perception" | "GroWeather" | "Energy Enviromontor" | "Health Enviromonitor" | "Vantage Pro / Pro 2" | "Vantage Vue", undefined]>

    the backwards compatible weather station type

    Link

    Following errors are possible:

  • Gets the backwards compatible weather station type. Use getWeatherstationType to get the type as string.

    • 0 => Wizard III
    • 1 => Wizard II
    • 2 => Monitor
    • 3 => Perception
    • 4 => GroWeather
    • 5 => Energy Enviromontor
    • 6 => Health Enviromonitor
    • 16 => Vantage Pro / Pro 2
    • 17 => Vantage Vue
    • null => An error occurred

    Parameters

    • Optional timeout: number

    Returns Promise<[null, VantError] | [0 | 1 | 16 | 2 | 3 | 4 | 6 | 5 | 17, undefined]>

    the backwards compatible weather station type

    Link

    Following errors are possible:

  • Checks whether the connected weather station is supporting LOOP2 packages. This is done using the firmware's date code.

    Parameters

    • Optional timeout: number

    Returns Promise<[null | boolean, undefined | VantError]>

    whether the connected weather station is supporting LOOP2 packages

    Link

    Following errors are possible:

  • Returns whether the interface tries to hold the connection to the weather station. After calling connect() this will return true. After calling disconnect() it will return false.

    Returns boolean

    whether the interface tries to hold the connection

  • Turns the console's background light off / on. Returns whether the command was executed successful.

    Parameters

    • state: boolean

      whether the background light should be on

    • Optional timeout: number

    Returns Promise<[boolean, undefined | VantError]>

    whether the command was executed successful

    Link

    Following errors are possible:

Generated using TypeDoc