Class BasicRealtimeDataContainer

The smaller version of the realtime data container providing HighsAndLows and BasicRealtimeData. Works on any Vantage Vue, Pro and Pro 2.

What are realtime containers?

Realtime interfaces provide another level of abstraction to interact with your weather station. Instead of manually calling methods like WeatherStationAdvanced.getHighsAndLows or WeatherStationAdvanced.getDetailedRealtimeData, you just access the attributes of an instance of this class. E.g. to get the current outside temperature you just create a realtime interface and access it using realtime.tempOut.

Internally this works via an update cycle. Every container.settings.updateInterval seconds the interface requests data from your weather station to update its attributes. As the realtime interface is an EventEmitter, you can listen to the "update" event. Additionally there is the "valid-update" event which only fires if no error occurrs.

Hierarchy

Implements

Constructors

  • Creates a new basic realtime data container.

    It is not recommended to use the constructor directly, it is better to use the .createBasicRealtimeDataContainer() method of the weather station as this avoids multiple instances (singleton).

    Parameters

    Returns BasicRealtimeDataContainer

    the realtime data container

    Example

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

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

Properties

etDay: null | number = null

Measured evapotranspiration (ET) of the day

highsAndLows: HighsAndLows = ...

Holds daily, monthly and yearly highs and lows for all weather elements / sensors.

humIn: null | number = null

Current inside humidity in percent

humOut: null | number = null

Current outside humidity in percent

press: null | number = null

Current pressure

pressTrend: null | "Falling Rapidly" | "Falling Slowly" | "Steady" | "Rising Slowly" | "Rising Rapidly" = null

The pressure's trend. There are five possible trends:

  • Falling Rapidly
  • Falling Slowly
  • Steady
  • Rising Slowly
  • Rising Rapidly
pressTrendID: null | 0 | 60 | -60 | 20 | -20 = null

The pressure's trend encoded as number.

  • -60 stands for Falling Rapidly
  • -20 stands for Falling Slowly
  • 0 stands for Steady
  • 20 stands for Rising Slowly
  • 60 stands for Rising Rapidly
rainDay: null | number = null

The amount of rain that fell today

rainRate: null | number = null

The current rain rate

The realtime interface's settings. Immutable.

solarRadiation: null | number = null

Currently measured solar radiation

stormRain: null | number = null

The most recent rainstorm's amount of rain

stormStartDate: null | Date = null

The most recent rainstorm's start date (without time)

tempIn: null | number = null

Current inside temperature (the console's temperature)

tempOut: null | number = null

Current outside temperature

time: Date = ...

The time the record was created

uv: null | number = null

Currently measured UV index

wind: null | number = null

Currently measured wind speed

windAvg10m: null | number = null

Average wind speed in the recent ten minutes

windDir: null | "NNE" | "NE" | "ENE" | "E" | "ESE" | "SE" | "SSE" | "S" | "SSW" | "SW" | "WSW" | "W" | "WNW" | "NW" | "NNW" | "N" = null

Currently measured wind direction encoded as string. Possible values are:

  • NNE
  • NE
  • ENE
  • E
  • ESE
  • SE
  • SSE
  • S
  • SSW
  • SW
  • WSW
  • W
  • WNW
  • NW
  • NNW
  • N
windDirDeg: null | number = null

The wind speed direction in degrees (from 1 to 360). 90° is East, 180° is South, 270°is West and 360° is North.

defaultMaxListeners: number

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

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

Methods

  • Synchronously calls each of the listeners registered for the event eventName, in the order they were registered, passing the supplied arguments to each. Returns true if the event had listeners, false otherwise.

    Type Parameters

    Parameters

    Returns boolean

    whether the event had listeners

  • Returns an array listing the events for which the realtime interface has registered listeners.

    Type Parameters

    Returns U[]

    an array listing the events for which the realtime interface has registered listeners

  • Waits for the next update on the realtime interface. If an error occurrs while updating an error is returned (not thrown!). This can be used to handle errors optionally. See RealtimeInterfaceEvents.

    Returns Promise<any>

    Example

    const err = await container.waitForUpdate();
    

Generated using TypeDoc