Creates a new detailed 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).
your desired settings
the realtime data container
const realtime = WeatherStation.connectDetailedRealtimeDataContainer({
updateInterval: 1,
});
await realtime.waitForUpdate();
console.log(`It's ${realtime.tempOut}°F outside!`);
realtime.pause();
The altimeter setting
The current wind chill
The console's battery voltage
The calculated dew point
Measured evapotranspiration (ET) of the day
Measured evapotranspiration (ET) in the current month
Measured evapotranspiration (ET) in the current year
Current forecast computed by the connected vantage console
There are the following options:
The calculated forecast encoded as number:
8
=> Mostly Clear6
=> Partly Cloudy2
=> Mostly Cloudy3
=> Mostly Cloudy, Rain within 12 hours18
=> Mostly Cloudy, Snow within 12 hours19
=> Partly Cloudy, Rain or Snow within 12 hours7
=> Partly Cloudy, Rain within 12 hours22
=> Partly Cloudy, Snow within 12 hours23
=> Partly Cloudy, Rain or Snow within 12 hoursNot documented. Please create an issue on github if you know more about this.
The measured heat index
Holds daily, monthly and yearly highs and lows for all weather elements / sensors.
Measured extra humidities (from up to 7 sensors)
Current inside humidity in percent
Current outside humidity in percent
Measured leaf temperatures (from up to 4 sensors)
Measured leaf wetness from up to 4 sensors
Current pressure
Absolute barometric pressure. Equals to the raw sensor (pressRaw) reading plus user entered offset (pressUserOffset).
The barometer calibration number
Barometric sensor raw reading
The used barometric reduction method to calculate the ground pressure. There are three different settings:
The used barometric reduction method encoded as number.
0
is user offset, 1
is altimeter setting and 2
is NOAA bar reduction.
The pressure's trend. There are five possible trends:
The pressure's trend encoded as number.
-60
stands for Falling Rapidly-20
stands for Falling Slowly0
stands for Steady20
stands for Rising Slowly60
stands for Rising RapidlyThe user-entered barometric offset
The amount of rain that has fallen in the recent 15 minutes
The amount of rain that has fallen in the recent hour
The amount of rain that has fallen in the recent 24 hours
The amount of rain that fell today
The amount of rain that has fallen in this month
The current rain rate
The amount of rain that has fallen in this year
Readonly
settingsThe realtime interface's settings. Immutable.
Measured soil moisture from up to 4 sensors
Measured soil temperatures (from up to 4 sensors)
Currently measured solar radiation
The most recent rainstorm's amount of rain
The most recent rainstorm's start date (without time)
The today's sunrise time (e.g. "06:35"
)
The today's sunset time (e.g. "19:35"
)
Measured extra temperatures (from up to 7 sensors)
Current inside temperature (the console's temperature)
Current outside temperature
The currently measured THSW index. Requires a solar radiation sensor.
The time the record was created
The transmitter's battery status (poorly documented)
Currently measured UV index
Currently measured wind speed
Average wind speed in the recent ten minutes
Average wind speed in the recent two minutes
Currently measured wind direction encoded as string. Possible values are:
The wind speed direction in degrees (from 1
to 360
).
90°
is East, 180°
is South, 270°
is West and 360°
is North.
Speed of the heaviest gust in the recent 10 minutes
The heaviest wind gust's (windGust) direction encoded as string. Possible values are:
The heaviest wind gust's (windGust) direction in degrees (from 1
to 360
).
90°
is East, 180°
is South, 270°
is West and 360°
is North.
Static
defaultBy 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.
Adds an event listener. Possible events are described here.
The event to listen for
The listener to add
this (for chaining calls)
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.
Rest
...args: Parameters<RealtimeInterfaceEvents[U]>whether the event had listeners
Returns an array listing the events for which the realtime interface has registered listeners.
an array listing the events for which the realtime interface has registered listeners
Returns the current max listener value for the realtime interface which is either set by setMaxListeners or defaults to defaultMaxListeners.
the current max listener value for the current realtime interface instance
Returns the number of listeners listening to the event named eventName
.
the number of listeners listening to the event
Returns a copy of the array of listeners for the event named eventName
.
a copy of the array of listeners for the passed event
Alias for removeListener.
this (for chaining calls)
Alias for addListener.
this (for chaining calls)
Adds a one-time listener function for the event named eventName. The next time eventName is triggered, this listener is removed and then invoked.
this (for chaining calls)
Adds the listener function to the beginning of the listeners array for the event named eventName
.
No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName
and listener will result in the listener being added, and called, multiple times.
this (for chaining calls)
Adds a one-time listener function for the event named eventName
to the beginning of the listeners array.
The next time eventName
is triggered, this listener is removed, and then invoked.
this (for chaining calls)
Removes all listeners, or those of the specified eventName
.
Optional
eventName: keyof RealtimeInterfaceEventsthis (for chaining calls)
Removes the specified listener from the listener array for the event named eventName
.
the event the listener listens to
the listener to remove
this (for chaining calls)
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 this method.
To change the default for all EventEmitter instances, change defaultMaxListeners.
new limit for the amount of listeners for any single event on this realtime interface instance
this (for chaining calls)
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.
const err = await container.waitForUpdate();
Waits for the next valid update on the realtime interface. See RealtimeInterfaceEvents.
Generated using TypeDoc
The more feature rich version of the realtime data container providing HighsAndLows and DetailedRealtimeData. Only works on Vantage Pro 2 and Vue (having firmware dated after April 24, 2002 / v1.90 or above).
What are realtime data containers?
Realtime data containers 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.