Versions in this module Expand all Collapse all v0 v0.21.1 Nov 6, 2024 v0.21.0 Oct 28, 2024 Changes in this version + const HistoryMax + const MessageStatusError + const MessageStatusInProgress + const MessageStatusNew + const MessageStatusSucceed + const TemplateStatusActive + const TemplateStatusUnactive + const TemplateTypeItem + const TemplateTypeTemplate + func NewAttributes() map[string]*Attribute + func PreviewTemplate(items []*Template, template *TemplateContent) (data string, err error) + func TemplateGetParents(items Templates, result *Templates, s string) + type Action struct + Area *Area + AreaId *int64 + CreatedAt time.Time + Description string + Entity *Entity + EntityActionName *string + EntityId *common.EntityId + Id int64 + Name string + Script *Script + ScriptId *int64 + UpdatedAt time.Time + type AlexaIntent struct + AlexaSkillId int64 + CreatedAt time.Time + Description string + Name string + Script *Script + ScriptId int64 + UpdatedAt time.Time + type AlexaSkill struct + CreatedAt time.Time + Description string + Id int64 + Intents []*AlexaIntent + Script *Script + ScriptId *int64 + SkillId string + Status common.StatusType + UpdatedAt time.Time + type AppConfig struct + AlexaHost string + AlexaPort int + ApiDebug bool + ApiGzip bool + ApiHttpPort int + ApiHttpsPort int + ApiSwagger bool + AutoMigrate bool + ColoredLogging bool + Domain string + GateClientId string + GateClientPoolIdleSize int + GateClientPoolMaxSize int + GateClientSecretKey string + GateClientServerHost string + GateClientServerPort int + Lang string + Logging bool + Mode common.RunMode + MqttDeliverMode int + MqttMaxAwaitRel int + MqttMaxInflight int + MqttMaxMsgQueue int + MqttPort int + MqttQueueQos0Messages bool + MqttRetryCheckInterval time.Duration + MqttRetryInterval time.Duration + MqttSessionExpireCheckInterval time.Duration + MqttSessionExpiryInterval time.Duration + PgConnMaxLifeTime int + PgDebug bool + PgHost string + PgMaxIdleConns int + PgMaxOpenConns int + PgName string + PgPass string + PgPort string + PgUser string + Pprof bool + RootMode bool + RootSecret string + SnapshotDir string + type Area struct + Center Point + CreatedAt time.Time + Description string + Id int64 + Name string + Polygon []Point + Resolution float32 + UpdatedAt time.Time + Zoom float32 + type AreaPayload struct + Center Point + Resolution float32 + Zoom float32 + type Attribute struct + Name string + Type common.AttributeType + Value interface{} + func (a *Attribute) Bool() bool + func (a *Attribute) Float64() float64 + func (a *Attribute) Time() time.Time + func (a Attribute) ArrayString() (result []string) + func (a Attribute) Compare(b *Attribute) (ident bool) + func (a Attribute) Decrypt() string + func (a Attribute) Int64() int64 + func (a Attribute) Map() Attributes + func (a Attribute) Point() (point Point) + func (a Attribute) String() string + type AttributeValue map[string]interface + type Attributes map[string]*Attribute + func (a Attributes) Copy() (copy Attributes) + func (a Attributes) Deserialize(data AttributeValue) (changed bool, err error) + func (a Attributes) Serialize() (to AttributeValue) + func (a Attributes) Signature() (signature Attributes) + type AutomationStatistic struct + ActionsTotal int32 + ConditionsTotal int32 + TasksEnabled int32 + TasksTotal int32 + TriggersEnabled int32 + TriggersTotal int32 + type Backup struct + FileMode fs.FileMode + MimeType string + ModTime time.Time + Name string + Size int64 + type Backups []*Backup + func (l Backups) Len() int + func (l Backups) Less(i, j int) bool + func (l Backups) Swap(i, j int) + type Condition struct + Area *Area + AreaId *int64 + CreatedAt time.Time + Description string + Id int64 + Name string + Script *Script + ScriptId *int64 + UpdatedAt time.Time + type Dashboard struct + Area *Area + AreaId *int64 + CreatedAt time.Time + Description string + Enabled bool + Entities map[common.EntityId]*Entity + Id int64 + Name string + Tabs []*DashboardTab + UpdatedAt time.Time + type DashboardCard struct + Background *string + CreatedAt time.Time + DashboardTab *DashboardTab + DashboardTabId int64 + Enabled bool + Entities map[common.EntityId]*Entity + Entity *Entity + EntityId *common.EntityId + Height int + Hidden bool + Id int64 + Items []*DashboardCardItem + Payload json.RawMessage + Title string + UpdatedAt time.Time + Weight int + Width int + type DashboardCardItem struct + CreatedAt time.Time + DashboardCard *DashboardCard + DashboardCardId int64 + Enabled bool + Entity *Entity + EntityId *common.EntityId + Frozen bool + Hidden bool + Id int64 + Payload json.RawMessage + Title string + Type string + UpdatedAt time.Time + Weight int + type DashboardTab struct + Background *string + Cards []*DashboardCard + ColumnWidth int + CreatedAt time.Time + Dashboard *Dashboard + DashboardId int64 + Enabled bool + Entities map[common.EntityId]*Entity + Gap bool + Icon string + Id int64 + Name string + Payload json.RawMessage + UpdatedAt time.Time + Weight int + type EntitiesStatistic struct + Total int32 + Unused int32 + Used int32 + type Entity struct + Actions []*EntityAction + Area *Area + AreaId *int64 + Attributes Attributes + AutoLoad bool + CreatedAt time.Time + Description string + Hidden bool + Icon *string + Id common.EntityId + Image *Image + ImageId *int64 + IsLoaded bool + Metrics []*Metric + ParentId *common.EntityId + PluginName string + RestoreState bool + Scripts []*Script + Settings Attributes + States []*EntityState + Storage []*EntityStorage + Tags []*Tag + UpdatedAt time.Time + type EntityAction struct + CreatedAt time.Time + Description string + EntityId common.EntityId + Icon *string + Id int64 + Image *Image + ImageId *int64 + Name string + Script *Script + ScriptId *int64 + Type string + UpdatedAt time.Time + func (a *EntityAction) Short() (short EntityActionShort) + type EntityActionShort struct + Description string + Icon *string + ImageUrl *string + Name string + type EntityPayload struct + AttributeSignature Attributes + type EntitySettings struct + Settings Attributes + type EntityShort struct + Actions []EntityActionShort + Area *Area + Attributes Attributes + Description string + Hidden bool + Icon *string + Id common.EntityId + ImageUrl *string + Metrics []*Metric + Name string + Settings Attributes + State *EntityStateShort + States []EntityStateShort + Type string + type EntityState struct + CreatedAt time.Time + Description string + EntityId common.EntityId + Icon *string + Id int64 + Image *Image + ImageId *int64 + Name string + Style string + UpdatedAt time.Time + func (m *EntityState) Short() (short EntityStateShort) + type EntityStateShort struct + Description string + Icon *string + ImageUrl *string + Name string + type EntityStorage struct + Attributes AttributeValue + CreatedAt time.Time + EntityDescription string + EntityId common.EntityId + Id int64 + State string + StateDescription string + type EntityStorageList struct + Attributes map[common.EntityId]Attributes + Items []*EntityStorage + type GateConfig struct + ApiDebug bool + ApiGzip bool + ApiHttpPort int + ApiHttpsPort int + Domain string + Https bool + Pprof bool + ProxyIdleTimeout int + ProxySecretKey string + ProxyTimeout int + func (c *GateConfig) ApiFullAddress() (scheme string) + func (c *GateConfig) ApiScheme() (scheme string) + type GeoLocation struct + As string + City string + Country string + CountryCode string + Isp string + Lat float64 + Lon float64 + Org string + Query string + Region string + RegionName string + Status string + Timezone string + Zip string + type Image struct + CreatedAt time.Time + Id int64 + Image string + MimeType string + Name string + Size int64 + Thumb string + Title string + Url string + type ImageFilterList struct + Count int + Date string + type Keys struct + Auth string + P256dh string + type Log struct + Body string + CreatedAt time.Time + Id int64 + Level common.LogLevel + Owner string + type LogQuery struct + EndDate *time.Time + Levels []string + StartDate *time.Time + type Message struct + Attributes AttributeValue + CreatedAt time.Time + Id int64 + Type string + UpdatedAt time.Time + type MessageDelivery struct + Address string + CreatedAt time.Time + EntityId *common.EntityId + ErrorMessageBody *string + ErrorMessageStatus *string + Id int64 + Message *Message + MessageId int64 + Status MessageStatus + UpdatedAt time.Time + type MessageDeliveryQuery struct + EndDate *time.Time + StartDate *time.Time + Types []string + type MessagePayload struct + AttributeSignature Attributes + type MessageStatus string + type MessageType string + type Metric struct + CreatedAt time.Time + Data []*MetricDataItem + Description string + Id int64 + Name string + Options MetricOptions + Ranges []string + Type common.MetricType + UpdatedAt time.Time + func (d *Metric) RangesByType() []string + type MetricDataItem struct + Metric *Metric + MetricId int64 + Time time.Time + Value map[string]interface{} + type MetricOptions struct + Items []MetricOptionsItem + type MetricOptionsItem struct + Color string + Description string + Label string + Name string + Translate string + type NewNotifrMessage struct + Address string + BodyType string + ChatID int64 + EmailBody *string + EmailFrom *string + EmailSubject *string + Params map[string]interface{} + SlackText *string + SmsText *string + TelegramText *string + Template *string + Type string + Webpush *string + type NewTask struct + ActionIds []int64 + Area *Area + AreaId *int64 + Condition common.ConditionType + ConditionIds []int64 + Description string + Enabled bool + IsLoaded bool + Name string + TriggerIds []int64 + type NewTrigger struct + AreaId *int64 + Description string + Enabled bool + EntityIds []string + IsLoaded bool + Name string + Payload Attributes + PluginName string + ScriptId *int64 + type Permission struct + Id int64 + LevelName string + PackageName string + RoleName string + type Plugin struct + Actor bool + Enabled bool + External bool + IsLoaded bool + Name string + Settings AttributeValue + System bool + Triggers bool + Version string + type PluginOptions struct + ActorActions map[string]EntityActionShort + ActorAttrs Attributes + ActorCustomActions bool + ActorCustomAttrs bool + ActorCustomSetts bool + ActorCustomStates bool + ActorSetts Attributes + ActorStates map[string]EntityStateShort + Actors bool + Javascript PluginOptionsJs + Setts Attributes + TriggerParams TriggerParams + Triggers bool + type PluginOptionsJs struct + Methods map[string]string + Objects map[string]string + Variables map[string]string + type PluginSettings struct + Settings Attributes + type Plugins []*Plugin + func (i Plugins) Len() int + func (i Plugins) Less(a, b int) bool + func (i Plugins) Swap(a, b int) + type Point struct + Lat float64 + Lon float64 + type RegionInfo struct + Asn string + City string + ContinentCode string + Country string + CountryArea float64 + CountryCallingCode string + CountryCapital string + CountryCode string + CountryCodeIso3 string + CountryName string + CountryPopulation float64 + CountryTld string + Currency string + CurrencyName string + InEu bool + Ip string + Languages string + Latitude float64 + Longitude float64 + Org string + Postal string + Region string + RegionCode string + Timezone string + UtcOffset string + Version string + type Role struct + AccessList map[string][]string + Children []*Role + CreatedAt time.Time + Description string + Name string + Parent *Role + UpdatedAt time.Time + type RunHistory []RunStory + type RunStory struct + End *time.Time + Id int64 + Start time.Time + type Script struct + Compiled string + CreatedAt time.Time + Description string + Id int64 + Info *ScriptInfo + Lang ScriptLang + Name string + Source string + UpdatedAt time.Time + Versions ScriptVersions + type ScriptInfo struct + AlexaIntents int + AutomationActions int + AutomationConditions int + AutomationTriggers int + EntityActions int + EntityScripts int + type ScriptVersion struct + CreatedAt time.Time + Id int64 + Lang ScriptLang + Source string + type ScriptVersions []*ScriptVersion + func (l ScriptVersions) Len() int + func (l ScriptVersions) Less(i, j int) bool + func (l ScriptVersions) Swap(i, j int) + type ScriptsStatistic struct + CoffeeScript int32 + JavaScript int32 + Total int32 + TypeScript int32 + Unused int32 + Used int32 + type Statistic struct + Description string + Diff int32 + Name string + Value int32 + type Subscription struct + Endpoint string + Keys Keys + type Tag struct + Id int64 + Name string + type Task struct + Actions []*Action + Area *Area + AreaId *int64 + Condition common.ConditionType + Conditions []*Condition + CreatedAt time.Time + Description string + Enabled bool + Id int64 + IsLoaded bool + Name string + Telemetry telemetry.Telemetry + Triggers []*Trigger + UpdatedAt time.Time + func (t *Task) AddAction(a *Action) + func (t *Task) AddCondition(c *Condition) + func (t *Task) AddTrigger(tr *Trigger) + type TelegramChat struct + ChatId int64 + CreatedAt time.Time + EntityId common.EntityId + Username string + type Template struct + Content string + CreatedAt time.Time + Description string + Markers []string + Name string + ParentName *string + ParentsCount int + Status TemplateStatus + Type TemplateType + UpdatedAt time.Time + func (i *Template) GetMarkers(items []*Template, template *TemplateContent) (markers []string, err error) + func (i *Template) GetTemplate() (tpl *TemplateContent, err error) + type TemplateContent struct + Fields []*TemplateField + Items []string + Title string + type TemplateField struct + Name string + Value string + type TemplateRender struct + Body string + Subject string + func RenderTemplate(items []*Template, template *TemplateContent, params map[string]interface{}) (render *TemplateRender, err error) + type TemplateStatus string + func (s TemplateStatus) String() string + type TemplateTree struct + Description string + Name string + Nodes []*TemplateTree + Status string + type TemplateType string + func (t TemplateType) String() string + type Templates []*Template + func (i Templates) Len() int + func (i Templates) Less(a, b int) bool + func (i Templates) Swap(a, b int) + type Trigger struct + Area *Area + AreaId *int64 + CreatedAt time.Time + Description string + Enabled bool + Entities []*Entity + Id int64 + IsLoaded bool + Name string + Payload Attributes + PluginName string + Script *Script + ScriptId *int64 + UpdatedAt time.Time + type TriggerParams struct + Attributes Attributes + Entities bool + Required []string + Script bool + type TriggerPayload struct + Obj Attributes + type UpdateTask struct + ActionIds []int64 + Area *Area + AreaId *int64 + Condition common.ConditionType + ConditionIds []int64 + CreatedAt time.Time + Description string + Enabled bool + Id int64 + IsLoaded bool + Name string + TriggerIds []int64 + UpdatedAt time.Time + type UpdateTrigger struct + AreaId *int64 + Description string + Enabled bool + EntityIds []string + Id int64 + IsLoaded bool + Name string + Payload Attributes + PluginName string + ScriptId *int64 + type User struct + AuthenticationToken *string + CreatedAt time.Time + CurrentSignInAt *time.Time + CurrentSignInIp string + DeletedAt *time.Time + Devices []*UserDevice + Email string + EncryptedPassword string + FirstName string + History []*UserHistory + Id int64 + Image *Image + ImageId sql.NullInt64 + Lang string + LastName string + LastSignInAt *time.Time + LastSignInIp string + Meta []*UserMeta + Nickname string + ResetPasswordSentAt *time.Time + ResetPasswordToken string + Role *Role + RoleName string + SignInCount int64 + Status string + UpdatedAt time.Time + User *User + UserId sql.NullInt64 + func (u *User) SetPass(password string) (err error) + func (u *User) UpdateHistory(t time.Time, ipv4 string) + func (u User) CheckPass(password string) (ok bool) + type UserDevice struct + CreatedAt time.Time + Id int64 + Subscription *Subscription + UserId int64 + type UserHistory struct + Ip string + Time time.Time + type UserMeta struct + Id int64 + Key string + User *User + UserId int64 + Value string + type Validity struct + type Variable struct + Changed bool + CreatedAt time.Time + EntityId *common.EntityId + Name string + System bool + Tags []*Tag + UpdatedAt time.Time + Value string + func NewVariable(name string) Variable + func (v *Variable) GetBool() bool + func (v *Variable) GetInt() int + func (v *Variable) GetObj(obj interface{}) (err error) + func (v *Variable) SetObj(obj interface{}) (err error) + type Version struct + BuildNum string + Developers string + DockerImage string + Generated string + Revision string + RevisionURL string + Version string + type Zigbee2mqtt struct + BaseTopic string + CreatedAt time.Time + Devices []*Zigbee2mqttDevice + EncryptedPassword string + Id int64 + Info *Zigbee2mqttInfo + Login string + Name string + Password *string + PermitJoin bool + UpdatedAt time.Time + type Zigbee2mqttDevice struct + CreatedAt time.Time + Description string + Functions []string + Id string + ImageUrl string + Manufacturer string + Model string + Name string + Payload []byte + Status string + Type string + UpdatedAt time.Time + Zigbee2mqttId int64 + func (d *Zigbee2mqttDevice) GetImageUrl() + type Zigbee2mqttInfo struct + LastScan *time.Time + Networkmap string + ScanInProcess bool + Status string