domoja-core v1.4.5
domoja
A Typescript framework for home automation
Introduction
This framework allows to create home automation applications.
The server part is written in Typescript, while the GUI uses Angular and Iconic.
Here are some screenshots of the application:
Concepts
Domoja collects information from and interacts with devices through sources. You can think of sources as sources of information.
Sources
Devices
The framework supports a range of devices:
- device: a generic device with attributes which can be set or get.
- relay: a particular switch, for which delays can be configured.
- variable: a special device that contains a value which can be read or written.
Modules
Domoja can be extended through modules, to add new sources, devices, etc. They are essentially npm
modules following particular specifications:
- their name must start with
domoja-
- they must derive from
domoModule
Available modules
The following modules are currently available:
- domoja-core: Core components of Domoja
- domoja-ipx800: IPX800 source for Domoja
- domoja-proxiti: Astronomy source for Domoja from http://www.proxiti.info/
- domoja-sample: A sample Domoja module skeleton
- domoja-tempo: EDF Tempo information for Domoja from https://particulier.edf.fr/fr/accueil/contrat-et-conso/options/ejp.html
- domoja-zibase: ZiBase source for Domoja
API
Domoja provides a REST/JSON api, which is available through Swagger at /api-docs(http://localhost/api-docs).
- GET /devices: Retrieves the list of devices
- GET /devices/{id}: Retrieves a device
- POST /devices/{id}: Sends a command to a device
- GET /pages: Retrieves the list of pages
- GET /app: Retrieves the app data
- POST /app/demo-mode: Sets the app demo mode
User Interface
Domoja comes with a generic user interface that can be configured through the configuration file. However, custom pages or components can be added easily
Add a new page
# generate the page with Ionic
$ ionic generate page dmj-<pagename>
The file <pagename>.module.ts
can be safely deleted.
Then, add the page in src/pages/providers/page-components/page-components.ts
. You can then customize and use the page.
Add a new dashboard component
# generate the component with Ionic
$ ionic generate component DmjDashboard<ComponentName>
In the file src/components/dmj-dashboard-<component-name>.ts
, make the class DmjComponentName
derive from DmjDashboardComponent
, after importing with:
import { Component } from '@angular/core';
import { DmjDashboardComponent } from '../dmj-dashboard-component';
@Component({
selector: 'dmj-dashboard-<component-name>',
templateUrl: 'dmj-dashboard-<component-name>.html'
})
export class DmjDashboard<ComponentName> extends DmjDashboardComponent {
constructor() {
super();
}
}