reports

package
v0.0.0-...-5760128 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Undefined = iota
	Temperature
	General
	Luminance
	Power
	RelativeHumidity
	Velocity
	Direction
	AtmosphericPressure
	BarometricPressure
	SolarRadiation
	DewPoint
	RainRate
	TideLevel
	Weight
	Voltage
	Current
	CO2Level
	AirFlow
	TankCapacity
	Distance
	AnglePosition
	Rotation
	WaterTemperature
	SoilTemperature
	SeismicIntensity
	SeismicMagnitude
	Ultraviolet
	ElectricalResistivity
	ElectricalConductivity
	Loudness
	Moisture
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Alarm

type Alarm struct {
	Type           byte `json:"type_"`
	Level          byte `json:"level"`
	SensorSourceID byte `json:"sensor_source_id"`
	SensorType     byte `json:"sensor_type"`
	Event          byte `json:"event"`
	Status         byte `json:"status"`
	// contains filtered or unexported fields
}

Alarm reports are sent from a node as an event. Is typicaly used for motion sensors and such to notify when motion is detected.

func NewAlarm

func NewAlarm(data []byte) (*Alarm, error)

NewAlarm creates a new alarm report.

func (Alarm) SetNode

func (r Alarm) SetNode(n byte)

func (*Alarm) String

func (a *Alarm) String() string

type ManufacturerSpecific

type ManufacturerSpecific struct {
	Manufacturer string `json:"manufacturer"`
	Type         string `json:"type"`
	ID           string `json:"id"`
	// contains filtered or unexported fields
}

ManufacturerSpecific reports are used to identify the manufacturer, model and version of a product.

func NewManufacturerSpecific

func NewManufacturerSpecific(data []byte) (*ManufacturerSpecific, error)

NewManufacturerSpecific decodes and returns a manufacureSpecific report.

func (ManufacturerSpecific) SetNode

func (r ManufacturerSpecific) SetNode(n byte)

func (*ManufacturerSpecific) String

func (ms *ManufacturerSpecific) String() string

type MultiChannelEndpoints

type MultiChannelEndpoints struct {
	Dynamic   bool `json:"dynamic"`   // When true are the number of endpoints dynamic else its always the same
	Identical bool `json:"identical"` // When true are all endpoints identical (same command classes)
	Endpoints int  `json:"endpoints"` // Number of available endpoints
	// contains filtered or unexported fields
}

func NewMultiChannelEndpoints

func NewMultiChannelEndpoints(data []byte) (*MultiChannelEndpoints, error)

func (MultiChannelEndpoints) SetNode

func (r MultiChannelEndpoints) SetNode(n byte)

func (*MultiChannelEndpoints) String

func (ms *MultiChannelEndpoints) String() string

type Report

type Report interface {
	SetNode(byte)
	String() string
}

func New

func New(c commands.ZWaveCommand, class byte, data []byte) (Report, error)

New creates a new report based on command, command class and data

type SensorMultiLevel

type SensorMultiLevel struct {
	ValueType  ZWaveSensorType `json:"value_type"`
	Size       byte            `json:"size"`
	Scale      byte            `json:"scale"`
	Precision  byte            `json:"precision"`
	Value      float64         `json:"value"`
	TypeString string          `json:"type_string"`
	Unit       string          `json:"unit"`
	// contains filtered or unexported fields
}

SensorMultiLevel is send from a zwave multilevel sensor to advertise a sensor reading

func NewSensorMultiLevel

func NewSensorMultiLevel(data []byte) (*SensorMultiLevel, error)

NewSensorMultiLevel decodes raw binary data in to a SensorMultiLevel

func (SensorMultiLevel) SetNode

func (r SensorMultiLevel) SetNode(n byte)

func (SensorMultiLevel) String

func (sml SensorMultiLevel) String() string

type SwitchBinaryV1

type SwitchBinaryV1 struct {
	CurrentValue bool `json:"current_value"` // The current state of the node
	Valid        bool `json:"valid"`         // If the state in known or not. Some devices report "unknown" state
	// contains filtered or unexported fields
}

SwitchBinaryV1 is sent from a zwave node to advertise the status of a device with On/Off or Enable/Disable capability. A known issue is that nodes with multiple endpoints will send a SwichBinary report on all endpoint binary state changes but without encapsulating it in a MultiChannel message.

