Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for plug-in switch mini (TZWP-102) #6

Merged
merged 12 commits into from
Aug 18, 2018
Merged
Prev Previous commit
Next Next commit
Measure kinda work
  • Loading branch information
xeterixon committed Jun 13, 2018
commit 80fd0f3634b753f1a6fc89dbc9499d6716dc9b5b
117 changes: 115 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"class": "socket",
"capabilities": [
"onoff",
"measure_power",
"meter_power"
"meter_power",
"measure_power"
],
"images": {
"large": "/drivers/TZWP-102/assets/images/large.png",
Expand Down Expand Up @@ -153,8 +153,121 @@
"hint": {
"en": "0 = The LED status follows the load change.\n1 = When operating the load, the LED lights for 5 seconds and then turns off."
}
},
{
"id": "16",
"type": "number",
"value": 10,
"attr": {
"min": 0,
"max": 65535
},
"_size": 2,
"label": {
"en": "Minimum change in wattage"
},
"hint": {
"en": "The value here represents minimum change in wattage (in terms of wattage) for a meter report to be sent"
}
},
{
"id": "17",
"type": "number",
"value": 10,
"attr": {
"min": -128,
"max": 127
},
"_size": 1,
"label": {
"en": "Minimum change in wattage percent"
},
"hint": {
"en": "The value here represents minimum change in wattage percent (in terms of percentage) for a meter report (watt) to be sent"
}
},
{
"id": "101",
"type": "number",
"value": 0,
"attr": {
"min": 0,
"max": 2678400
},
"_size": 4,
"label": {
"en": "Setting time for sending meter report (watt)"
},
"hint": {
"en": "TODO"
}
},
{
"id": "102",
"type": "number",
"value": 0,
"attr": {
"min": 0,
"max": 2678400
},
"_size": 4,
"label": {
"en": "Setting time for sending meter report (KWh)"
},
"hint": {
"en": "TODO"
}
},
{
"id": "103",
"type": "number",
"value": 0,
"attr": {
"min": 0,
"max": 2678400
},
"_size": 4,
"label": {
"en": "Setting time for sending meter report (voltage)"
},
"hint": {
"en": "TODO"
}
},
{
"id": "104",
"type": "number",
"value": 0,
"attr": {
"min": 0,
"max": 2678400
},
"_size": 4,
"label": {
"en": "Setting time for sending meter report (current)"
},
"hint": {
"en": "TODO"
}
},
{
"id": "254",
"type": "number",
"value": 0,
"attr": {
"min": 0,
"max": 2678400
},
"_size": 1,
"label": {
"en": "Enable/disable the configuration command"
},
"hint": {
"en": "0 = Unlock (default).\n1 = Lock"
}
}


]
}
]
Expand Down
13 changes: 6 additions & 7 deletions drivers/TZWP-102/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ class TelldusTZWP102 extends ZwaveDevice {
async onMeshInit() {

// enable debugging
// this.enableDebug();
this.enableDebug();

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

this.registerCapability('onoff', 'BASIC');
this.registerCapability('onoff','BASIC');
this.registerCapability('onoff','SWITCH_BINARY');
// this.registerCapability('meter_power','METER');
// this.registerCapability('measure_power','SENSOR_MULTILEVEL');
// this.registerCapabilityListener('onoff', this.onCapabilityOnoff.bind(this));
// this.registerReportListener('SWITCH_BINARY', 'SWITCH_BINARY_REPORT', ( rawReport, parsedReport ) => {
this.registerCapability('meter_power','METER');
this.registerCapability('measure_power','METER')
// this.registerReportListener('METER', 'METER_REPORT', ( rawReport, parsedReport ) => {
// console.log('registerReportListener', rawReport, parsedReport);
// });
}
Expand Down
153 changes: 153 additions & 0 deletions nodeinfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
```
ZwaveDevice has been inited
------------------------------------------
Node: a6a856d2-aac0-4b13-86d0-2b0fb2c219e4
- Battery: false
- CommandClass: COMMAND_CLASS_ZWAVEPLUS_INFO
-- Version: 2
-- Commands:
--- ZWAVEPLUS_INFO_GET
--- ZWAVEPLUS_INFO_REPORT
- CommandClass: COMMAND_CLASS_SWITCH_BINARY
-- Version: 1
-- Commands:
--- SWITCH_BINARY_GET
--- SWITCH_BINARY_REPORT
--- SWITCH_BINARY_SET
- CommandClass: COMMAND_CLASS_ASSOCIATION
-- Version: 2
-- Commands:
--- ASSOCIATION_GET
--- ASSOCIATION_GROUPINGS_GET
--- ASSOCIATION_GROUPINGS_REPORT
--- ASSOCIATION_REMOVE
--- ASSOCIATION_REPORT
--- ASSOCIATION_SET
--- ASSOCIATION_SPECIFIC_GROUP_GET
--- ASSOCIATION_SPECIFIC_GROUP_REPORT
- CommandClass: COMMAND_CLASS_ASSOCIATION_GRP_INFO
-- Version: 1
-- Commands:
--- ASSOCIATION_GROUP_NAME_GET
--- ASSOCIATION_GROUP_NAME_REPORT
--- ASSOCIATION_GROUP_INFO_GET
--- ASSOCIATION_GROUP_INFO_REPORT
--- ASSOCIATION_GROUP_COMMAND_LIST_GET
--- ASSOCIATION_GROUP_COMMAND_LIST_REPORT
- CommandClass: COMMAND_CLASS_TRANSPORT_SERVICE
-- Version: 2
-- Commands:
--- COMMAND_FIRST_SEGMENT
--- COMMAND_SEGMENT_COMPLETE
--- COMMAND_SEGMENT_REQUEST
--- COMMAND_SEGMENT_WAIT
--- COMMAND_SUBSEQUENT_SEGMENT
- CommandClass: COMMAND_CLASS_VERSION
-- Version: 2
-- Commands:
--- VERSION_COMMAND_CLASS_GET
--- VERSION_COMMAND_CLASS_REPORT
--- VERSION_GET
--- VERSION_REPORT
- CommandClass: COMMAND_CLASS_MANUFACTURER_SPECIFIC
-- Version: 2
-- Commands:
--- MANUFACTURER_SPECIFIC_GET
--- MANUFACTURER_SPECIFIC_REPORT
--- DEVICE_SPECIFIC_GET
--- DEVICE_SPECIFIC_REPORT
- CommandClass: COMMAND_CLASS_METER
-- Version: 3
-- Commands:
--- METER_GET
--- METER_REPORT
--- METER_RESET
--- METER_SUPPORTED_GET
--- METER_SUPPORTED_REPORT
- CommandClass: COMMAND_CLASS_DEVICE_RESET_LOCALLY
-- Version: 1
-- Commands:
--- DEVICE_RESET_LOCALLY_NOTIFICATION
- CommandClass: COMMAND_CLASS_POWERLEVEL
-- Version: 1
-- Commands:
--- POWERLEVEL_GET
--- POWERLEVEL_REPORT
--- POWERLEVEL_SET
--- POWERLEVEL_TEST_NODE_GET
--- POWERLEVEL_TEST_NODE_REPORT
--- POWERLEVEL_TEST_NODE_SET
- CommandClass: COMMAND_CLASS_CONFIGURATION
-- Version: 1
-- Commands:
--- CONFIGURATION_GET
--- CONFIGURATION_REPORT
--- CONFIGURATION_SET
- CommandClass: COMMAND_CLASS_SCENE_ACTUATOR_CONF
-- Version: 1
-- Commands:
--- SCENE_ACTUATOR_CONF_GET
--- SCENE_ACTUATOR_CONF_REPORT
--- SCENE_ACTUATOR_CONF_SET
- CommandClass: COMMAND_CLASS_SCENE_ACTIVATION
-- Version: 1
-- Commands:
--- SCENE_ACTIVATION_SET
- CommandClass: COMMAND_CLASS_SECURITY
-- Version: 1
-- Commands:
--- NETWORK_KEY_SET
--- NETWORK_KEY_VERIFY
--- SECURITY_COMMANDS_SUPPORTED_GET
--- SECURITY_COMMANDS_SUPPORTED_REPORT
--- SECURITY_MESSAGE_ENCAPSULATION
--- SECURITY_MESSAGE_ENCAPSULATION_NONCE_GET
--- SECURITY_NONCE_GET
--- SECURITY_NONCE_REPORT
--- SECURITY_SCHEME_GET
--- SECURITY_SCHEME_INHERIT
--- SECURITY_SCHEME_REPORT
- CommandClass: COMMAND_CLASS_SECURITY_2
-- Version: 1
-- Commands:
--- SECURITY_2_NONCE_GET
--- SECURITY_2_NONCE_REPORT
--- SECURITY_2_MESSAGE_ENCAPSULATION
--- KEX_GET
--- KEX_REPORT
--- KEX_SET
--- KEX_FAIL
--- PUBLIC_KEY_REPORT
--- SECURITY_2_NETWORK_KEY_GET
--- SECURITY_2_NETWORK_KEY_REPORT
--- SECURITY_2_NETWORK_KEY_VERIFY
--- SECURITY_2_TRANSFER_END
--- SECURITY_2_COMMANDS_SUPPORTED_GET
--- SECURITY_2_COMMANDS_SUPPORTED_REPORT
--- SECURITY_2_CAPABILITIES_GET
--- SECURITY_2_CAPABILITIES_REPORT
- CommandClass: COMMAND_CLASS_SUPERVISION
-- Version: 1
-- Commands:
--- SUPERVISION_GET
--- SUPERVISION_REPORT
- CommandClass: COMMAND_CLASS_FIRMWARE_UPDATE_MD
-- Version: 4
-- Commands:
--- FIRMWARE_MD_GET
--- FIRMWARE_MD_REPORT
--- FIRMWARE_UPDATE_MD_GET
--- FIRMWARE_UPDATE_MD_REPORT
--- FIRMWARE_UPDATE_MD_REQUEST_GET
--- FIRMWARE_UPDATE_MD_REQUEST_REPORT
--- FIRMWARE_UPDATE_MD_STATUS_REPORT
--- FIRMWARE_UPDATE_ACTIVATION_SET
--- FIRMWARE_UPDATE_ACTIVATION_STATUS_REPORT
- CommandClass: COMMAND_CLASS_BASIC
-- Version: 1
-- Commands:
--- BASIC_GET
--- BASIC_REPORT
--- BASIC_SET
------------------------------------------
```