Skip to content

florisweb/AutoHome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoHome

AutoHome is a collection of smart devices and projects that integrate and work with one-another. (In the end, that is ;p)

ServerDevice:

  • State

Config-Layout /server/config.json { name: "ThuisWolk"

enabledServices: [
	...serviceIds
]


interface: {
	signInWithFloriswebKey,
	allowedUserIds: []
}

}

Service-Layout /server/services/ServiceId

  • /config.json
  • /interface /interface.jsx -> exports {panel, page}
  • /server /service.js -> export default: Service

Service.config.json { name: "" isDeviceService: (bool) -> false, - Whether or not the services represents an external entity (for example, true: a lamp, false: )
hasUI: (bool) -> false - enables the /interface directory

wants: [...serviceIds] -> []
requires: [...serviceIds] -> []


trackDownTime: (bool) -> false

subscriptions: [...serviceIds]

/* --- Custom Properties --- */


/* --- Homebridge Config --- for integration with the HomeBridgeService*/ 
HBConfig: { 

}

}

Client-protocol

Connecting and Authentication

  1. Client starts connection to websocketserver.

  2. OnConnect: Client sends auth message: {id: deviceId/serviceId, key} Special case, interfaceClient: {id: 'InterfaceClient', key: FloriswebAuthToken}

  3. Server Responses InterfaceClient: {"type": "auth", "status": true} {"type": "auth", "status": false, "error": "Invalid Key"}

    {error: "Parameters missing"} {error: "Invalid request"}

Message types

Push { type: (string) data: (any) serviceId }

Request Request: { requestId type: (string) data: (any) serviceId, } Response: { isResponse: true, requestId - request.requestId response: (any) - response }

Messages Default Format: { type: (string) data: (any) serviceId }

Request, extends Format: { ... requestId: (string) - internal usage }

SetStateByKey: [device -> server]

  • Sets a particular key's value on the servers object.
  • Request: { type: 'setStateByKey', stateKey: (string) data: (any) }

GetStateByKey: [server -> any]

  • Returns a particular key's value on the servers object.
  • Request: { type: 'getStateByKey', stateKey: (string) }

GetState: [server -> any]

  • Returns the current state on the servers object.
  • Request: { type: 'getState', }
  • Return: StateUpdate

CurState: [server -> any]

  • Request: { type: 'curState', data: state (any) }

servic.page.render() -> returns div.panelBox

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published