profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/krlaframboise/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

push eventkrlaframboise/SmartThings

Kevin LaFramboise

commit sha 1efeefb838d79616a6e4324fbab1d67a7f9aec46

view details

push time in 17 days

push eventkrlaframboise/SmartThings

Kevin LaFramboise

commit sha 9620c39f9ecbc62a55e651dc8d5bc178a3941c57

view details

push time in 17 days

push eventkrlaframboise/SmartThings

Kevin LaFramboise

commit sha 387195978bf8778fc9377102b3857323bb323e8c

view details

push time in 17 days

Pull request review commentSmartThingsCommunity/SmartThingsPublic

DevWs for Zooz (The Smartest House) containing containing Zooz Remote Switch ZEN34

+/*+ *  Zooz Remote Switch ZEN34+ *+ *  Changelog:+ *+ *    2021-08-31+ *      - Publication Release+ *+ *  Copyright 2021 Zooz+ *+ *  Licensed under the Apache License, Version 2.0 (the "License");+ *  you may not use this file except in compliance with the License.+ *  You may obtain a copy of the License at+ *+ *      http://www.apache.org/licenses/LICENSE-2.0+ *+ *  Unless required by applicable law or agreed to in writing, software+ *  distributed under the License is distributed on an "AS IS" BASIS,+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ *  See the License for the specific language governing permissions and+ *  limitations under the License.+ *+*/++import groovy.transform.Field++@Field static Map commandClassVersions = [+	0x20: 1,	// Basic+	0x26: 3,	// Switch Multilevel (4)+	0x55: 1,	// Transport Service+	0x59: 1,	// AssociationGrpInfo+	0x5A: 1,	// DeviceResetLocally+	0x5B: 1,	// CentralScene (3)+	0x5E: 2,	// ZwaveplusInfo+	0x6C: 1,	// Supervision+	0x70: 1,	// Configuration+	0x72: 2,	// ManufacturerSpecific+	0x73: 1,	// Powerlevel+	0x7A: 2,	// Firmware Update Md (3)+	0x80: 1,	// Battery+	0x84: 2,	// WakeUp+	0x85: 2,	// Association+	0x86: 1,	// Version (2)+	0x87: 1,	// Indicator+	0x8E: 2,	// MultiChannelAssociation (3)+	0x9F: 1		// Security 2+]++@Field static List<String> supportedButtonValues = ["down","down_hold","down_2x","down_3x","down_4x","down_5x","up","up_hold","up_2x","up_3x","up_4x","up_5x","down_released","up_released"]++@Field static Map configParams = [+	ledMode: [num:1, title:"LED Indicator Mode", size:1, defaultVal:1, options:[0:"Always off", 1:"On when pressed [DEFAULT]", 2:"Always on (upper paddle color)", 3:"Always on (lower paddle color)"]],+	upperPaddleLedColor: [num:2, title:"Upper Paddled LED Indicator Color", size:1, defaultVal:1, options:[0:"White", 1:"Blue [DEFAULT]", 2:"Green", 3:"Red", 4:"Magenta", 5:"Yellow", 6:"Cyan"]],+	lowerPaddleLedColor: [num:3, title:"Lower Paddle LED Indicator Color", size:1, defaultVal:0, options:[0:"White [DEFAULT]", 1:"Blue", 2:"Green", 3:"Red", 4:"Magenta", 5:"Yellow", 6:"Cyan"]]+]++@Field static int wakeUpInterval = 43200+@Field static int btnPushed = 0+@Field static int btnReleased = 1+@Field static int btnHeld = 2+@Field static int btnPushed2x = 3+@Field static int btnPushed6x = 7++metadata {+	definition (+		name:"Zooz Remote Switch ZEN34", +		namespace:"Zooz", +		author: "Kevin LaFramboise (krlaframboise)", +		ocfDeviceType: "x.com.st.d.remotecontroller",+		mnmn: "SmartThingsCommunity",+		vid: "540fce12-499a-3b90-b276-f4159eb55f42"+	) {+		capability "Sensor"+		capability "Battery"+		capability "Button"+		capability "Refresh"+		capability "Configuration"+		capability "Health Check"+		capability "platemusic11009.firmware"+		capability "platemusic11009.syncStatus"++		//zw:Ss2a type:1800 mfr:027A prod:7000 model:F001 ver:1.01 zwv:7.13 lib:03 cc:5E,55,9F,6C sec:86,85,8E,59,72,5A,73,80,5B,70,84,7A+		fingerprint mfr: "027A", prod: "7000", model: "F001", deviceJoinName: "Zooz Remote" //Zooz Remote Switch ZEN34

Multiple sections of that handler would need to be re-written/modified because it only supports 1 scene and the device supports 2.

The other built-in button DTHs that support multiple scenes use child devices which is a messy approach for this device because it's a paddle switch and the button capability already supports a bunch of "up" and "down" button values.

KevinTSH

comment created time in 2 months

PullRequestReviewEvent

push eventkrlaframboise/SmartThings

Kevin LaFramboise

commit sha a94f6e3f1831267e93377ca1c9c15cbae10a0520

view details

push time in 2 months

push eventkrlaframboise/SmartThings

Kevin LaFramboise

commit sha 3727ad04c5909a342b69d05d0e421848bb2aeb5d

view details

push time in 2 months

push eventkrlaframboise/SmartThings

Kevin LaFramboise

commit sha 0313d4972ef40f41453e4f50c549033d4bfe7360

view details

push time in 2 months

push eventkrlaframboise/SmartThings

Kevin LaFramboise

commit sha d2d4ad8e91898713b50cada1b751ca8f89389ca1

view details

push time in 2 months

push eventkrlaframboise/SmartThings

Kevin LaFramboise

commit sha d5c3e9291bdb11e0018d5597a29fed8cee3bdad5

view details

push time in 2 months

push eventkrlaframboise/SmartThings

Kevin LaFramboise

commit sha b9931c24a37ddfccc8f13e3f9515d05ad70b42de

view details

push time in 2 months

Pull request review commentSmartThingsCommunity/SmartThingsPublic

DevWs for Ecolink Intelligent Technology containing containing Ecolink Chime+Siren

+/*+ *  Ecolink Chime+Siren v1.0+ *+ *  Changelog:+ *+ *    1.0 (07/15/2021)+ *      - Initial Release+ *+ *+ *  Copyright 2021 Ecolink+ *+ *  Licensed under the Apache License, Version 2.0 (the "License");+ *  you may not use this file except in compliance with the License.+ *  You may obtain a copy of the License at+ *+ *      http://www.apache.org/licenses/LICENSE-2.0+ *+ *  Unless required by applicable law or agreed to in writing, software+ *  distributed under the License is distributed on an "AS IS" BASIS,+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ *  See the License for the specific language governing permissions and+ *  limitations under the License.+ *+*/++import groovy.transform.Field++@Field static Map commandClassVersions = [+	0x20: 1,	// Basic+	0x55: 1,	// Transport Service+	0x59: 1,	// AssociationGrpInfo+	0x5A: 1,	// DeviceResetLocally+	0x5E: 2,	// ZwaveplusInfo+	0x6C: 1,	// Supervision+	0x70: 1,	// Configuration+	0x71: 3,	// Notification v4+	0x72: 2,	// ManufacturerSpecific+	0x73: 1,	// Powerlevel+	0x79: 1,	// Sound Switch+	0x7A: 2,	// FirmwareUpdateMd+	0x80: 1,	// Battery+	0x85: 2,	// Association+	0x86: 1,	// Version (2)+	0x87: 3,	// Indicator+	0x8E: 2,	// Multi Channel Association+	0x9F: 1		// Security S2+]++@Field static List<Map> sounds = [+	[number:1, name:"1. One long beep"],+	[number:2, name:"2. Two beeps"],+	[number:3, name:"3. E1 Beep"],+	[number:4, name:"4. Tinker"],+	[number:5, name:"5. Droplet"],+	[number:6, name:"6. Rain"],+	[number:7, name:"7. Marimba"],+	[number:8, name:"8. Water dew"],+	[number:9, name:"9. Phone"],+	[number:10, name:"10. Pong"],+	[number:11, name:"11. Error Sound"],+	[number:12, name:"12. Chirp"],+	[number:13, name:"13. Alarm Siren", type:"siren"],+	[number:14, name:"14. Exit Delay", type:"siren"],+	[number:15, name:"15. Entry Delay", type:"siren"],+	[number:16, name:"16. Smoke Alarm", type:"siren"],+	[number:17, name:"17. CO Alarm", type:"siren"],+	[number:18, name:"18. Armed Away"],+	[number:19, name:"19. Armed Stay"],+	[number:20, name:"20. Disarmed"],+	[number:21, name:"21. Front Door"],+	[number:22, name:"22. Side Door"],+	[number:23, name:"23. Back Door"],+	[number:24, name:"24. Garage Door"],+	[number:25, name:"25. Alarm Siren 2", type:"siren"],+	[number:26, name:"26. Alarm Siren 3", type:"siren"],+	[number:27, name:"27. Traditional Marimba"],+	[number:28, name:"28. Westminster Piano"],+	[number:29, name:"29. Forest"],+	[number:30, name:"30. Garden Strings"],+	[number:126, name:"Entry/Exit Delay (15 Seconds)", indicatorID:0x16],+	[number:127, name:"Entry/Exit Delay (30 Seconds)", indicatorID:0x26],+	[number:128, name:"Entry/Exit Delay (45 Seconds)", indicatorID:0x36],+	[number:129, name:"Entry/Exit Delay (255 Seconds)", indicatorID:0xF6]+]++@Field static int powerManagement = 8+@Field static int powerDisconnected = 2+@Field static int powerReconnected = 3+@Field static int batteryCharging = 12+@Field static int batteryFullyCharged = 13+@Field static int chargeBatterySoon = 14+@Field static int chargeBatteryNow = 15+@Field static int batteryStatusDischarging = 0+@Field static int batteryStatusCharging = 1+@Field static int batteryStatusMaintaining = 2+@Field static String batteryCC = "80"+@Field static String soundSwitchCC = "79"+@Field static String soundSwitchConfigurationSet = "7905"+@Field static String soundSwitchConfigurationGet = "7906"+@Field static String soundSwitchConfigurationReport = "7907"+@Field static String soundSwitchTonePlaySet = "7908"+@Field static String soundSwitchTonePlayGet = "7909"+@Field static String soundSwitchTonePlayReport = "790A"+++metadata {+	definition (+		name: "Ecolink Chime+Siren",+		namespace: "krlaframboise",+		author: "Kevin LaFramboise (@krlaframboise)",+		ocfDeviceType: "x.com.st.d.siren",+		mnmn: "SmartThingsCommunity",+		vid: "02a8f57f-6c7b-37f9-86c8-4705bf4faa6f"+	) {+		capability "Actuator"+		capability "Sensor"+		capability "Switch"+		capability "platemusic11009.soundVolume"+		capability "platemusic11009.ecoPlaySoundNumber"+		capability "platemusic11009.ecoSirenSound"+		capability "platemusic11009.sirenVolume"+		capability "Alarm"+		capability "platemusic11009.ecoChimeSound"+		capability "platemusic11009.chimeVolume"+		capability "Chime"+		capability "Power Source"+		capability "Battery"+		capability "Refresh"+		capability "Configuration"+		capability "Health Check"+		capability "platemusic11009.firmware"++		fingerprint mfr:"014A", prod:"0007", model: "3975", deviceJoinName:"Ecolink Chime+Siren" // zw:L type:0301 mfr:014A prod:0007 model:3975 ver:2.04 zwv:7.13 lib:03 cc:5E,85,59,80,70,5A,7A,87,72,8E,71,73,98,9F,79,6C,55,86+	}++	preferences {+		[heartBeatParam, supervisionParam].each { param ->+			if (param.options) {+				input "configParam${param.num}", "enum",+					title: "${param.name}:",+					required: false,+					displayDuringSetup: false,+					defaultValue: param.defaultVal,+					options: param.options+			} else if (param.range) {+				input "configParam${param.num}", "number",+					title: "${param.name}:",+					required: false,+					displayDuringSetup: false,+					defaultValue: param.defaultVal,+					range: param.range+			}+		}++		input "debugOutput", "enum",+			title: "Enable Debug Logging?",+			required: false,+			displayDuringSetup: false,+			defaultValue: 1,+			options: [0:"No", 1:"Yes [DEFAULT]"]+	}+}++def installed() {+	logDebug "installed()..."++	initialize()+}++def updated() {+	if (!isDuplicateCommand(state.lastUpdated, 2000)) {+		state.lastUpdated = new Date().time++		logDebug "updated()..."++		initialize()++		runIn(2, executeConfigureCmds)+	}+}++void initialize() {+	if (!device.currentValue("checkInterval")) {+		sendEvent([name: "checkInterval", value: ((60 * 60) + (5 * 60)), displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID, offlinePingable: "1"]])+	}++	sendInitEvent("activeSoundNumber", 0)+	sendInitEvent("soundVolume", 25, "%")	+	sendInitEvent("chimeSound", "1")+	sendInitEvent("chimeVolume", 50, "%")+	sendInitEvent("sirenSound", "13")+	sendInitEvent("sirenVolume", 100, "%")++	state.debugLoggingEnabled = (safeToInt(settings?.debugOutput, 1) != 0)+}++void sendInitEvent(String name, value, String unit="") {+	if (device.currentValue(name) == null) {+		sendEventIfNew(name, value, unit)+	}+}++def configure() {+	logDebug "configure()..."++	executeConfigureCmds()++	runIn(15, refresh)+}++void executeConfigureCmds() {+	List<String> cmds = []+	+	if (!device.currentValue("battery")) {+		cmds << batteryGetCmd()+	}+		+	if (!device.currentValue("switch")) {+		cmds << soundSwitchTonePlayGetCmd()+	}++	configParams.each { param ->+		if (param.value != null) {+			Integer storedVal = getParamStoredValue(param.num)+			if (storedVal != param.value) {+				logDebug "Changing ${param.name}(#${param.num}) from ${storedVal} to ${param.value}"+				cmds << secureCmd(zwave.configurationV1.configurationSet(parameterNumber: param.num, size: param.size, scaledConfigurationValue: param.value))+				cmds << secureCmd(zwave.configurationV1.configurationGet(parameterNumber: param.num))+			}+		}+	}+	sendCommands(cmds)+}++def ping() {+	logDebug "ping()..."+	return [ batteryGetCmd() ]+}++def setChimeVolume(chimeVolume) {+	sendEventIfNew("chimeVolume", chimeVolume, "%")+}++def setChimeSound(chimeSound) {+	sendEventIfNew("chimeSound", chimeSound)+}++def chime() {+	logDebug "chime()..."++	int volume = safeToInt(device.currentValue("chimeVolume"), 50)+	int sound = safeToInt(device.currentValue("chimeSound"), 1)++	state.pendingAction = "chime"+	playSoundAtVolume(sound, volume)+}++def setSoundVolume(soundVolume) {+	sendEventIfNew("soundVolume", soundVolume, "%")+}++def playSound(soundNumber) {+	logDebug "playSound(${soundNumber})..."++	int volume = safeToInt(device.currentValue("soundVolume"), 25)+	int sound = safeToInt(soundNumber, 1)++	state.pendingAction = soundNumber+	playSoundAtVolume(sound, volume)+}++def setSirenVolume(sirenVolume) {+	sendEventIfNew("sirenVolume", sirenVolume, "%")+}++def setSirenSound(sirenSound) {+	sendEventIfNew("sirenSound", sirenSound)+}++def both() {+	siren()+}++def strobe() {+	siren()+}++def siren() {+	logDebug "siren()..."++	int volume = safeToInt(device.currentValue("sirenVolume"), 100)+	int sound = safeToInt(device.currentValue("sirenSound"), 13)++	state.pendingAction = "siren"+	playSoundAtVolume(sound, volume)+}++void playSoundAtVolume(soundNumber, volume) {+	logDebug "playSoundAtVolume(${soundNumber}, ${volume})..."++	Map sound = getSound(soundNumber)+	state.lastSound = sound+	+	logDebug "Playing '${sound.name}' at ${volume}%..."++	List<String> cmds = [+		soundSwitchConfigSetCmd(volume, 1)+	]++	if (sound.indicatorID) {+		cmds << secureCmd(zwave.indicatorV1.indicatorSet(value: sound.indicatorID))+	} else {+		cmds << soundSwitchTonePlaySetCmd(soundNumber)+	}++	cmds << soundSwitchTonePlayGetCmd()++	sendCommands(cmds, 100)+}++def on() {+	chime()+}++def off() {+	logDebug "off()..."+	return delayBetween([+		soundSwitchTonePlaySetCmd(0),+		soundSwitchTonePlayGetCmd()+	])+}++def refresh() {+	logDebug "refresh()..."+	sendCommands([+		batteryGetCmd(),+		secureCmd(zwave.versionV1.versionGet()),+		soundSwitchTonePlayGetCmd()+	])+}++void sendCommands(List<String> cmds, Integer delay=1000) {+	if (cmds) {+		def actions = []+		cmds.each {+			actions << new physicalgraph.device.HubAction(it)+		}+		sendHubCommand(actions, delay)+	}+}++String batteryGetCmd() {+	return secureCmd(zwave.batteryV1.batteryGet())+}++String secureCmd(cmd) {+	try {+		if (isSecurityEnabled()) {+			return zwave.securityV1.securityMessageEncapsulation().encapsulate(cmd).format()+		} else {+			return cmd.format()+		}+	} catch (ex) {+		return cmd.format()

The line below throws an exception for a virtual device, even though it shouldn't because ? is a null check.

boolean isSecurityEnabled() {
	return zwaveInfo?.zw?.contains("s")
}

I used it as a virtual device a lot while building the presentation, but it's unlikely end users will do that so let me know if you want it removed...

shingchen

comment created time in 3 months

PullRequestReviewEvent