wiser_knx

package
v0.2024.5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package wiser_knx contains a driver for Schneider Electric Wiser for KNX lighting controller. This driver is intended to work with the Wiser for KNX system running firmware version 2.8.0.

The Wiser for KNX system can be controlled using Remote Services (REST API) to control exported objects - this needs to be enabled in the Wiser for KNX system settings by the lighting commissioning engineer.

More information about the Wiser for KNX system can be found here: https://www.se.com/uk/en/product/LSS100100/wiser-for-knx-logic-controller/ User Guide (see "10.4 Remote services") https://download.schneider-electric.com/files?p_Doc_Ref=AR1740_EdQ_EO&p_enDocType=User+guide&p_File_Name=Wiser+for+KNX+%28LSS100100%29+for+Firmware+2.8.0+-+User+Guide+%28Version+Q%29.pdf

Index

Constants

View Source
const DriverName = "se-wiser-knx"

Variables

View Source
var Factory driver.Factory = factory{}

Functions

func GetValue

func GetValue(client *Client, address string) (string, error)

func SetValue

func SetValue(client *Client, address string, value any) error

Types

type APIError

type APIError struct {
	Code   int      `json:"code"`
	Info   string   `json:"info"`
	Detail []string `json:"detail,omitempty"`
}

func (APIError) Error

func (err APIError) Error() string

type Client

type Client struct {
	// BaseURL is the root of the API.
	// e.g. https://1.2.3.4/scada-remote
	BaseURL url.URL
	Client  *http.Client
}

func NewInsecureClient

func NewInsecureClient(host string, username string, password string) *Client

NewInsecureClient creates a Client that connects over HTTPS but does not verify the server certificate.

type Config

type Config struct {
	driver.BaseConfig

	// The IP address of the Wiser for KNX controller.
	Host string `json:"host"`

	// The username to use when connecting to the Wiser for KNX controller (default: "remote").
	Username string `json:"username,omitempty"`
	jsontypes.Password

	// The poll interval to use when polling the Wiser for KNX controller (default: 10 seconds).
	Poll jsontypes.Duration `json:"poll,omitempty"`

	// The list of exported objects on the Wiser for KNX controller.
	Devices []Device `json:"devices,omitempty"`
}

Config is the configuration for the Wiser for KNX driver.

func DefaultConfig

func DefaultConfig() Config

func ParseConfig

func ParseConfig(raw []byte) (Config, error)

type Device

type Device struct {
	// The device name (e.g. "inf/sc-01/lights/flex-room-01")
	Name string `json:"name"`
	// The address of the object on the Wiser for KNX controller (e.g. "1/1/1")
	Address string `json:"address,omitempty"`
	// Map of device component to address (e.g. {"light": "1/1/1"}). Possible components:
	// - "light": the light object
	// - "override": an optional bool object that disables the Wiser's automation when true - exposed using the Mode trait.
	Addresses map[string]string `json:"addresses,omitempty"`
	// The metadata associated with the device.
	Metadata *traits.Metadata `json:"metadata,omitempty"`
}

Device config for an object on the Wiser for KNX controller. Note: only 1 of Address or Addresses should be specified.

type Driver

type Driver struct {
	*service.Service[Config]
	driver.Services
	// contains filtered or unexported fields
}

type Object

type Object struct {
	Id       int32  `json:"id"`
	Address  string `json:"address"`
	Name     string `json:"name"`
	Data     any    `json:"data"`
	DataType string `json:"dataType"`
	Time     int32  `json:"time"`
	Date     string `json:"date"`
	Comment  string `json:"comment"`
}

func QueryObjects

func QueryObjects(client *Client) ([]Object, error)

Jump to

Keyboard shortcuts

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