func NewSwitchBinaryV1

func NewSwitchBinaryV1(data []byte) (*SwitchBinaryV1, error)

NewSwitchBinaryV1 creates a new SwitchBinary report that contains the switch status from a zwave node

func (SwitchBinaryV1) SetNode

func (r SwitchBinaryV1) SetNode(n byte)

func (*SwitchBinaryV1) String

func (sb *SwitchBinaryV1) String() string

type SwitchBinaryV2

type SwitchBinaryV2 struct {
	CurrentValue bool              `json:"current_value"` // The current state of the node
	TargetValue  bool              `json:"target_value"`  // The target state of the node
	Duration     commands.Duration `json:"duration"`      // The transition time between current and target values
	// contains filtered or unexported fields
}

SwitchBinaryV2 is sent from a zwave node to advertise the status of a device with On/Off or Enable/Disable capability. A known issue is that nodes with multiple endpoints will send a SwichBinary report on all endpoint state changes but without encapsulating it in a MultiChannel message.

func NewSwitchBinaryV2

func NewSwitchBinaryV2(data []byte) (*SwitchBinaryV2, error)

NewSwitchBinaryV2 creates a new switchBinary report that contains the switch status from a zwave node

func (SwitchBinaryV2) SetNode

func (r SwitchBinaryV2) SetNode(n byte)

func (*SwitchBinaryV2) String

func (sb *SwitchBinaryV2) String() string

type SwitchMultilevelV1

type SwitchMultilevelV1 struct {
	CurrentValue float64 `json:"current_value"` // The current value state
	Valid        bool    `json:"valid"`         // If the state in known or not. Some devices report "unknown" state
	// contains filtered or unexported fields
}

SwitchMultilevelV1 is sent by a zwave node to advertise the status of a multilevel device. A known issue is that nodes with multiple endpoints will send a SwichMultilevel report on all endpoint multilevel state changes but without encapsulating it in a MultiChannel message.

func NewSwitchMultilevelV1

func NewSwitchMultilevelV1(data []byte) (*SwitchMultilevelV1, error)

NewSwitchMultilevelV1 creates a new SwitchMultilevelV1 report from binary data sent from a zwave node

func (SwitchMultilevelV1) SetNode

func (r SwitchMultilevelV1) SetNode(n byte)

func (SwitchMultilevelV1) String

func (sm SwitchMultilevelV1) String() string

type SwitchMultilevelV4

type SwitchMultilevelV4 struct {
	CurrentValue float64           `json:"current_value"` // The current state of the node
	TargetValue  float64           `json:"target_value"`  // The target state of the node
	Duration     commands.Duration `json:"duration"`      // The transition time between current and target values
	Valid        bool              `json:"valid"`         // If the current state in known or not. Some devices report "unknown" state
	TargetValid  bool              `json:"target_valid"`  // If the target state in known or not. Some devices report "unknown" state
	// contains filtered or unexported fields
}

SwitchMultilevelV4 is sent by a zwave node to advertise the status of a multilevel device. A known issue is that nodes with multiple endpoints will send a SwichMultilevel report on all endpoint multilevel state changes but without encapsulating it in a MultiChannel message.

func NewSwitchMultilevelV4

func NewSwitchMultilevelV4(data []byte) (*SwitchMultilevelV4, error)

NewSwitchMultilevelV4 creates a new SwitchMultilevelV1 report from binary data sent from a zwave node

func (SwitchMultilevelV4) SetNode

func (r SwitchMultilevelV4) SetNode(n byte)

func (SwitchMultilevelV4) String

func (sm SwitchMultilevelV4) String() string

type WakeUp

type WakeUp struct {
	// contains filtered or unexported fields
}

WakeUp report. Zwave nodes that are battery powerd sends a wakeUp report when they wake up and listens for messages from the controller. This usualy happens something like once every hour and the node is typicaly awake for 1 second.

func NewWakeUp

func NewWakeUp() (*WakeUp, error)

NewWakeUp creates a new wakeUp report.

func (WakeUp) SetNode

func (r WakeUp) SetNode(n byte)

func (*WakeUp) String

func (wr *WakeUp) String() string

type ZWaveSensorType

type ZWaveSensorType byte

ZWaveSensorType describes the sensor type in a sensormultilevel report

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL