Documentation ¶
Index ¶
- type Connection
- func (c *Connection) CurrentPower() (float64, error)
- func (c *Connection) Currents() (float64, float64, float64, error)
- func (c *Connection) Enable(enable bool) error
- func (c *Connection) Enabled() (bool, error)
- func (c *Connection) GridCurrentPower() (float64, error)
- func (c *Connection) GridTotalEnergy() (float64, error)
- func (c *Connection) TotalEnergy() (float64, error)
- func (c *Connection) XmlCmd(method, channel string, values ...Param) (MethodResponse, error)
- type Member
- type MethodCall
- type MethodResponse
- type Param
- type Settings
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
Connection is the Homematic CCU connection
func NewConnection ¶
func NewConnection(uri, device, meterchannel, switchchannel, user, password string, cache time.Duration) (*Connection, error)
NewConnection creates a new Homematic device connection.
func (*Connection) CurrentPower ¶
func (c *Connection) CurrentPower() (float64, error)
CurrentPower reads the homematic HMIP-PSM meterchannel power in W
func (*Connection) Currents ¶
func (c *Connection) Currents() (float64, float64, float64, error)
Currents reads the homematic HMIP-PSM meterchannel L1 current in A
func (*Connection) Enable ¶
func (c *Connection) Enable(enable bool) error
Enable sets the homematic HMIP-PSM switchchannel state to true=on/false=off
func (*Connection) Enabled ¶
func (c *Connection) Enabled() (bool, error)
Enabled reads the homematic HMIP-PSM switchchannel state true=on/false=off
func (*Connection) GridCurrentPower ¶
func (c *Connection) GridCurrentPower() (float64, error)
GridCurrentPower reads the homematic HM-ES-TX-WM grid meterchannel power in W
func (*Connection) GridTotalEnergy ¶
func (c *Connection) GridTotalEnergy() (float64, error)
GridTotalEnergy reads the homematic HM-ES-TX-WM grid meterchannel energy in kWh
func (*Connection) TotalEnergy ¶
func (c *Connection) TotalEnergy() (float64, error)
TotalEnergy reads the homematic HMIP-PSM meterchannel energy in Wh
func (*Connection) XmlCmd ¶
func (c *Connection) XmlCmd(method, channel string, values ...Param) (MethodResponse, error)
type MethodCall ¶
type MethodResponse ¶
type MethodResponse struct { XMLName xml.Name `xml:"methodResponse"` CCUBool string `xml:"params>param>value>boolean,omitempty"` CCUFloat float64 `xml:"params>param>value>double,omitempty"` CCUInt int64 `xml:"params>param>value>i4,omitempty"` CCUString string `xml:"params>param>value>string,omitempty"` Member []Member `xml:"params>param>value>struct>member,omitempty"` Fault []Member `xml:"fault>value>struct>member,omitempty"` }
func (*MethodResponse) BoolValue ¶
func (res *MethodResponse) BoolValue(val string) bool
BoolValue selects a float value of a CCU API response member
func (*MethodResponse) Error ¶
func (res *MethodResponse) Error() error
Error checks on Homematic CCU error codes Refer to page 30 of https://homematic-ip.com/sites/default/files/downloads/HM_XmlRpc_API.pdf
func (*MethodResponse) FloatValue ¶
func (res *MethodResponse) FloatValue(val string) float64
FloatValue selects a float value of a CCU API response member