Documentation ¶
Index ¶
Constants ¶
View Source
const ( TypeConfirmable = 0 TypeNonConfirmable = 1 TypeAcknowledgement = 2 TypeReset = 3 )
Variables ¶
This section is empty.
Functions ¶
func HTTPtoJSON ¶
Types ¶
type CoIoT ¶
type CoIoT struct {
// contains filtered or unexported fields
}
func (*CoIoT) Read ¶
func (c *CoIoT) Read() *CoIoTpacket
type CoIoToption ¶
type CoIoTpacket ¶
type InfluxClient ¶
type InfluxClient struct {
// contains filtered or unexported fields
}
func NewInfluxClient ¶
func (*InfluxClient) Close ¶
func (i *InfluxClient) Close() error
func (*InfluxClient) Insert ¶
func (i *InfluxClient) Insert(nameTags string, fields map[string]interface{}) error
func (*InfluxClient) InsertLine ¶
func (i *InfluxClient) InsertLine(line string) error
type MQTTClient ¶
type MQTTClient struct {
// contains filtered or unexported fields
}
func NewMQTTClient ¶
func NewMQTTClient(addr string) (*MQTTClient, error)
func (*MQTTClient) Publish ¶
func (m *MQTTClient) Publish(topic string, payload string)
func (*MQTTClient) Subscribe ¶
func (m *MQTTClient) Subscribe(topic string) chan *mqtt.Message
type ShellyInfo ¶
type ShellyInfo struct { Settings ShellySettings Status ShellyStatus }
func ShellyGetInfo ¶
func ShellyGetInfo(host string) (*ShellyInfo, error)
type ShellySettings ¶
type ShellySettings struct { // Common HTTP API Device struct { Type string MAC string Hostname string NumOutputs int `json:"num_outputs"` NumMeters int `json:"num_meters"` NumRollers int `json:"num_rollers"` } WiFiAP struct { Enabled bool SSID string Key string } `json:"wifi_ap"` WiFiStatus struct { Enabled bool SSID string IPv4Method string `json:"ipv4_method"` IP string GW string Mask string DNS string } `json:"wifi_sta"` WiFiStatus1 struct { Enabled bool SSID string IPv4Method string `json:"ipv4_method"` IP string GW string Mask string DNS string } `json:"wifi_sta1"` APRoaming struct { Enabled bool Threshold int } `json:"ap_roaming"` MQTT struct { Enabled bool Server string User string ID string ReconnectTimeoutMax float64 `json:"reconnect_timeout_max"` ReconnectTimeoutMin float64 `json:"reconnect_timeout_min"` CleanSession bool `json:"clean_session"` KeepAlive int `json:"keep_alive"` MaxQoS int `json:"max_qos"` Retain bool UpdatePeriod int `json:"update_period"` } CoIoT struct { Enabled bool UpdatePeriod int `json:"update_period"` Peer string } SNTP struct { Server string Enabled bool } Login struct { Enabled bool Unprotected bool Username string } PinCode string `json:"pin_code"` Name string FW string Discoverable bool BuildInfo struct { BuildID string `json:"build_id"` BuildTimestamp string `json:"build_timestamp"` BuildVersion string `json:"build_version"` } `json:"build_info"` Cloud struct { Enabled bool Connected bool } Timezone string Lat float64 Lng float64 TZAutodetect bool TZUTCOffset int `json:"tz_utc_offset"` TZDST bool `json:"tz_dst"` TZDSTAuto bool `json:"tz_dst_auto"` Time string Unixtime int DebugEnable bool `json:"debug_enable"` AllowCrossOrigin bool `json:"allow_cross_origin"` WiFiRecoveryRebootEnabled bool `json:"wifirecovery_reboot_enabled"` // Shelly 1/2.5/... Mode string }
type ShellyStatus ¶
type ShellyStatus struct { // Common HTTP API WiFiStatus struct { Connected bool SSID string IP string RSSI int } `json:"wifi_sta"` // Extra HTTP API for some Shellies Temperature float64 Voltage float64 Relays []struct { IsOn bool HasTimer bool `json:"has_timer"` TimerDuration int `json:"timer_duration"` IsValid bool `json:"is_valid"` Source string } Rollers []struct { State string Source string Power float64 IsValid bool `json:"is_valid"` LastDirection string `json:"last_direction"` CurrentPos int `json:"current_pos"` Positioning bool } Meters []struct { Power float64 IsValid bool `json:"is_valid"` Timestamp int Counters []float64 Total int } Inputs []struct { Input int Event string EventCnt int `json:"event_cnt"` } Emeters []struct { Power float64 Reactive float64 Voltage float64 IsValid bool `json:"is_valid"` Total float64 TotalReturned float64 `json:"total_returned"` } }
Click to show internal directories.
Click to hide internal directories.