JavaScript Domoticz API for Node.JS
A Node.JS module, which provides an object oriented wrapper for the Domoticz API.
Installation
Install via git clone:
$ git clone git@jirachi.tyneo.net:skauffmann/domoticz-js.git
$ cd domoticz-js
$ npm install
Documentation
You can find the docs for the API of this client at http://jirachi.tyneo.net/skauffmann/domoticz-api-nodejs/wikis/home
Additionally, the official Domoticz API documentation is a very useful resource.
Usage
var Domoticz = ; var client = //required host: "tamagotchi.tyneo.net" // optional debug: true //default: false protocol: "https" //default 'http' username: "" password: "";
All Domoticz JS methods has callback function called after request to retreive the result. Don't worry, if the callback function is undefined, the callback will be just ignored.
//callback method usage: { console;}clientswitchLight;//You can do the same thing with :clientswitchLight;//You can also ignore the callback functionclientswitchLight;clientswitchLight;
System methods
//Shutdown Domoticzclientsystem;//Reboot Domoticzclientsystem;//You can log message to Domoticzclientsystem;
Device methods
//Get the list of all devicesclientdevice;//Get the list of all lights//Same methods are availables for weather (getWeathers), temperature (getTemperatures) and utility (getUtilities)clientdevice;
Update devices/sensors methods
clientdeviceclientdeviceclientdeviceclientdeviceclientdevice clientdeviceclientdeviceclientdeviceclientdeviceclientdeviceclientdeviceclientdeviceclientdeviceclientdeviceclientdeviceclientdeviceclientdevice
SwitchLight methods
//Turn a light/switch onclientswitchLight;//Turn a light/switch offclientswitchLight;//Toggle a switch state between on/offclientswitchLight;//Set a dimmable light to a certain levelclientswitchLight;
Scene methods
//Get all the scenes & groups//same as client.group.getScenesGroups()clientscene;//Turn a scene / group onclientscene;//Add a scene (0)clientscene;//Delete a scene or groupclientscene;//List devices in a sceneclientscene;//Add an existing devices to a sceneclientscene;//Delete device from a sceneclientscene;//List timers of a sceneclientscene;//Add timer to a sceneclientscene;
Group methods
//Get all the scenes & groups//same as client.scene.getScenesGroups()clientgroup;//Turn a scene / group onclientgroup;//Turn a scene / group offclientgroup;
Hardware methods
//Get all hardwaresclienthardware;//Create virtual hardwareclienthardware;
User variable methods
//List all variablesclientuservariable;//List one variableclientuservariable;//Store a new variableclientuservariable//Update an existing variableclientuservariable//Delete a variableclientuservariable
LICENSE
MIT license. See the LICENSE file for details.