Documentation
¶
Index ¶
- Constants
- Variables
- func RunRf12demo(jeego *Jeego) chan string
- func RunWebServer(jeego *Jeego)
- type Database
- type DatabaseQuery
- type Jeego
- func (jeego *Jeego) DumpConfig()
- func (jeego *Jeego) LoadConfig()
- func (jeego *Jeego) RunNodeLogsTicker()
- func (jeego *Jeego) SetupDatabase()
- func (jeego *Jeego) SetupDomoticz()
- func (jeego *Jeego) SetupLogging()
- func (jeego *Jeego) StartRf12demo() chan string
- func (jeego *Jeego) StartWebServer()
- func (jeego *Jeego) StartWsHub()
- type Node
- type NodeJSON
- type NodeLog
- type Rf12demoDataLog
- type Sensor
Constants ¶
View Source
const ( LOG_PERIOD = 5 // in minutes LOG_HISTORY = 2 // in days )
View Source
const ( JEENODE_THLM_NODE = iota + 1 // Jeenode: Temperature Humidity Light Motion JEENODE_THL_NODE // Jeenode: Temperature Humidity Light TINYTX_T_NODE // TinyTX: Temperature TINYTX_TH_NODE // TinyTX: Temperature Humidity TINYTX_TL_NODE // TinyTX: Temperature Light )
node kinds
View Source
const ( TEMP_SENSOR = iota // Temperature HUMI_SENSOR // Humidity LIGHT_SENSOR // Light MOTION_SENSOR // Motion LOWBAT_SENSOR // Low Battery VCC_SENSOR // Supply voltage )
sensors kinds
View Source
const DOMOTICZ_DEVICE_ID_BASE = 2000
base to compute Device ID
View Source
const LOGS_SCHEMA = `` /* 244-byte string literal not displayed */
View Source
const NODES_SCHEMA = `` /* 310-byte string literal not displayed */
Variables ¶
View Source
var AllSensors []Sensor
View Source
var BitsNbForSensor map[Sensor]int
View Source
var ColNameForSensor map[Sensor]string
View Source
var SensorsForNodeKind map[int][]Sensor
Functions ¶
func RunWebServer ¶
func RunWebServer(jeego *Jeego)
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database
func LoadDatabase ¶
Setup a new database connection and load nodes
func (*Database) InsertNode ¶
Insert a new node
type DatabaseQuery ¶
type DatabaseQuery struct {
// contains filtered or unexported fields
}
Database Query
type Jeego ¶
type Jeego struct { Config *config.Config Database *Database WsHub *ws_hub.WsHub Domoticz *domoticz.Domoticz }
Jeego
func (*Jeego) DumpConfig ¶
func (jeego *Jeego) DumpConfig()
func (*Jeego) LoadConfig ¶
func (jeego *Jeego) LoadConfig()
func (*Jeego) RunNodeLogsTicker ¶
func (jeego *Jeego) RunNodeLogsTicker()
Add a log entry every 5 minutes
func (*Jeego) SetupDatabase ¶
func (jeego *Jeego) SetupDatabase()
func (*Jeego) SetupLogging ¶
func (jeego *Jeego) SetupLogging()
func (*Jeego) StartRf12demo ¶
Start RF12demo handler
type Node ¶
type Node struct { Id int `json:"id"` Kind int `json:"kind"` UpdatedAt time.Time `json:"updated_at"` LastSeenAt time.Time `json:"last_seen_at"` Name string `json:"name"` DomoticzIdx string `json:"domoticz_idx"` // sensors Temperature float64 `json:"temperature"` Humidity uint8 `json:"humidity"` Light uint8 `json:"light"` Motion bool `json:"motion"` LowBattery bool `json:"low_battery"` Vcc uint `json:"vcc"` }
Node
func (*Node) DomoticzParams ¶
query parameters part to send to domoticz
type NodeLog ¶
type NodeLog struct { Id int `json:"id"` NodeId int `json:"node_id"` At time.Time `json:"at"` Temperature float64 `json:"temperature"` Humidity uint8 `json:"humidity"` Light uint8 `json:"light"` Motion bool `json:"motion"` LowBattery bool `json:"low_battery"` Vcc uint `json:"vcc"` }
node sensors values logged in database
type Rf12demoDataLog ¶
type Rf12demoDataLog struct {
// contains filtered or unexported fields
}
Rf12demo Data Log
Click to show internal directories.
Click to hide internal directories.