homematic

package module
v0.0.0-...-75c22fc Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: MIT Imports: 8 Imported by: 0

README

homematic

GoDoc Go Report Card

homematic is a simple library to interface a HomeMatic CCU2 or CCU3.

The communication is done with XML RPC and supports Wired, RF and HmIP devices.

Usage

// create client object for CCU
ccu, err := homematic.NewCCU("192.168.4.40")

// list all devices
devices, err := client.GetDevices()

// set state of device
devices["OEQ1234567:1"].SetValue("STATE", true)

See the documentation for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CCU

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

CCU represents a connection to a Homematic CCU

func NewCCU

func NewCCU(address string, wired bool, rf bool, hmip bool) (*CCU, error)

NewCCU creates a new connection to a CCU

func NewCCUCustom

func NewCCUCustom(address, id string, wired bool, rf bool, hmip bool) (*CCU, error)

NewCCUCustom creates a new connection to a CCU with custom id

func (*CCU) GetDevices

func (c *CCU) GetDevices() (map[string]*Device, error)

GetDevices from CCU

func (*CCU) Start

func (c *CCU) Start() error

Start event handling

func (*CCU) Stop

func (c *CCU) Stop() error

Stop event handling

func (*CCU) UpdateDevices

func (c *CCU) UpdateDevices(force bool) error

UpdateDevices currently known on CCU

type Device

type Device struct {
	Name    string
	Type    string
	Address string
	Version int

	Children  []string
	Parent    string
	ParamSets []string

	FlagVisible    bool
	FlagInternal   bool
	FlagDontdelete bool
	// contains filtered or unexported fields
}

Device of CCU

func (*Device) GetClient

func (d *Device) GetClient() rpc.Client

GetClient gets internal rpc client instance

func (*Device) GetName

func (d *Device) GetName() string

GetName updates device name

func (*Device) GetValue

func (d *Device) GetValue(name string) (interface{}, error)

GetValue of a device with the given name

func (*Device) GetValues

func (d *Device) GetValues() (map[string]interface{}, error)

GetValues of a device

func (*Device) GetValuesDescription

func (d *Device) GetValuesDescription() (map[string]ParameterDescription, error)

GetValuesDescription for this device

func (*Device) HasValues

func (d *Device) HasValues() bool

HasValues returns true if device has values

func (*Device) ReportValueUsage

func (d *Device) ReportValueUsage(valueId string, ref_counter uint32) (bool, error)

func (*Device) SetValue

func (d *Device) SetValue(name string, value interface{}) error

SetValue of a device with given name

func (*Device) SetValueChangedHandler

func (d *Device) SetValueChangedHandler(handler func(key string, value interface{}))

nameChanged updates device name

type ParameterDescription

type ParameterDescription struct {
	ID       string
	Default  interface{}
	Type     string
	Unit     string
	TabOrder int

	OperationRead  bool
	OperationWrite bool
	OperationEvent bool

	FlagVisible   bool
	FlagInternal  bool
	FlagTransform bool
	FlagService   bool
	FlagSticky    bool
}

ParameterDescription contains information about a parameter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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