![]() |
![]()
| ![]() |
![]()
NAMEx10oregon - Oregon sensor support for HEYU DESCRIPTIONHeyu is an X10 Automation program for Linux, Unix, and Mac OS X. See man page heyu(1) for usage information. Oregon sensors transmit encoded RF signals for Temperature, Relative Humidity, Barometric Pressure, Wind speed, Rainfall, and other variables. When equipped with a compatible RF receiver, Heyu can receive and decode this information. Also included in the same category are two miscellaneous sensors, the Electrisave CM113 and the OWL CM119, which transmit encoded data from AC current probes in the breaker box. SYSTEM REQUIREMENTSTo use Oregon sensors with Heyu requires a 433.92 MHz RFXCOM X10 RF receiver and Heyu version 2.3 or greater. Support for the Electrisave CM113 was added in Heyu version 2.7. Support for the OWL CM119 was added in Heyu version 2.8 but also requires the special CM119 option in the RFXCOM receiver. COMPILER OPTIONSupport for Oregon sensors is compiled into Heyu by default. A compiler option can be used to omit this support. See the file INSTALL included in the Heyu distribution source directory for details. CONFIGURATIONIt is assumed that a working installation of Heyu version 2.3 or greater exists on the computer, and that the user has a basic familiarity with Heyu. Include the following directive in the Heyu configuration file:
Start Heyu with ´heyu start´, then open another xterm window and run ´heyu monitor´ in it to start the Heyu Monitor. Wait for the sensor to make a transmission, usually about every 40 seconds, and in the Heyu monitor window you should then see something like this (ignoring the date and time):
The example is for an Oregon Remote Temperature and Humidity sensor, which is in the group of Oregon sensors using the protocol identified by the mnemonic ORE_TH1. Map the Oregon ID to an otherwise unused housecode and unitcode address with an ALIAS directive in your Heyu configuration file using the module type ORE_xxx corresponding to your sensor group. (A list of Oregon sensor module types appears farther down in this page.) Syntax:
Run ´heyu restart´ to incorporate this change into the running Heyu daemons. Then the next time the sensor makes a transmission you should see (with the above example) something like this:
STORED OREGON DATAIf the Heyu Engine daemon is running, current Oregon data is stored in the Heyu state tables and displayed in the Heyu log file (if thus configured). Stored data can be retrieved with the (lower case) Heyu state
commands corresponding to the displayed function labels. In the following,
"Hu" is the Housecode|Unit address to which the sensor has been
mapped in the ALIAS directive, or the alias label itself.
The command ´heyu show oregon´ will display stored data from all configured Oregon units in tabular form. UNIT SCALINGThe native units for output of Oregon sensors are Celsius for temperature, hPa (hectoPascals) for Barometric Pressure, and kilograms for Weight. (See the sections WIND SENSORS and RAIN SENSORS for information about those sensors.) These may be scaled by Heyu to different units with the following configuration file directives: Directive ORE_TSCALE <temp_scale> where <temp_scale> is F[ahrenheit], C[elsius], K[elvin], or
R[ankine].
Directive ORE_BPSCALE <BP_unit> <scale_factor> [<offset>] where <BP_unit> is the name of the new unit, e.g. mmHg, and <scale_factor> is the number by which the BP in hPa is multiplied to get its value in the new unit. Directive ORE_WGTSCALE <Weight_unit> <scale_factor> where <Weight_unit> is the name of the new unit, e.g., Lbs,
and <scale_factor> is the number by which the Weight in kilograms is
multiplied to get its value in the new unit.
The optional <offset> parameter is added to the BP after scaling. In the USA at least, barometric pressures reported by the National Weather Service are adjusted to the BP at sea level. The offset can be used to approximate this adjustment for altitude. Typical values for BP versus altitude can be found on the Internet. SUPPORTED OREGON MODEL NUMBERSThe following chart shows the Oregon model numbers known to be supported by the Heyu ORE_xxx module types. Temperature sensors:
Temperature / Humidity sensors:
Temperature / Humidity / Barometric Pressure sensors:
Weight sensors
Wind sensors
Rain sensors
UV sensors
Current sensors
Module types designated "Alpha" have not yet been tested with actual data. Module type ORE_IGNORE can be used to ignore signals from Oregon
sensors which may not be under your control, e.g., signals from a nearby
neighbor´s sensor. An unused Housecode/Unit address must be
sacrificed. Specify the Oregon IDs for one or more sensors to be ignored.
Note: Use of this module type does not prevent RF intereference with signals from your own sensors. See section MULTIPLE OREGON SENSORS below. Note: It´s possible for the signal transmitted from an ELS_ELEC1 sensor when the "Check" button is pressed to be confused with that from an Oregon temperature sensor type ORE_T2. Pressing the Check button a second time will generally clear up the confusion. The following module types are Oregon emulation (dummy) modules.
See section "OREGON SENSOR EMULATION" below for usage. These
modules do not take an ID parameter.
TEMPERATURE, HUMIDITY, and BAROMETRIC PRESSURE SETPOINTSTemperature, Relative Humidity, and Barometric Pressure Min and/or
Max setpoints can be defined for any Oregon sensor by appending parameters
"TMIN <setpoint>" and/or "TMAX <setpoint>"
and/or "RHMIN <setpoint>" and/or "RHMAX
<setpoint>" and/or "BPMIN|BPMINL <setpoint>"
and/or "BPMAX|BPMAXL <setpoint>" to the ALIAS directive line
for that sensor in the configuration file. When the data value reported by
the sensor falls below or above the respective setpoint, corresponding local
flags TMIN, TMAX, RHMIN, RHMAX, BPMIN, and BPMAX are raised which can be
tested in the launch conditions for a Heyu script.
Then if the B7 sensor reports a crawl-space temperature lower than 32 Fahrenheit, the TMIN flag will be raised. If the crawl-space humidity exceeds 90%, the RHMAX flag will be raised. And if the D5 sensor reports an attic temperature outside the range 60F - 90F, then the appropriate TMIN or TMAX flag will be raised. If the temperature scale suffix (C, F, K, or R) is omitted from the setpoint, the config directive "ORE_DATA_ENTRY NATIVE|SCALED" determines whether the scale is the native Celsius scale or that defined by directive ORE_TSCALE. The only scale for relative humidity is %, which may optionally be omitted. The barometric pressure scale defined by the ORE_BPSCALE directive may optionally include an offset to adjust for altitude. If the specified Min or Max setpoint includes the offset, use BPMIN or BPMAX, otherwise use BPMINL or BPMAXL to specify that this is the unadjusted local pressure. In other words, a setpoint specified by BPMIN corresponds to the adjusted value displayed by Heyu, whereas a setpoint specified by BPMINL corresponds to the local value displayed on the sensor´s LCD screen. A BP setpoint may include the suffix for the units defined in the ORE_BPSCALE directive or the native units "hPa". If the setpoint is specified without a units suffix, the config directive "ORE_DATA_ENTRY NATIVE|SCALED" determines whether the scale is the native "hPa" or that defined by directive ORE_BPSCALE. HEYU SCRIPTSHeyu scripts can be launched by the functions "oretemp",
"orerh", and "orebp" the same as any other Heyu
function. Similarly the "elscurr", "owlpower", and
"owlenergy" functions from the current sensors
Local flags for the Oregon functions are "lobat" for
those sensors which transmit a low battery indicator,
"tmin"/"tmax" for the "oretemp" function,
"rhmin"/"rhmax" for the orerh function, and
"bpmin"/"bpmax" for the orebp function.
SCRIPT ENVIRONMENTAny Heyu script has access to the stored Oregon data values
through environment variables linked to the housecode|unit (Hu) and its
alias (note lower case x10_) mapped to each Oregon unit.
For sensor models which transmit this information:
If a Heyu script is launched by one of the functions "oretemp", "orerh", "orebp", "orewgt", "orewindsp", "orewindavsp", "orewinddir", "orerainrate", "oreraintot", "elscurr", "owlpower", or "owlenergy", the environment will additionally include variables for values and flags without the "Hu" identification, e.g., X10_oreTemp, X10_oreWgt, X10_elsCurr. No variable is created for data which is invalid or "not ready". CONFIGURATION DIRECTIVESIn addition to the ALIAS and scaling directives mentioned above, the following will also affect Oregon data. See man page x10config(5). Directive ORE_LOWBATTERY <percent> - Defines for those sensors which transmit a battery level the percentage at or below which Heyu will raise the "LoBat" flag. The default is 20%. Directive HIDE_UNCHANGED YES - Display transmission in the Monitor and Logfile only when there´s a change from the previous transmission. Directives ORE_CHGBITS_xx define the amount of change in the data
required for it to be identified as "changed". The parameter for
these directives is the number of least significant bits for the data in
question, which correspond to:
(See the sections WIND SENSORS and RAIN SENSORS for details about change bits for those sensor types.) Example:
The actual value of the data is stored in the Heyu state tables even though it´s not identified as changed or displayed in the Monitor/Log file. The default for each of the above directives is 1. Directive ORE_DATA_ENTRY NATIVE|SCALED
CURRENT SENSORSHeyu supports decoding of signals from the Electrisave CM113 and the newer OWL CM119 current sensors when received by an RFXCOM receiver in variable length packet mode. When Heyu receives a signal from these sensors, you will see
displayed in the monitor/logfile something similar to:
Map the signal to a Housecode|init (Hu) with an ALIAS directive:
Directive ELS_VOLTAGE <voltage>
Directive ELS_CHGBITS_CURR
The Electrisave CM113 sensor reports measured current (as func "elsCurr"), whereas the OWL CM119 sensor directly reports Power and total Energy usage computed internally in the sensor as functions "owlPower" and "owlEnergy". Directive OWL_VOLTAGE <voltage>
Directive OWL_CHGBITS_POWER <nbits>
Directive OWL_CALIB_POWER <factor>
Directive OWL_DISPLAY_COUNT YES|NO
HEYU COMMANDS: The most recent values of current, power, or energy are stored in
the state table and can be recovered with the commands:
HEYU ENVIRONMENT: Any Heyu script can retrieve the Electrisave or Owl data via the
following environment variables, where Hu is the Housecode|unit to which the
sensor is mapped.
Scripts launched by one of the sensor functions elscurr, owlpower,
or owlenergy will also have the corresponding environmental variable name
without the _Hu_, e.g., X10_owlPower. Additionally available are the signal
counters which are decremented and cycled 9-0 (or 15-0 if transmitted by
pressing the check/test button).
WIND SENSORSThere are currently three different protocols extant for Oregon
Wind Sensors data: Wind1, Wind2, and Wind3. These are identified by
"RFdata:Type" and decoded by the Heyu module types:
Having identified the protocol and ID byte from the RFdata:Type
displayed in the monitor/logfile, map the sensor to a housecode|unit address
with an ALIAS directive, e.g.,
Transmissions from wind sensors are single RF bursts and will be ignored if the <min_count> in directive AUX_REPCOUNTS is set greater than 1. The main difference between protocols insofar as the data is concerned is the wind direction. The Wind1 and Wind2 sensors report the direction as one of 16 compass points 22.5 degrees apart, whereas Wind3 sensors report the direction as degrees 0-359 with a precision of 1 degree. Therefore each bit specified with directive ORE_CHGBITS_WDIR will correspond to 22.5 degrees for Wind1 and Wind2 or 1 degree for Wind3. Directive ORE_WINDDIR_MODE DEGREES|POINTS|BOTH
Directive ORE_WINDSCALE <units_label> <scale_factor>
Directive ORE_WINDSENSOR_DIR <degrees>
Directive ORE_DISPLAY_BEAUFORT YES|NO
Directive ORE_DISPLAY_COUNT YES|NO
Directive ORE_CHGBITS_WINDSP <nbits>
HEYU COMMANDS: The lowercase functions orewindavsp, orewindsp, orewinddir can be
executed as Heyu commands to recover the most recent data stored in the Heyu
state tables. Example:
The command 'heyu show oregon' displays the stored data for all Oregon sensors in tabular form. The command 'heyu show sensors' displays the Active/Inactive state and battery state of all sensors along with the timestamp of the last received signal. HEYU SCRIPTS: The lowercase functions orewindavsp, orewindsp, and orewinddir can
be used in a SCRIPT directive the same as any other Heyu function to launch
a Heyu script.
Global flags and local flags "lobat" and "changed" can be included in the launch conditions as required. The source "rcva" must be included (unless it has been configured as a default source). HEYU ENVIRONMENT: Any Heyu script can retrieve the Wind data via the following
environment variables, where Hu is the Housecode|unit to which the sensor is
mapped.
Scripts launched by one of the sensor functions orewindavsp, orewindsp, or orewinddir will also have the corresponding environmental variable name without the _Hu_, e.g., X10_oreWindSp RAIN SENSORSThere are currently three different protocols extant for Oregon
Rain Sensors data: Rain1, Rain2, and Rain3. These are identified by
"RFdata:Type" and decoded by the Heyu module types:
Having identified the protocol and ID byte from the RFdata:Type
displayed in the monitor/logfile, map the sensor to a housecode|unit address
with an ALIAS directive, e.g.,
Transmissions from rain sensors are single RF bursts and will be ignored if the <min_count> in directive AUX_REPCOUNTS is set greater than 1. Mechanically, all the sensors work with a bucket arrangement. When a bucket is filled with a certain amount of rain water, it tips and dumps its contents and the tip is counted. The main difference between the protocols insofar as data is concerned is in the native units. For Rain1, the units are millimeters/hr and millimeters with a precision of 1 millimeter(/hr). For Rain2 and Rain3, the units are inches/hr and inches with a precision of 0.001 inch(/hr). What somewhat confuses things is that for Rain2 at least, the total rain count is not incremented by the exact same amount for each tip of the bucket. The increments 39, 40, 43, 44 (i.e., 0.039, 0.040, 0.043, 0.044 inches) appear in what seems to be a complex pattern which is yet to be comprehended. Directive ORE_RAINRATESCALE <units_label>
<scale_factor>
Directive ORE_DISPLAY_COUNT YES|NO
Directive ORE_CHGBITS_RAINRATE <nbits>
FLAGS: Each sensor has a battery monitor. For Rain2 and Rain3, a
low-battery indicator is transmitted and Heyu will display the LoBat flag
with the data when it is received.
When the total rain counter rolls over to zero, the Heyu "rollover" flag is raised and displayed. For Rain2, rollover has been determined to occur after an accumulation of 393.70 inches, which appears to be a strange number until the realization that it´s equivalent to 10000 millimeters. The Rain1 and Rain3 rollover points are assumed to be the same as for Rain2, but this has not been verified. HEYU COMMANDS: The lowercase functions orerainrate and oreraintot can be executed
as Heyu commands to recover the most recent data stored in the Heyu state
tables. Example:
The command 'heyu show oregon' displays the stored data for all Oregon sensors in tabular form. The command 'heyu show sensors' displays the Active/Inactive state and battery state of all sensors along with the timestamp of the last received signal. HEYU SCRIPTS: The lowercase functions orerainrate and oreraintot can be used in
a SCRIPT directive the same as any other Heyu function to launch a Heyu
script.
Global flags and local flags "lobat" and "changed" can be included in the launch conditions as required. The source "rcva" must be included (unless it has been configured as a default source). HEYU ENVIRONMENT: Any Heyu script can retrieve the Wind data via the following
environment variables, where Hu is the Housecode|unit to which the sensor is
mapped.
Scripts launched by one of the sensor functions orerainrate oreraintot will also have the corresponding environmental variable name without the _Hu_, e.g., X10_oreRainRate APPLICABLE OLDER DIRECTIVES for WIND and RAIN sensors.Directive HIDE_UNCHANGED YES|NO
Directive INACTIVE_TIMEOUT <hh:mm:ss>
Directive ORE_DISPLAY_BATLVL YES|NO
Directive ORE_DISPLAY_CHAN YES|NO
Directive DISPLAY_SENSOR_INTV YES|NO
OREGON SENSOR EMULATIONAn external program can store Temp/RH/BP data in the state table for an emulation (dummy) Oregon module for processing by Heyu, just as if the data were received from an actual Oregon sensor. The available emulation modules (described previously) are ORE_TEMU, ORE_THEMU, and ORE_THBEMU which are mapped to a housecode|unit address with an ALIAS directive, similar to an actual Oregon sensor. To store data, use the command:
where:
The configuration directive ORE_DATA_ENTRY determines the units in
which Heyu expects the data values to be entered, unless for Temperature it
has been overridden by a scale suffix.
Entered BP data is expected to be the local value, without the offset (typically for adjustment to sea level) which is optionally specified with ORE_BPSCALE. (The offset is applied to the value displayed in the monitor or log file and to the Heyu environment variables when a script is launched.) Example:
At the command prompt:
The signal will appear in the logfile and monitor with source SNDC. Remember to include this in the launch conditions if the signal is expected to launch a Heyu script. MULTIPLE OREGON SENSORSIf multiple Oregon sensors are to be used, they should be different models and/or set to different channel numbers so each has a different transmission interval (and not an interval which is an integer multiple of another interval). Not doing so risks having "blackout" periods during which the RF signals from two or more sensors with the same transmission interval interfere with each other over an extended period of time. The transmission interval for Oregon sensors is typically 30, 40 or 60 seconds offset by an interval depending on the channel number. E.g., here are the nominal intervals in seconds for several Oregon models. (Users owning other models are encouraged to submit the information for those models so we can expand this table.)
Rebranded Units:
Weather sensors:
Current sensors:
The STR928N Solar Panel houses the transmitters for both PCR918N
(ORE_RAIN1) and THGR918N (ORE_TH6) sensors within the panel housing.
The length of an Oregon RF transmission depends on the type, but is somewhere around 150-400 milliseconds. With two THR138 sensors set to channels 1 and 2 respectively, one might expect that the two sensors would transmit at the same time _at most_ once every (30 * 29) = 870 seconds. The most likely result of an overlap of the RF transmissions is that the RFXCOM receiver will not recognize the signal as a valid Oregon signal and remain silent, but losing one out of every 30 transmissions is normally not that serious a problem. However consider the case of two sensors with the same nominal transmission interval. Each Oregon sensor has an independent timebase and the transmission intervals will be slightly different. The two sensors may run for a long time without the transmissions overlapping, but one will eventually catch up with the other. Suppose the intervals of two sensors differ by 10 milliseconds. Then when the catchup occurs, the RF signal overlap will last for approximately (3 * 150) = 450 milliseconds divided by 10 milliseconds, or 45 intervals of 30 seconds - a blackout period of about 22 minutes when no signal will be reported. The smaller the difference between sensor intervals, the longer the blackout period will last. If you are forced to run more than one sensor with the same nominal transmission interval, a more precise measurement of the each interval can be obtained from the Heyu monitor by putting the directive "LOGDATE_UNIX YES" in the configuration file. An extended blackout longer than the time set by configuration directive INACTIVE_TIMEOUT (default 4 hours) will generate an Inactive message in the monitor/logfile. Although Heyu can be instructed to ignore signals from a neighbor´s sensors by using the ORE_IGNORE module type, those signals can still interfere with signals from your own sensors and result in a blackout if the transmission intervals are the same. SPECIAL BWR102 SETUPThe Oregon BWR102 scale has a switch on the scale for units kg, lbs, or stone-lbs, but this controls only the display on the scale´s LCD. The transmitted data is always in kg. Use the config directive ORE_WGTSCALE to define the units for Heyu´s display. Oregon appears to use the scale factor 2.200 for conversion from kg to lbs rather than the official value 2.2046226. However neither of these produces an exact match to the BWR102 LCD display for weights below about 50 lbs. The BWR102 transmits data as follows: After stepping on the scale and displaying the measurement, the scale retransmits the data up to seven times at approximately 10 or 11 second intervals (for use by the remote display unit provided with the scale). Heyu sets the ´changed´ flag for the first of these regardless of whether the weight in this measurement is the same or different as the previous measurement, i.e., if you step on the scale twice in a row and get the exact same reading (which is unusual), Heyu will still record the weight as changed. Note: Transmissions from the BWR102 are single RF bursts and will be ignored if the <min_count> in directive AUX_REPCOUNTS is set greater than 1. EXPERIMENTAL STUFFDirective "ORE_ID_16 YES" expands the ID of Oregon sensors to 16-bit by using the channel code as the upper byte of a 16-bit ID word and the normal sensor-assigned ID as the lower byte. This may be useful if you have some of the Oregon sensor models which can only generate a very limited number of different IDs. Heyu recognizes protocols for Oregon signals beyond those listed as supported, but by default ignores them. Directive DISPLAY_ORE_ALL YES - Instructs Heyu to display "RFdata" signals with all recognized Oregon protocols even though the support may not yet exist for them in Heyu. Recognized but unsupported protocols are:
AUTHORSOregon support was added to Heyu by Charles W. Sullivan using the protocols gratefully provided by RFXCOM. SEE ALSOhttp://www.heyu.org
|