-
Notifications
You must be signed in to change notification settings - Fork 88.5k
[WWST-5169] Everspring Outdoor Floodlight integration #11267
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
Changes from all commits
d3bc598
538ab15
1f85399
7f9cd36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ metadata { | |
| fingerprint mfr: "0258", prod: "0003", model: "008D", deviceJoinName: "NEO Coolcam Motion/Light Sensor" | ||
| //zw:S type:0701 mfr:0258 prod:0003 model:108D ver:3.80 zwv:4.38 lib:06 cc:5E,86,72,5A,73,80,31,71,30,70,85,59,84 role:06 ff:8C07 ui:8C07 EU version | ||
| fingerprint mfr: "0258", prod: "0003", model: "108D", deviceJoinName: "NEO Coolcam Motion/Light Sensor" | ||
| fingerprint mfr: "0060", prod: "0012", model: "0001", deviceJoinName: "Everspring Outdoor Floodlight", mmnm: "SmartThings", vid: "generic-motion-light-sensor" | ||
| } | ||
|
|
||
| simulator { | ||
|
|
@@ -89,6 +90,10 @@ def updated() { | |
| def configure() { | ||
| // Device wakes up every deviceCheckInterval hours, this interval allows us to miss one wakeup notification before marking offline | ||
| sendEvent(name: "checkInterval", value: 2 * deviceWakeUpInterval * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) | ||
|
|
||
| if (isEverspringFloodlight()) { | ||
| response(zwave.configurationV1.configurationSet(parameterNumber: 3, size: 2, scaledConfigurationValue: 600)) //enables illuminance report every 10 minutes | ||
| } | ||
| } | ||
|
|
||
| def getDeviceWakeUpInterval() { | ||
|
|
@@ -121,7 +126,7 @@ private getCommandClassVersions() { | |
| def parse(String description) { | ||
| def results = [] | ||
| if (description.startsWith("Err")) { | ||
| results << createEvent(descriptionText: description, displayed: true) | ||
| results += createEvent(descriptionText: description, displayed: true) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What’s the reasoning behind this change?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. '<<' created double nested lists, which then it leaded to events not being returned correctly from parse() method (they weren't shown in IDE/both mobile apps)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kianooshST is this something that bothers you, and I should rework it?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No that is fine, I was just curious about the change. |
||
| } else { | ||
| def cmd = zwave.parse(description, commandClassVersions) | ||
| if (cmd) { | ||
|
|
@@ -144,9 +149,9 @@ def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cm | |
| def results = [] | ||
| if (cmd.notificationType == 0x07) { // Burglar | ||
| if (cmd.event == 0x08) { // detected | ||
| results << sensorMotionEvent(1) | ||
| results += sensorMotionEvent(1) | ||
| } else if (cmd.event == 0x00) { // inactive | ||
| results << sensorMotionEvent(0) | ||
| results += sensorMotionEvent(0) | ||
| } | ||
| } | ||
| return results | ||
|
|
@@ -162,7 +167,7 @@ def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) { | |
| } else { | ||
| map.value = cmd.batteryLevel | ||
| } | ||
| results << createEvent(map) | ||
| results += createEvent(map) | ||
| return results | ||
| } | ||
|
|
||
|
|
@@ -179,21 +184,21 @@ def zwaveEvent(physicalgraph.zwave.commands.sensormultilevelv5.SensorMultilevelR | |
| default: | ||
| map.descriptionText = cmd.toString() | ||
| } | ||
| results << createEvent(map) | ||
| results += createEvent(map) | ||
| return results | ||
| } | ||
|
|
||
| def zwaveEvent(physicalgraph.zwave.commands.wakeupv2.WakeUpNotification cmd) { | ||
| def results = [] | ||
| results << createEvent(descriptionText: "$device.displayName woke up", isStateChange: false) | ||
| results << response(zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 3, scale: 1).format()) | ||
| results += createEvent(descriptionText: "$device.displayName woke up", isStateChange: false) | ||
| results += response(zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 3, scale: 1).format()) | ||
| if (!state.lastbatt || (now() - state.lastbatt) >= 10 * 60 * 60 * 1000) { | ||
| results << response(["delay 1000", | ||
| results += response(["delay 1000", | ||
| zwave.batteryV1.batteryGet().format(), | ||
| "delay 2000" | ||
| ]) | ||
| } | ||
| results << response(zwave.wakeUpV2.wakeUpNoMoreInformation().format()) | ||
| results += response(zwave.wakeUpV2.wakeUpNoMoreInformation().format()) | ||
| return results | ||
| } | ||
|
|
||
|
|
@@ -206,9 +211,13 @@ def zwaveEvent(physicalgraph.zwave.Command cmd) { | |
| def sensorMotionEvent(value) { | ||
| def result = [] | ||
| if (value) { | ||
| result << createEvent(name: "motion", value: "active", descriptionText: "$device.displayName detected motion") | ||
| result += createEvent(name: "motion", value: "active", descriptionText: "$device.displayName detected motion") | ||
| } else { | ||
| result << createEvent(name: "motion", value: "inactive", descriptionText: "$device.displayName motion has stopped") | ||
| result += createEvent(name: "motion", value: "inactive", descriptionText: "$device.displayName motion has stopped") | ||
| } | ||
| return result | ||
| } | ||
|
|
||
| private isEverspringFloodlight() { | ||
| zwaveInfo.mfr == "0060" && zwaveInfo.model == "0001" | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this limit the illuminance reporting range?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean metadata? No, I didn't meddle with that.
If you ask about device, then yes, it supports illuminance reports only up to 250 lx.