zigbee2mqtt

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EventDeviceAnnounce ...
	EventDeviceAnnounce = "device_announce"
	// EventDeviceLeave ...
	EventDeviceLeave = "device_leave"
	// EventDeviceJoined ...
	EventDeviceJoined = "device_joined"
	// EventDeviceInterview ...
	EventDeviceInterview = "device_interview"
)
View Source
const (
	// StatusStarted ...
	StatusStarted = "started"
	// StatusFailed ...
	StatusFailed = "failed"
)
View Source
const (
	// Coordinator ...
	Coordinator = "Coordinator"
	// EndDevice ...
	EndDevice = "EndDevice"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

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

Bridge ...

func NewBridge

func NewBridge(mqtt mqtt.MqttServ,
	adaptors *adaptors.Adaptors,
	model *m.Zigbee2mqtt) *Bridge

NewBridge ...

func (*Bridge) AddGroup

func (g *Bridge) AddGroup()

AddGroup ...

func (*Bridge) Ban

func (g *Bridge) Ban(friendlyName string)

Ban ...

func (*Bridge) ConfigReset

func (g *Bridge) ConfigReset()

ConfigReset ...

func (*Bridge) DeviceOptions

func (g *Bridge) DeviceOptions()

DeviceOptions ...

func (*Bridge) GetDeviceTopic

func (g *Bridge) GetDeviceTopic(friendlyName string) string

GetDeviceTopic ...

func (*Bridge) GetModel

func (g *Bridge) GetModel() (model m.Zigbee2mqtt)

GetModel ...

func (*Bridge) Info

func (g *Bridge) Info() (info *Zigbee2mqttBridge)

Info ...

func (*Bridge) Networkmap

func (g *Bridge) Networkmap() string

Networkmap ...

func (*Bridge) PermitJoin

func (g *Bridge) PermitJoin(permitJoin bool)

PermitJoin ...

func (*Bridge) Remove

func (g *Bridge) Remove(friendlyName string)

Remove ...

func (*Bridge) RemoveGroup

func (g *Bridge) RemoveGroup()

RemoveGroup ...

func (*Bridge) RenameDevice

func (g *Bridge) RenameDevice(friendlyName, name string) (err error)

RenameDevice ...

func (*Bridge) RenameLast

func (g *Bridge) RenameLast()

RenameLast ...

func (*Bridge) Start

func (g *Bridge) Start()

Start ...

func (*Bridge) Stop

func (g *Bridge) Stop(ctx context.Context)

Stop ...

func (*Bridge) UpdateModel

func (g *Bridge) UpdateModel(model *m.Zigbee2mqtt)

UpdateModel ...

func (*Bridge) UpdateNetworkmap

func (g *Bridge) UpdateNetworkmap()

UpdateNetworkmap ...

func (*Bridge) Whitelist

func (g *Bridge) Whitelist(friendlyName string)

Whitelist ...

type BridgeConfig

type BridgeConfig struct {
	Version     string                  `json:"version"`
	Commit      string                  `json:"commit"`
	Coordinator BridgeConfigCoordinator `json:"coordinator"`
	LogLevel    string                  `json:"log_level"`
	PermitJoin  string                  `json:"permit_join"`
}

BridgeConfig ...

type BridgeConfigCoordinator

type BridgeConfigCoordinator struct {
	Type string           `json:"type"`
	Meta BridgeConfigMeta `json:"meta"`
}

BridgeConfigCoordinator ...

type BridgeConfigMeta

type BridgeConfigMeta struct {
	Transportrev int64 `json:"transportrev"`
	Product      int64 `json:"product"`
	Majorrel     int64 `json:"majorrel"`
	Minorrel     int64 `json:"minorrel"`
	Maintrel     int64 `json:"maintrel"`
	Revision     int64 `json:"revision"`
}

BridgeConfigMeta ...

type BridgeLog

type BridgeLog struct {
	Type    string                 `json:"type"`
	Message string                 `json:"message"`
	Meta    map[string]interface{} `json:"meta"`
}

BridgeLog ...

type Config added in v0.5.0

type Config struct {
}

Config ...

type Device

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

Device ...

func NewDevice

func NewDevice(friendlyName string, model *models.Zigbee2mqttDevice) *Device

NewDevice ...

func (*Device) AddFunc

func (d *Device) AddFunc(name string)

AddFunc ...

func (*Device) DeviceType

func (d *Device) DeviceType(devType string)

DeviceType ...

func (*Device) GetImage added in v0.2.0

func (d *Device) GetImage() string

GetImage ...

func (*Device) GetModel

func (d *Device) GetModel() models.Zigbee2mqttDevice

GetModel ...

func (*Device) SetDescription

func (d *Device) SetDescription(desc string)

SetDescription ...

func (*Device) SetModel

func (d *Device) SetModel(model string)

SetModel ...

func (*Device) SetName

func (d *Device) SetName(name string)

SetName ...

func (*Device) SetStatus

func (d *Device) SetStatus(status string)

SetStatus ...

func (*Device) SetVendor

func (d *Device) SetVendor(vendor string)

SetVendor ...

func (*Device) Status

func (d *Device) Status() string

Status ...

type DeviceInfo added in v0.5.2

type DeviceInfo struct {
	Definition         EventDeviceInfoDef `json:"definition"`
	FriendlyName       string             `json:"friendly_name"`
	IeeeAddress        string             `json:"ieee_address"`
	Status             string             `json:"status,omitempty"`
	InterviewCompleted bool               `json:"interview_completed,omitempty"`
	Interviewing       bool               `json:"interviewing,omitempty"`
	ModelId            string             `json:"model_id,omitempty"`
	NetworkAddress     int64              `json:"network_address,omitempty"`
	PowerSource        string             `json:"power_source,omitempty"`
	Supported          bool               `json:"supported,omitempty"`
	Type               string             `json:"type,omitempty"`
}

DeviceInfo ...

type Event added in v0.5.2

type Event struct {
	Data DeviceInfo `json:"data"`
	Type string     `json:"type"`
}

Event ...

type EventDeviceInfoDef added in v0.5.2

type EventDeviceInfoDef struct {
	Description string                     `json:"description,omitempty"`
	Exposes     []EventDeviceInfoDefExpose `json:"exposes"`
	Model       string                     `json:"model"`
	Options     []string                   `json:"options"`
	SupportsOta bool                       `json:"supports_ota"`
	Vendor      string                     `json:"vendor"`
}

EventDeviceInfoDef ...

type EventDeviceInfoDefExpose added in v0.5.2

type EventDeviceInfoDefExpose struct {
	Access      int64                      `json:"access,omitempty"`
	Description string                     `json:"description,omitempty"`
	Name        string                     `json:"name,omitempty"`
	Property    string                     `json:"property,omitempty"`
	Type        string                     `json:"type,omitempty"`
	Unit        string                     `json:"unit,omitempty"`
	ValueMax    int64                      `json:"value_max,omitempty"`
	ValueMin    int64                      `json:"value_min,omitempty"`
	Values      []string                   `json:"values,omitempty"`
	Features    []EventDeviceInfoDefExpose `json:"features,omitempty"`
}

EventDeviceInfoDefExpose ...

type Zigbee2mqtt

type Zigbee2mqtt interface {
	Start()
	Shutdown()
	AddBridge(model *m.Zigbee2mqtt) (err error)
	GetBridgeById(id int64) (*m.Zigbee2mqtt, error)
	GetBridgeInfo(id int64) (*Zigbee2mqttBridge, error)
	ListBridges(limit, offset int64, order, sortBy string) (models []*Zigbee2mqttBridge, total int64, err error)
	UpdateBridge(model *m.Zigbee2mqtt) (result *m.Zigbee2mqtt, err error)
	DeleteBridge(bridgeId int64) (err error)
	ResetBridge(bridgeId int64) (err error)
	BridgeDeviceBan(bridgeId int64, friendlyName string) (err error)
	BridgeDeviceWhitelist(bridgeId int64, friendlyName string) (err error)
	BridgeNetworkmap(bridgeId int64) (networkmap string, err error)
	BridgeUpdateNetworkmap(bridgeId int64) (err error)
	GetTopicByDevice(model *m.Zigbee2mqttDevice) (topic string, err error)
	DeviceRename(friendlyName, name string) (err error)
}

Zigbee2mqtt ...

func NewZigbee2mqtt

func NewZigbee2mqtt(lc fx.Lifecycle,
	mqtt mqtt.MqttServ,
	adaptors *adaptors.Adaptors) Zigbee2mqtt

NewZigbee2mqtt ...

type Zigbee2mqttBridge added in v0.5.2

type Zigbee2mqttBridge struct {
	m.Zigbee2mqtt
	ScanInProcess bool       `json:"scan_in_process"`
	LastScan      *time.Time `json:"last_scan"`
	Networkmap    string     `json:"networkmap"`
	Status        string     `json:"status"`
}

Zigbee2mqttBridge ...

Jump to

Keyboard shortcuts

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