semp

package
v0.0.0-...-175a4df Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodMeasurement = "Measurement"
	MethodEstimation  = "Estimation"
)

method definitions

View Source
const (
	StatusOn  = "On"
	StatusOff = "Off"
)

status definitions

Variables

This section is empty.

Functions

func UniqueDeviceID

func UniqueDeviceID() ([]byte, error)

UniqueDeviceID creates a 6-bytes base device id from machine id

Types

type Capabilities

type Capabilities struct {
	CurrentPowerMethod   string `xml:"CurrentPower>Method"`
	AbsoluteTimestamps   bool   `xml:"Timestamps>AbsoluteTimestamps"`
	InterruptionsAllowed bool   `xml:"Interruptions>InterruptionsAllowed"`
	OptionalEnergy       bool   `xml:"Requests>OptionalEnergy"`
}

Capabilities message definition

type Characteristics

type Characteristics struct {
	MinPowerConsumption int
	MaxPowerConsumption int
	MinOnTime           int `xml:",omitempty"`
	MinOffTime          int `xml:",omitempty"`
}

Characteristics message definition

type Device

type Device struct {
	DeviceType        string            `xml:"deviceType"`
	FriendlyName      string            `xml:"friendlyName"`
	Manufacturer      string            `xml:"manufacturer"`
	ModelName         string            `xml:"modelName"`
	UDN               string            `xml:"UDN"`
	PresentationURL   string            `xml:"presentationURL"`
	ServiceDefinition ServiceDefinition `xml:"semp:X_SEMPSERVICE"`
	ServiceList       []Service         `xml:"serviceList"` // optional
}

Device message definition

type Device2EM

type Device2EM struct {
	Xmlns           string            `xml:"xmlns,attr"`
	DeviceInfo      []DeviceInfo      `xml:",omitempty"`
	DeviceStatus    []DeviceStatus    `xml:",omitempty"`
	PlanningRequest []PlanningRequest `xml:",omitempty"`
}

Device2EM is the device to EM message

func Device2EMMsg

func Device2EMMsg() Device2EM

Device2EMMsg is the XML message container

type DeviceControl

type DeviceControl struct {
	DeviceID                    string `xml:"DeviceId"`
	On                          bool
	RecommendedPowerConsumption float64 // AN EVCharger
	Timestamp                   int
}

DeviceControl message definition

type DeviceDescription

type DeviceDescription struct {
	XMLName     xml.Name    `xml:"root"`
	Xmlns       string      `xml:"xmlns,attr"`
	SpecVersion SpecVersion `xml:"specVersion"`
	Device      Device      `xml:"device"`
}

DeviceDescription message definition

type DeviceInfo

type DeviceInfo struct {
	Identification  Identification
	Characteristics Characteristics
	Capabilities    Capabilities
}

DeviceInfo message definition

type DeviceStatus

type DeviceStatus struct {
	DeviceID          string `xml:"DeviceId"`
	EMSignalsAccepted bool
	Status            string
	PowerInfo         PowerInfo `xml:"PowerConsumption>PowerInfo"`
}

DeviceStatus message definition

type EM2Device

type EM2Device struct {
	Xmlns         string          `xml:"xmlns,attr"`
	DeviceControl []DeviceControl `xml:",omitempty"`
}

EM2Device is the EM to device message

type Identification

type Identification struct {
	DeviceID     string `xml:"DeviceId"`
	DeviceName   string
	DeviceType   string
	DeviceSerial string
	DeviceVendor string
}

Identification message definition

type PlanningRequest

type PlanningRequest struct {
	Timeframe []Timeframe
}

PlanningRequest message definition

type PowerInfo

type PowerInfo struct {
	AveragePower      int
	Timestamp         int
	AveragingInterval int
}

PowerInfo message definition

type SEMP

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

SEMP is the SMA SEMP server

func New

func New(conf map[string]interface{}, site site.API, httpd *server.HTTPd) (*SEMP, error)

New generates SEMP Gateway listening at /semp endpoint

func (*SEMP) Done

func (s *SEMP) Done() chan struct{}

Done returns the done channel. The channel is closed after byebye has been sent.

func (*SEMP) Run

func (s *SEMP) Run()

Run executes the SEMP runtime

func (*SEMP) Stop

func (s *SEMP) Stop()

Stop stops the SEMP runtime

type Service

type Service struct {
	ServiceType string `xml:"serviceType"`
	ServiceID   string `xml:"serviceId"`
	SCPDURL     string `xml:"SCPDURL"`
	ControlURL  string `xml:"controlURL"`
	EventSubURL string `xml:"eventSubURL"`
}

Service message definition

type ServiceDefinition

type ServiceDefinition struct {
	Xmlns          string `xml:"xmlns:semp,attr"`
	Server         string `xml:"semp:server"`
	BasePath       string `xml:"semp:basePath"`
	Transport      string `xml:"semp:transport"`
	ExchangeFormat string `xml:"semp:exchangeFormat"`
	WsVersion      string `xml:"semp:wsVersion"`
}

ServiceDefinition message definition

type SpecVersion

type SpecVersion struct {
	Major int `xml:"major"`
	Minor int `xml:"minor"`
}

SpecVersion message definition

type Timeframe

type Timeframe struct {
	DeviceID            string `xml:"DeviceId"`
	EarliestStart       int
	LatestEnd           int
	MinRunningTime      *int `xml:",omitempty"`
	MaxRunningTime      *int `xml:",omitempty"`
	MinEnergy           *int `xml:",omitempty"` // AN EVCharger
	MaxEnergy           *int `xml:",omitempty"` // AN EVCharger
	MaxPowerConsumption *int `xml:",omitempty"` // SMA EV CHARGER style
	MinPowerConsumption *int `xml:",omitempty"` // SMA EV CHARGER style
}

Timeframe message definition

Jump to

Keyboard shortcuts

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