Documentation ¶
Overview ¶
A simple library for interacting with the Rainforest Automation RAVEn
Index ¶
- Constants
- type ConnectionStatus
- type CurrentPeriodUsage
- type CurrentSummationDelivered
- type DeviceInfo
- type InstantaneousDemand
- type LastPeriodUsage
- type MessageCluster
- type MeterInfo
- type MeterList
- type NetworkInfo
- type PriceCluster
- type Raven
- func (r *Raven) Close() error
- func (r *Raven) CloseCurrentPeriod() error
- func (r *Raven) FactoryReset() error
- func (r *Raven) GetConnectionStatus() error
- func (r *Raven) GetCurrentPeriodUsage() error
- func (r *Raven) GetCurrentPrice() error
- func (r *Raven) GetCurrentSummationDelivered(refresh bool) error
- func (r *Raven) GetDeviceInfo() error
- func (r *Raven) GetInstantaneousDemand(refresh bool) error
- func (r *Raven) GetLastPeriodUsage() error
- func (r *Raven) GetMessage(refresh bool) error
- func (r *Raven) GetMeterInfo() error
- func (r *Raven) GetMeterList() error
- func (r *Raven) GetNetworkInfo() error
- func (r *Raven) GetProfileData()
- func (r *Raven) GetSchedule() error
- func (r *Raven) GetTime() error
- func (r *Raven) Initialize() error
- func (r *Raven) Receive() (notify interface{}, err error)
- func (r *Raven) Restart() error
- func (r *Raven) SetCurrentPrice()
- func (r *Raven) SetFastPoll()
- func (r *Raven) SetMeterInfo() error
- func (r *Raven) SetSchedule(event string, enabled bool) error
- func (r *Raven) SetScheduleDefault(event string) error
- type ScheduleInfo
- type TimeCluster
Constants ¶
const ( TIME = "time" PRICE = "price" DEMAND = "demand" SUMMATION = "summation" MESSAGE = "message" )
Types of events
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionStatus ¶
type ConnectionStatus struct { XMLName xml.Name `xml:"ConnectionStatus"` DeviceMacId string `xml:"DeviceMacId"` MeterMacId string `xml:"MeterMacId"` Status string `xml:"Status"` Description string `xml:"Description,omitempty"` StatusCode string `xml:"StatusCode,omitempty"` ExtPanId string `xml:"ExtPanId,omitempty"` Channel int `xml:"Channel,omitempty"` ShortAddr string `xml:"ShortAddr,omitempty"` LinkStrength string `xml:"LinkStrength"` }
Notify: ConnectionStatus
type CurrentPeriodUsage ¶
type CurrentPeriodUsage struct { XMLName xml.Name `xml:"CurrentPeriodUsage"` DeviceMacId string `xml:"DeviceMacId"` MeterMacId string `xml:"MeterMacId"` TimeStamp string `xml:"TimeStamp"` CurrentUsage string `xml:"CurrentUsage"` Multiplier string `xml:"Multiplier"` Divisor string `xml:"Divisor"` DigitsRight string `xml:"DigitsRight"` DigitsLeft string `xml:"DigitsLeft"` SuppressLeadingZero string `xml:"SuppressLeadingZero"` StartDate string `xml:"StartDate"` }
Notify: CurrentPeriodUsage
type CurrentSummationDelivered ¶
type CurrentSummationDelivered struct { XMLName xml.Name `xml:"CurrentSummationDelivered"` DeviceMacId string `xml:"DeviceMacId"` MeterMacId string `xml:"MeterMacId"` TimeStamp string `xml:"TimeStamp"` SummationDelivered string `xml:"SummationDelivered"` SummationReceived string `xml:"SummationReceived"` Multiplier string `xml:"Multiplier"` Divisor string `xml:"Divisor"` DigitsRight string `xml:"DigitsRight"` DigitsLeft string `xml:"DigitsLeft"` SuppressLeadingZero string `xml:"SuppressLeadingZero"` }
Notify: CurrentSummationDelivered
func (*CurrentSummationDelivered) GetSummationDelivered ¶
func (c *CurrentSummationDelivered) GetSummationDelivered() (float64, error)
GetSummationDelivered() is a convenience function that returns a correctly formatted floating point number for the Current Summation Delivered field
func (*CurrentSummationDelivered) GetSummationReceived ¶
func (c *CurrentSummationDelivered) GetSummationReceived() (float64, error)
GetSummationReceived() is a convenience function that returns a correctly formatted floating point number for the Current Summation Received field
type DeviceInfo ¶
type DeviceInfo struct { XMLName xml.Name `xml:"DeviceInfo"` DeviceMacId string `xml:"DeviceMacId"` InstallCode string `xml:"InstallCode"` LinkKey string `xml:"LinkKey"` FWVersion string `xml:"FWVersion"` HWVersion string `xml:"HWVersion"` ImageType string `xml:"ImageType"` Manufacturer string `xml:"Manufacturer"` ModelId string `xml:"ModelId"` DateCode string `xml:"DateCode"` }
Notify: DeviceInfo
type InstantaneousDemand ¶
type InstantaneousDemand struct { XMLName xml.Name `xml:"InstantaneousDemand"` DeviceMacId string `xml:"DeviceMacId"` MeterMacId string `xml:"MeterMacId"` TimeStamp string `xml:"TimeStamp"` Demand string `xml:"Demand"` Multiplier string `xml:"Multiplier"` Divisor string `xml:"Divisor"` DigitsRight string `xml:"DigitsRight"` DigitsLeft string `xml:"DigitsLeft"` SuppressLeadingZero string `xml:"SuppressLeadingZero"` }
Notify: InstantaneousDemand
func (*InstantaneousDemand) GetDemand ¶
func (i *InstantaneousDemand) GetDemand() (float64, error)
GetDemand() is a convenience function that returns a correctly formatted floating point number for the Demand field
type LastPeriodUsage ¶
type LastPeriodUsage struct { XMLName xml.Name `xml:"LastPeriodUsage"` DeviceMacId string `xml:"DeviceMacId"` MeterMacId string `xml:"MeterMacId"` TimeStamp string `xml:"TimeStamp"` LastUsage string `xml:"LastUsage"` Multiplier string `xml:"Multiplier"` Divisor string `xml:"Divisor"` DigitsRight string `xml:"DigitsRight"` DigitsLeft string `xml:"DigitsLeft"` SuppressLeadingZero string `xml:"SuppressLeadingZero"` StartDate string `xml:"StartDate"` EndDate string `xml:"EndDate"` }
Notify: LastPeriodUsage
type MessageCluster ¶
type MessageCluster struct { XMLName xml.Name `xml:"MessageCluster"` DeviceMacId string `xml:"DeviceMacId"` MeterMacId string `xml:"MeterMacId"` TimeStamp string `xml:"TimeStamp"` Id string `xml:"Id"` Text string `xml:"Text"` ConfirmationRequired string `xml:"ConfirmationRequired"` Queued string `xml:"Queued"` }
Notify: MessageCluster
type MeterInfo ¶
type MeterInfo struct { XMLName xml.Name `xml:"MeterInfo"` DeviceMacId string `xml:"DeviceMacId"` MeterMacId string `xml:"MeterMacId"` NickName string `xml:"NickName"` Account string `xml:"Account,omitempty"` Auth string `xml:"Auth,omitempty"` Host string `xml:"Host,omitempty"` Enabled string `xml:"Enabled,omitempty"` }
Notify: MeterInfo
type MeterList ¶
type MeterList struct { XMLName xml.Name `xml:"MeterList"` DeviceMacId string `xml:"DeviceMacId"` MeterMacId []string `xml:"MeterMacId,omitempty"` }
Notify: MeterList
type NetworkInfo ¶
type NetworkInfo struct { XMLName xml.Name `xml:"NetworkInfo"` DeviceMacId string `xml:"DeviceMacId"` CoordMacId string `xml:"CoordMacId"` Status string `xml:"Status"` Description string `xml:"Description"` StatusCode string `xml:"StatusCode"` ExtPanId string `xml:"ExtPanId"` Channel string `xml:"Channel"` ShortAddr string `xml:"ShortAddr"` LinkStrength string `xml:"LinkStrength"` }
Notify: NetworkInfo
type PriceCluster ¶
type PriceCluster struct { XMLName xml.Name `xml:"PriceCluster"` DeviceMacId string `xml:"DeviceMacId"` MeterMacId string `xml:"MeterMacId"` TimeStamp string `xml:"TimeStamp"` Price string `xml:"Price"` Currency string `xml:"Currency"` TrailingDigits string `xml:"TrailingDigits"` Tier string `xml:"Tier"` TierLabel string `xml:"TierLabel,omitempty"` RateLabel string `xml:"RateLabel,omitempty"` }
Notify: PriceCluster
func (*PriceCluster) GetPrice ¶
func (p *PriceCluster) GetPrice() (float64, error)
GetPrice() is a convenience function to get a correctly formatted floating point number of the Price contained in the PriceCluster
type Raven ¶
type Raven struct {
// contains filtered or unexported fields
}
func (*Raven) CloseCurrentPeriod ¶
Force the RAVEn to roll over the current period to the last period and initialize the current period.
func (*Raven) FactoryReset ¶
FactoryReset resets the RAVEn. This command will erase the commissioning data and force a restart. On restart, the RAVEn will begin the commissioning cycle.
func (*Raven) GetConnectionStatus ¶
GetConnectionStatus gets the RAVEn connection information. The RAVEn will send a ConnectionStatus notification in response. The RAVEn continuously sends ConnectionStatus during the start-up sequence and during the join/re-join sequence for diagnostic purposes.
func (*Raven) GetCurrentPeriodUsage ¶
Get the accumulated usage information from the RAVEn. The RAVEn will send a CurrentPeriodUsage notification in response. Note that this command will not cause the current period consumption total to be updated. To do this, send a GetCurrentSummationDelivered command with Refresh set to Y.
func (*Raven) GetCurrentPrice ¶
Send the GET_CURRENT_PRICE command to get the price information. Set the refresh element to Y to force the RAVEn to get the information from the meter, not the cache. The RAVEn will send a PriceCluster notification in response.
func (*Raven) GetCurrentSummationDelivered ¶
Get the summation information from the RAVEn. If refresh is true, the device gets the information from the meter instead of from its cache.
func (*Raven) GetDeviceInfo ¶
GetDeviceInfo gets RAVEn configuration information. The RAVEn will send a DeviceInfo notification in response.
func (*Raven) GetInstantaneousDemand ¶
Get the demand information from the RAVEn. If refresh is true, the device gets the information from the meter instead of from its cache.
func (*Raven) GetLastPeriodUsage ¶
Get the previous period accumulation data from the RAVEn. The RAVEn will send a LastPeriodUsage notification in response.
func (*Raven) GetMessage ¶
GetMessage gets the current message. The RAVEn will send a MessageCluster notification in response.
func (*Raven) GetMeterInfo ¶
GetMeterInfo gets the meter information. The RAVEn will send a MeterInfo notification in response.
func (*Raven) GetMeterList ¶
GetMeterList gets the list of meters the RAVEn is connected to. The RAVEn will send a MeterList notification in response.
func (*Raven) GetNetworkInfo ¶
Get the status of the device on the network. The RAVEn will send a NetworkInfo notification in response.
func (*Raven) GetSchedule ¶
GetSchedule gets the RAVEn scheduler information. The RAVEn will send the ScheduleInfo notification in response; or, RAVEn will send a series of ScheduleInfo notifications if the Event field is omitted.
func (*Raven) GetTime ¶
Send the GET_TIME command to get the current time. The RAVEn will send a TimeCluster notification in response
func (*Raven) Initialize ¶
Intitialize reinitializes the XML parser on the device. Use this command when first connecting to the RAVEn prior to sending any other commands. Initialization is not required, but will speed up the initial connection.
func (*Raven) Restart ¶
Restart forces the RAVEn to go through the start-up sequence. This command is useful for capturing any diagnostic information sent during the start-up sequence.
func (*Raven) SetMeterInfo ¶
SetMeterInfo sets the meter information.
func (*Raven) SetSchedule ¶
SetSchedule updates the RAVEn scheduler. The command options include setting the frequency of the command in seconds, and disabling the event. If the event is disabled the frequency is set to 0xFFFFFFFF
func (*Raven) SetScheduleDefault ¶
SetScheduleDefault resets the RAVEn scheduler to default settings. If the Event field is set, only that schedule item is reset to default values; otherwise all schedule items are reset to their default values.
type ScheduleInfo ¶
type ScheduleInfo struct { XMLName xml.Name `xml:"ScheduleInfo"` DeviceMacId string `xml:"DeviceMacId"` MeterMacId string `xml:"MeterMacId,omitempty"` Event string `xml:"Event"` Frequency string `xml:"Frequency"` Enabled string `xml:"Enabled"` }
Notify: ScheduleInfo
type TimeCluster ¶
type TimeCluster struct { XMLName xml.Name `xml:"TimeCluster"` DeviceMacId string `xml:"DeviceMacId"` MeterMacId string `xml:"MeterMacId"` UTCTime string `xml:"UTCTime"` LocalTime string `xml:"LocalTime"` }
func (*TimeCluster) GetLocalTime ¶
func (t *TimeCluster) GetLocalTime() (time.Time, error)
GetLocalTime() is a convenience function to get the Local time contained in a TimeCluster notify
func (*TimeCluster) GetUTCTime ¶
func (t *TimeCluster) GetUTCTime() (time.Time, error)
GetUTCTime() is a convenience function to get the UTC time contained in a TimeCluster notify