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

Fix for motion detector SP816 #33

Merged
merged 1 commit into from
Dec 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
{
"name": "Jonas Lundblad",
"email": "[email protected]"
},
{
"name": "Xet Erixon",
"email":"[email protected]"
}
]
},
Expand Down
21 changes: 13 additions & 8 deletions drivers/SP816/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@ module.exports = new ZwaveDriver( path.basename(__dirname), {
capabilities: {

'alarm_motion': {
'command_class' : 'COMMAND_CLASS_BASIC',
'command_report' : 'BASIC_SET',
'command_report_parser' : function( report ){
Homey.log('[EVR DEBUG] alarm_motion report:', report);
if (report.hasOwnProperty('Value (Raw)')) {
// if (typeof report['Value (Raw)'][0] !== 'undefined') {
return report['Value (Raw)'][0] > 0;
command_class: 'COMMAND_CLASS_NOTIFICATION',
command_report: 'NOTIFICATION_REPORT',
command_report_parser: report => {
// Homey.log('[EVR DEBUG] alarm_motion report:', report);
if (report && report.hasOwnProperty('Notification Type') &&
report.hasOwnProperty('Event')) {
if (report['Notification Type'] === 'Home Security') {
return report['Event'] === 8;
} else {
return null;
}
}
}
return null;
},
},

// 'alarm_tamper': {
Expand Down