Skip to content

Commit

Permalink
Merge pull request #5 from TedTolboom/development
Browse files Browse the repository at this point in the history
Development to Master for app store release
  • Loading branch information
TedTolboom authored Apr 2, 2018
2 parents 356319b + e2c0ffb commit cb6ab15
Show file tree
Hide file tree
Showing 48 changed files with 2,857 additions and 1,014 deletions.
43 changes: 36 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,47 @@ Adds support for Steinel Smart Home Z-wave devices made by [Steinel](https://www
**Note:** This app is using [HomeyConfig composer](https://www.npmjs.com/package/node-homey-config-composer).
Please file Pull Requests on the *development* branch of this repository and with respect to the refactored files in _/drivers_ and _/config_ folders.

## Supported devices
* IS 140-2 Z-wave motion detector
* L 180 LED iHF Z-wave Outdoor light
* XLED home 2 Z-wave Floodlight
* RS LED D2 Z-wave Indoor light
## Supported devices (and capabilities)
* IS 140-2 Z-wave motion detector (onoff, measure_luminance, alarm_motion)
* L 180 LED iHF Z-wave Outdoor light (onoff, *dim*, measure_luminance, alarm_motion)
* XLED home 2 Z-wave Floodlight (onoff, measure_luminance, alarm_motion)
* RS LED D2 Z-wave Indoor light (onoff, measure_luminance, alarm_motion)

## Supported Languages:
* English
* English
* Dutch


## Acknowledgements:
This app and driver development has been supported by:

* Robbshop by providing the devices for debugging:
<a href="https://www.robbshop.nl/heat-it-wandthermostaat-zwaveplus-zwart">
<img src="https://www.robbshop.nl/skin/frontend/robbshop/default/images/logo.svg" width="25%">

## Feedback:

## Feedback:
Any requests please post them in the [Steinel app topic on the Athom Forum](https://forum.athom.com/discussion/3834/) or contact me on [Slack](https://athomcommunity.slack.com/team/tedtolboom)

## Change Log:
### v 1.0.0
* App store release

### v 0.1.0
* Update devices to light class (re-inclusion required)
* Add sensor capability (custom) flow cards for motion alarm and measure_luminance
* Update Homey meshdriver to 1.2.10

### v 0.0.4
* Administrative update; add link to community forum topic

### v 0.0.3
* Removed dimming capability for all but L810 LED iHF device (updated mobile cards)
* Check and update all parameters for all devices

### v 0.0.2
* ~Added dimming capability for all devices~ (update incorrect)
* Updated onoff capability to BASIC CC

### v 0.0.1
* Initial release for testing
559 changes: 446 additions & 113 deletions app.json

Large diffs are not rendered by default.

115 changes: 90 additions & 25 deletions config/drivers/IS_140_2.json

Large diffs are not rendered by default.

123 changes: 90 additions & 33 deletions config/drivers/L_810_LED_iHF.json

Large diffs are not rendered by default.

112 changes: 79 additions & 33 deletions config/drivers/RS_LED_D2.json

Large diffs are not rendered by default.

112 changes: 79 additions & 33 deletions config/drivers/XLED_home_2.json

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions config/flow/actions/sensor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[{
"id": "onoff_turn_on",
"title": {
"en": "Turn on",
"nl": "Zet aan"
},
"args": [
{
"type": "device",
"name": "device",
"filter": "driver_id=IS_140_2|L_810L_810_LED_iHF|RS_LED_D2|XLED_home_2"
}
]
},
{
"id": "onoff_turn_off",
"title": {
"en": "Turn off",
"nl": "Zet uit"
},
"args": [
{
"type": "device",
"name": "device",
"filter": "driver_id=IS_140_2|L_810L_810_LED_iHF|RS_LED_D2|XLED_home_2"
}
]
},
{
"id": "onoff_turn_on_off",
"title": {
"en": "Toggle on or off",
"nl": "Schakel aan of uit"
},
"args": [
{
"type": "device",
"name": "device",
"filter": "driver_id=IS_140_2|L_810L_810_LED_iHF|RS_LED_D2|XLED_home_2"
}
]
}
]
16 changes: 16 additions & 0 deletions config/flow/conditions/sensor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"id": "sensor_alarm_motion_is_on",
"title": {
"en": "The motion alarm is !{{on|off}}",
"nl": "De bewegingsmelder is !{{aan|uit}}"
},
"args": [
{
"type": "device",
"name": "device",
"filter": "driver_id=IS_140_2|L_810L_810_LED_iHF|RS_LED_D2|XLED_home_2"
}
]
}
]
54 changes: 54 additions & 0 deletions config/flow/triggers/sensor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[{
"id": "sensor_alarm_motion_on",
"title": {
"en": "The motion alarm turned on",
"nl": "De bewegingsmelder gaat aan"
},
"args": [
{
"type": "device",
"name": "device",
"filter": "driver_id=IS_140_2|L_810L_810_LED_iHF|RS_LED_D2|XLED_home_2"
}
]
},
{
"id": "sensor_alarm_motion_off",
"title": {
"en": "The motion alarm turned off",
"nl": "De bewegingsmelder gaat uit"
},
"args": [
{
"type": "device",
"name": "device",
"filter": "driver_id=IS_140_2|L_810L_810_LED_iHF|RS_LED_D2|XLED_home_2"
}
]
},
{
"id": "sensor_measure_luminance",
"title": {
"en": "The luminance changed",
"nl": "De helderheid is veranderd"
},
"args": [
{
"type": "device",
"name": "device",
"filter": "driver_id=IS_140_2|L_810L_810_LED_iHF|RS_LED_D2|XLED_home_2"
}
],
"tokens": [
{
"name": "luminance",
"type": "number",
"title": {
"en": "luminance",
"nl": "helderheid"
},
"example": 100
}
]
}
]
56 changes: 56 additions & 0 deletions drivers/IS_140_2/device.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,70 @@
'use strict';
const Homey = require('homey');

const ZwaveDevice = require('homey-meshdriver').ZwaveDevice;

// Documentation: https://Products.Z-WaveAlliance.org/ProductManual/File?folder=&filename=Manuals/2310/IS140-2Z-Wave_5spr_110050437_11.04.17.pdf

class SteinelIS1402 extends ZwaveDevice {
onMeshInit() {

// enable debugging
this.enableDebug();

// print the node's info to the console
this.printNode();

this.registerCapability('onoff', 'SWITCH_BINARY');
this.registerCapability('measure_luminance', 'SENSOR_MULTILEVEL');
this.registerCapability('alarm_motion', 'NOTIFICATION');

// Register triggers for flows
this.triggerAlarmMotionOn = new Homey.FlowCardTriggerDevice('sensor_alarm_motion_on')
this.triggerAlarmMotionOn
.register();

this.triggerAlarmMotionOff = new Homey.FlowCardTriggerDevice('sensor_alarm_motion_off')
this.triggerAlarmMotionOff
.register();

this.triggerMeasureLuminance = new Homey.FlowCardTriggerDevice('sensor_measure_luminance')
this.triggerMeasureLuminance
.register();

// Register conditions for flows
this.conditionAlarmMotionIsOn = new Homey.FlowCardCondition("sensor_alarm_motion_is_on")
this.conditionAlarmMotionIsOn
.register()
.registerRunListener((args, state) => {
return Promise.resolve(this.getCapabilityValue('alarm_motion'));
})

// this.registerCapabilityListener('alarm_motion', this._onCapabilityAlarmMotion.bind(this))

// register a report listener
this.registerReportListener('NOTIFICATION', 'NOTIFICATION_REPORT', this._onCapabilityAlarmMotion.bind(this));

// this.registerCapabilityListener('measure_luminance', this._onCapabilityMeasureLuminance.bind(this))

// register a report listener
this.registerReportListener('SENSOR_MULTILEVEL', 'SENSOR_MULTILEVEL_REPORT', this._onCapabilityMeasureLuminance.bind(this));

}

_onCapabilityAlarmMotion(rawReport, parsedReport) {
if (parsedReport != undefined) {
this.log('_onCapabilityAlarmMotion', parsedReport, `triggerAlarmMotion${parsedReport ? 'On' : 'Off'}`);
this[`triggerAlarmMotion${parsedReport ? 'On' : 'Off'}`].trigger(this, null, null)
}
return true;
}

_onCapabilityMeasureLuminance(rawReport, parsedReport) {
this.log('_onCapabilityMeasureLuminance', parsedReport);
this.triggerMeasureLuminance.trigger(this, {
luminance: parsedReport,
}, null)
return true;
}
}
module.exports = SteinelIS1402;
57 changes: 57 additions & 0 deletions drivers/L_810_LED_iHF/device.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,71 @@
'use strict';
const Homey = require('homey');

const ZwaveDevice = require('homey-meshdriver').ZwaveDevice;

// Documentation: https://Products.Z-WaveAlliance.org/ProductManual/File?folder=&filename=Manuals/2309/110050438 BDAL L 810 LED IHF SMARTHOME D-GB-F-I-NL.pdf

class SteinelL810LED extends ZwaveDevice {
onMeshInit() {

// enable debugging
this.enableDebug();

// print the node's info to the console
this.printNode();

this.registerCapability('onoff', 'SWITCH_BINARY');
this.registerCapability('dim', 'SWITCH_MULTILEVEL');
this.registerCapability('measure_luminance', 'SENSOR_MULTILEVEL');
this.registerCapability('alarm_motion', 'NOTIFICATION');

// Register triggers for flows
this.triggerAlarmMotionOn = new Homey.FlowCardTriggerDevice('sensor_alarm_motion_on')
this.triggerAlarmMotionOn
.register();

this.triggerAlarmMotionOff = new Homey.FlowCardTriggerDevice('sensor_alarm_motion_off')
this.triggerAlarmMotionOff
.register();

this.triggerMeasureLuminance = new Homey.FlowCardTriggerDevice('sensor_measure_luminance')
this.triggerMeasureLuminance
.register();

// Register conditions for flows
this.conditionAlarmMotionIsOn = new Homey.FlowCardCondition("sensor_alarm_motion_is_on")
this.conditionAlarmMotionIsOn
.register()
.registerRunListener((args, state) => {
return Promise.resolve(this.getCapabilityValue('alarm_motion'));
})

// this.registerCapabilityListener('alarm_motion', this._onCapabilityAlarmMotion.bind(this))

// register a report listener
this.registerReportListener('NOTIFICATION', 'NOTIFICATION_REPORT', this._onCapabilityAlarmMotion.bind(this));

// this.registerCapabilityListener('measure_luminance', this._onCapabilityMeasureLuminance.bind(this))

// register a report listener
this.registerReportListener('SENSOR_MULTILEVEL', 'SENSOR_MULTILEVEL_REPORT', this._onCapabilityMeasureLuminance.bind(this));

}

_onCapabilityAlarmMotion(rawReport, parsedReport) {
if (parsedReport != undefined) {
this.log('_onCapabilityAlarmMotion', parsedReport, `triggerAlarmMotion${parsedReport ? 'On' : 'Off'}`);
this[`triggerAlarmMotion${parsedReport ? 'On' : 'Off'}`].trigger(this, null, null)
}
return true;
}

_onCapabilityMeasureLuminance(rawReport, parsedReport) {
this.log('_onCapabilityMeasureLuminance', parsedReport);
this.triggerMeasureLuminance.trigger(this, {
luminance: parsedReport,
}, null)
return true;
}
}
module.exports = SteinelL810LED;
56 changes: 56 additions & 0 deletions drivers/RS_LED_D2/device.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,70 @@
'use strict';
const Homey = require('homey');

const ZwaveDevice = require('homey-meshdriver').ZwaveDevice;

// Documentation: https://Products.Z-WaveAlliance.org/ProductManual/File?folder=&filename=Manuals/2243/RSLEDD2Z-Wave_5spr_110054844_11.04.17.pdf

class SteinhelRSLEDD2 extends ZwaveDevice {
onMeshInit() {

// enable debugging
this.enableDebug();

// print the node's info to the console
this.printNode();

this.registerCapability('onoff', 'SWITCH_BINARY');
this.registerCapability('measure_luminance', 'SENSOR_MULTILEVEL');
this.registerCapability('alarm_motion', 'NOTIFICATION');

// Register triggers for flows
this.triggerAlarmMotionOn = new Homey.FlowCardTriggerDevice('sensor_alarm_motion_on')
this.triggerAlarmMotionOn
.register();

this.triggerAlarmMotionOff = new Homey.FlowCardTriggerDevice('sensor_alarm_motion_off')
this.triggerAlarmMotionOff
.register();

this.triggerMeasureLuminance = new Homey.FlowCardTriggerDevice('sensor_measure_luminance')
this.triggerMeasureLuminance
.register();

// Register conditions for flows
this.conditionAlarmMotionIsOn = new Homey.FlowCardCondition("sensor_alarm_motion_is_on")
this.conditionAlarmMotionIsOn
.register()
.registerRunListener((args, state) => {
return Promise.resolve(this.getCapabilityValue('alarm_motion'));
})

// this.registerCapabilityListener('alarm_motion', this._onCapabilityAlarmMotion.bind(this))

// register a report listener
this.registerReportListener('NOTIFICATION', 'NOTIFICATION_REPORT', this._onCapabilityAlarmMotion.bind(this));

// this.registerCapabilityListener('measure_luminance', this._onCapabilityMeasureLuminance.bind(this))

// register a report listener
this.registerReportListener('SENSOR_MULTILEVEL', 'SENSOR_MULTILEVEL_REPORT', this._onCapabilityMeasureLuminance.bind(this));

}

_onCapabilityAlarmMotion(rawReport, parsedReport) {
if (parsedReport != undefined) {
this.log('_onCapabilityAlarmMotion', parsedReport, `triggerAlarmMotion${parsedReport ? 'On' : 'Off'}`);
this[`triggerAlarmMotion${parsedReport ? 'On' : 'Off'}`].trigger(this, null, null)
}
return true;
}

_onCapabilityMeasureLuminance(rawReport, parsedReport) {
this.log('_onCapabilityMeasureLuminance', parsedReport);
this.triggerMeasureLuminance.trigger(this, {
luminance: parsedReport,
}, null)
return true;
}
}
module.exports = SteinhelRSLEDD2;
Binary file removed drivers/XLED_home_2/assets/images/original.png
Binary file not shown.
Loading

0 comments on commit cb6ab15

Please sign in to comment.