node-jontelldus
Telldus-core wrapper.
Under development, poorly tested. I've used node 5.1.0, but it should compile with node 0.12 and 4 aswell.
Requirements
Telldus-core must be installed.
Methods
method | description |
---|---|
getDevices(callback(devices)) | get all devices |
addDevice(deviceConfiguration, callback(deviceId) | add a new device |
removeDevice(deviceId, callback(err)) | remove a device |
updateDevice(deviceConfiguration, callback(err, deviceId)) | update a device |
turnOn(deviceId, callback(error)) | send on command to device |
turnOff(deviceId, callback(error)) | send off command to device |
up(deviceId, callback(error)) | send up command to device |
down(deviceId, callback(error)) | send down command to device |
dim(deviceId, level, callback(error)) | send dim command to device |
bell(deviceId, callback(error)) | send bell command to device |
execute(deviceId, callback(error)) | send execute command to device |
stop(deviceId, callback(error)) | send stop command to device |
learn(deviceId, callback(error)) | send learn command for device |
addRawDeviceEventListener(listener(data)) | add a raw device event listener |
addSensorEventListener(listener(sensorEventData)) | add a sensor event listener |
addDeviceEventListener(listener(deviceEventData)) | add a device event listener |
removeRawDeviceEventListener(listener, callback(err)) | remove a raw device event listener |
removeDeviceEventListener(listener, callback(err)) | remove a device event listener |
removeSensorEventListener(listener, callback(err)) | remove a sensor event listener |
sendRawCommand(command, callback(error)) | send raw device command |
Properties
property | description |
---|---|
sensorValueType | enum with sensor value types (Temperature, Humidity, RainTotal, RainRate, WindDirection, WindAverage, WindGust) |
method | enum with methods (TurnOn, TurnOff, Bell, Toggle, Dim, Execute, Up, Down, Stop) |
errorCode | enum with error codes (NoError, NotFound, PermissionDenied, DeviceNotFound, MethodNotSupported, Communication, ConnectingService, UnknownResponse, Syntax, BrokenPipe, CommunicatingService, Unknown) |
Examples
Code examples is probably better than wall of text.
getDevices
var jtelldus = ;jtelldus;
addDevice
var jtelldus = ;var device = name: "Lamp" model: "selflearning-switch" protocol: "arctech" parameters: house: 10 unit: 1 ;jtelldus;
removeDevice
var jtelldus = ; jtelldus;
updateDevice
var jtelldus = ;var device = id: 1 // id is required! name: 'Blue lamp' parameters: house: 10 unit: 3 ;jtelldus;
turnOn
var jtelldus = ;jtelldus;
turnOff
var jtelldus = ;jtelldus;
up
var jtelldus = ;jtelldus;
down
var jtelldus = ;jtelldus;
dim
var jtelldus = ;jtelldus;
bell
var jtelldus = ;jtelldus;
execute
var jtelldus = ;jtelldus;
stop
var jtelldus = ;jtelldus;
learn
var jtelldus = ;jtelldus;
addRawDeviceEventListener / removeRawDeviceEventListener
var jtelldus = ;var { console;};jtelldus;jtelldus;
addSensorEventListener / removeSensorEventListener
var jtelldus = ;var { console;};jtelldus;jtelldus;
addDeviceEventListener / removeDeviceEventListener
var jtelldus = ;var { console;};jtelldus;jtelldus;
sendRawCommand
var jtelldus = ;var command = 'class:command;protocol:waveman;model:codeswitch;house:A;unit:1;method:turnoff;';jtelldus;