Improved UI for Aeon Minimote

dth_remotes
minimote

(Jared Fisher) #33

Curious to those who have been active lately in the smart things programming community. Are there any new features Smart Things now provides I need to incorporate into this device handler?


(Steve Jackson) #34

I just installed your DH. Great work. I love it. ST should make it the default.

Thank you for sharing your work!
Steve


(Hans Bouwmeester) #36

Works great! Thanks!


(Dana ) #37

Thanks for this, nice to have!


(elite) #38

Hopefully I can get some help, I know enough to be dangerous. I am kind new when it comes to modifying the IDE. I always confuse device Handler vs Smartapp. Here is what I would like to use my minimote for . I simply want to set lights to X perfect and use a long press to torn off so I can assign the few bottons to a few more lights. I Installed the above Minimote device type. What Smartapp am I supposed to be using? I tried following the handler with Kyles Smartapp but IDK what I am doing, Can someone assist me with what handler and app go together? Or, am I on the wrong track?


#39

A Device Handler is basically a device driver that tells the SmartThings hub how to communicate to the device that is connected to it. In this case, it’s the Aeon Minimote. This updated DH provides additional ability to virtually click on the buttons of your remote via the SmartThings app.

But now that you have it installed, you’ll want to program the buttons to do something when pressed or held. This is where Smart apps come into play, these are programs that tell the SmartThings hub what to do when that button is pressed. There may be several types of Smart apps to accomplish what you want done. One excellent app and easy to use app is one that I use called Button Controller + which you can find here:

For more advance capabilities and features, you may want to look at CoRE which is found here:


#40

Hey everyone… TOTALLY new to all of this custom Device Handler and SmartApps stuff… I’m having issues with this specific code and creating a smartapp “From Code.” I’m following a tutorial on this from another thread in the forum and when I go to create the smartapp, I get a “no signature of method” error. Is there something wrong? Am I missing something? I was looking for comments in the code in case there was a specific parameter I needed to configure but I couldn’t find/see anything.

Any help is appreciated. I’d love for a custom device handler/UI for my minimote. I have no idea what this means… I have no coding background, experience, or understanding. Tried googling it and still now helpful information.

Full error message:

No signature of method: script14891072255591942016194.metadata() is applicable for argument types: (script14891072255591942016194$_run_closure1) values: [script14891072255591942016194$_run_closure1@30fd5372] Possible solutions: getMetadata(), getState(), setState(java.lang.Object), metaClass(groovy.lang.Closure)

Thanks in advance!

–Jon


(Don) #41

I believe this is a device type not a smart app. Remove the smart app and create it as a new device type.


(Don) #42

The post above yours tells you the difference.

The device type is what the origin al.post is about. It helps the minimize talk to smart things. The post above yours by @Jimxenus also links to the smart app that will let you assign functions to your minimize buttons.

So it takes 2 separate installs. The device type, and the smart app.

Hope that helps.


#43

Hey guys, my apologies. And sorry for the late response.

Even after reading those descriptions regarding the differences, I still didn’t understand it, apparently. Nonetheless, I got things working and it actually opened me up to a lot more stuff which is cool.

So, thanks for telling me I’m wrong and helping me correct my problem and understanding. :slight_smile:

I appreciate the help all around. Thanks again!


( Cosmo) #44

Resurrecting this thread.

This is the perfect DH to use as a manual Hub mode changer.

Once and a while my hub location mode doesn’t change properly, and I don’t want to re-trigger a routine that will change the mode, so this DH is perfect. I just assigned mode names to all the press/hold buttons I needed, and mapped button 1 press, button 1 hold, button 2 press, etc to “Location: Change location mode” in Webcore.
This way I can manually sync up the hub mode in case it failed to switch, specifically for which mode I want to set all in one clean and easy to access place.

All that said, I’d love to customize the DTH tile page a bit. I have VERY limited experience with modifying labels and colors, otherwise I don’t mess around much with the code.
How could I, or could someone maybe mod the code to make some stuff display a bit different? First step would be to convert tile page from a list +next to individual tiles.
But, help I could use. Or a favor to knock this out in quick order if you know what you’re doing

What I want to do is make a main tile that shows the current mode rather than having to switch to the “more” hamburger tab in the app. Then make one single text tile, and put all the buttons in a 3x wide format.
Essentially to make it emulate the look of the Iris/Centralite keypad but just this button controller. Also on the main Devices list, lave it show the current hub mode.

Considering there is NO manual mode change DH or SA, this modification would serve a niche purpose, but I think would be widely accepted.

Some pictures to illustrate concept.
What I’ve currently done:

How I want it to look/function for this use case:

Based on the IRIS/Centralite Keypad display layout/concept. The DTH is in post 1 of the linked thread.

Thanks!


Guys, I could use some help moding a DTH tile page
#45

@Kyse

Many thanks for this handler and SmartApp. I have been playing with the handler and I’m trying to resolve a small issue and wondering if you may be able to help.

To get buttons displayed (your handler no longer displayed buttons on iOS) I changed the tiles from valueTile to standardTile. Now when I tap a button the label changes from whatever I have set to PUSH# (or HOLD#). The label remains that way until I force a refresh. Any idea how to retain the set label for a standardTile or at least return to it without needing to manually refresh?

I’ll keep working on it but just wanted to see if you could offer any suggestions.

Thanks.


#46

Since I’m dependent on text to speech, I can’t read the code. Has anyone checked this DTH to see if it was updated for the number of buttons field change?


#47

JD, since copying down the code I have just been using my version which is working fine. I can’t, therefore, comment on how the original code is but I am sure it’s fine.

Note, this is just the DTH that simulates the Minimote in the ST app. To define the actual functions for each button press/hold Kyse has a SmartApp …

I am using this one very slightly modified and it works.


( Cosmo) #48

@Kyse
Where are you? Bat signal, we need your help


(Jared Fisher) #49

What do you need? Pretty busy atm with work sadly.


( Cosmo) #50

I know you’re busy. If you have time I’d appreciate any insight. But if you don’t have time, totally understand!!

How do you modify this DH slightly to display tiles individually rather than as a populating (list 1-4)

Meaning in display, one could display the tiles in order 1-8 without the first vertical column.

I can mod display orders, colors and labels on my own, I’ve just never worked with a DH that puts them as

Button ( ) press
Button ( ) held
There it populates like you have it from a list. See my post above.

Forget about all the stuff in this post about importing status of SHM, or non related tiles. I’ve got that covered. I just need to know how to list all the buttons individually rather than list populateing the tiles


(Jared Fisher) #51

Honestly, I learned everything I did from examples or documentation. I’d imagine they have a documentation somewhere related to layouts. I’d start by trying to research that. Last time I looked at it you were limited on what kind of layouts you could add, so I just made do with what was available. Perhaps things have changed, so probably worth your time to look into design layouts.


#52

I think I can probably handle this. I’ve been giving some thought on doing something similar as it may actually solve some issues I’ve had with other mods to this DH.

I can’t promise anything quick but if I do it I will post back.


#53

Okay, this version moves away from using a list to display the buttons so each tile is defined individually. I still have the first column displayed but hopefully you can take what you want from this.

Caveat: I am not a developer so I could well have made gaffs however it seems to be working for me.

/*
 *
 *  Modified by: Nezmo
 *  Modified and extended from SmartThings Kyse Aeon Minimote Device Handler Template.
 *  Changed to move away from using a list to display buttons.
 *
 *  Copyright 2015 SmartThings
 *
 *  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.
 *
 */

metadata {
	definition (name: "Nezmo's Aeon Minimote", namespace: "Nezmo68", author: "Nezmo") {
		capability "Actuator"
		capability "Button"
		capability "Configuration"
		capability "Sensor"
        
		attribute "numButtons", "STRING"
        
        // Virtual Button Attributes for defining button labels.
        attribute "lblPush1", "STRING"
        attribute "lblHold1", "STRING"
        attribute "lblPush2", "STRING"
        attribute "lblHold2", "STRING"
        attribute "lblPush3", "STRING"
        attribute "lblHold3", "STRING"
        attribute "lblPush4", "STRING"
        attribute "lblHold4", "STRING"
        
		command "pushed"
        command "held"
        command "pushed", [int]
        command "held", [int]
        command "push1"
        command "hold1"
        command "push2"
        command "hold2"
        command "push3"
        command "hold3"
        command "push4"
        command "hold4"

		fingerprint deviceId: "0x0101", inClusters: "0x86,0x72,0x70,0x9B", outClusters: "0x26,0x2B"
		fingerprint deviceId: "0x0101", inClusters: "0x86,0x72,0x70,0x9B,0x85,0x84", outClusters: "0x26" // old style with numbered buttons
	}

	simulator {
		status "pushed 1":  "command: 2001, payload: 01"
		status "held 1":  "command: 2001, payload: 15"
		status "pushed 2":  "command: 2001, payload: 29"
		status "held 2":  "command: 2001, payload: 3D"
		status "pushed 3":  "command: 2001, payload: 51"
		status "held 3":  "command: 2001, payload: 65"
		status "pushed 4":  "command: 2001, payload: 79"
		status "held 4":  "command: 2001, payload: 8D"
		status "wakeup":  "command: 8407, payload: "
	}
    
    preferences {
    	section ("Labels") {
            input("lblPush1", "text", title: "Label for Button 1 Push?", required: true, displayDuringSetup: true, defaultValue: "Push 1", description: "Label for the first push button.")  
            input("lblHold1", "text", title: "Label for Button 1 Hold?", required: true, displayDuringSetup: true, defaultValue: "Hold 1", description: "Label for the first hold button.")  
            input("lblPush2", "text", title: "Label for Button 2 Push?", required: true, displayDuringSetup: true, defaultValue: "Push 2", description: "Label for the second push button.")  
            input("lblHold2", "text", title: "Label for Button 2 Hold?", required: true, displayDuringSetup: true, defaultValue: "Hold 2", description: "Label for the second hold button.")  
            input("lblPush3", "text", title: "Label for Button 3 Push?", required: true, displayDuringSetup: true, defaultValue: "Push 3", description: "Label for the third push button.")  
            input("lblHold3", "text", title: "Label for Button 3 Hold?", required: true, displayDuringSetup: true, defaultValue: "Hold 3", description: "Label for the third hold button.")  
            input("lblPush4", "text", title: "Label for Button 4 Push?", required: true, displayDuringSetup: true, defaultValue: "Push 4", description: "Label for the fourth push button.")  
            input("lblHold4", "text", title: "Label for Button 4 Hold?", required: true, displayDuringSetup: true, defaultValue: "Hold 4", description: "Label for the fourth hold button.")  
        }
    }

	tiles (scale: 2) { 
            standardTile("Button 1", "device.button", width: 2, height: 2) {
            	state("default", label: "Button 1", defaultState: true, backgroundColor: "#ffffff", icon: "https://raw.githubusercontent.com/Nezmo68/SmartThingsPublic/master/Minimote.png", canChangeIcon: true, canChangeBackground: true)
            }
            valueTile("Push 1", "device.lblPush${1}", width: 2, height: 2, decoration: "flat") {
				state("default", label: '${currentValue}', action: "push${1}", defaultState: true, backgroundColor: "#33cc33", canChangeBackground: true)
            }
            valueTile("Hold 1", "device.lblHold${1}", width: 2, height: 2, decoration: "flat") {
            	state("default", label: '${currentValue}', action: "hold${1}", defaultState: true, backgroundColor: "#00a0dc", canChangeBackground: true) 
            }
            standardTile("Button 2", "device.button", width: 2, height: 2) {
            	state("default", label: "Button 2", defaultState: true, backgroundColor: "#ffffff", icon: "https://raw.githubusercontent.com/Nezmo68/SmartThingsPublic/master/Minimote.png", canChangeIcon: true, canChangeBackground: true)
            }
            valueTile("Push 2", "device.lblPush${2}", width: 2, height: 2, decoration: "flat") {
				state("default", label: '${currentValue}', action: "push${2}", defaultState: true, backgroundColor: "#33cc33", canChangeBackground: true)
            }
            valueTile("Held 2", "device.lblHold${2}", width: 2, height: 2, decoration: "flat") {
            	state("default", label: '${currentValue}', action: "hold${2}", defaultState: true, backgroundColor: "#00a0dc", canChangeBackground: true) 
            }
            standardTile("Button 3" ,"device.button", width: 2, height: 2) {
            	state("default", label: "Button 3", defaultState: true, backgroundColor: "#ffffff", icon: "https://raw.githubusercontent.com/Nezmo68/SmartThingsPublic/master/Minimote.png", canChangeIcon: true, canChangeBackground: true)
            }
            valueTile("Push 3", "device.lblPush${3}", width: 2, height: 2, decoration: "flat") {
				state("default", label: '${currentValue}', action: "push${3}", defaultState: true, backgroundColor: "#33cc33", canChangeBackground: true)
            }
            valueTile("Held 3", "device.lblHold${3}", width: 2, height: 2, decoration: "flat") {
            	state("default", label: '${currentValue}', action: "hold${3}", defaultState: true, backgroundColor: "#00a0dc", canChangeBackground: true) 
            }
            standardTile("Button 4", "device.button", width: 2, height: 2) {
            	state("default", label: "Button 4", defaultState: true, backgroundColor: "#ffffff", icon: "https://raw.githubusercontent.com/Nezmo68/SmartThingsPublic/master/Minimote.png", canChangeIcon: true, canChangeBackground: true)
            }
            valueTile("Push 4", "device.lblPush${4}", width: 2, height: 2, decoration: "flat") {
				state("default", label: '${currentValue}', action: "push${4}", defaultState: true, backgroundColor: "#33cc33", canChangeBackground: true)
            }
            valueTile("Held 4", "device.lblHold${4}", width: 2, height: 2, decoration: "flat") {
            	state("default", label: '${currentValue}', action: "hold${4}", defaultState: true, backgroundColor: "#00a0dc", canChangeBackground: true) 
            }
        }
    	standardTile("configure", "device.configure", inactiveLabel: false, decoration: "flat") {
      		state "configure", label: '', action:"configuration.configure", icon:"st.secondary.configure"
    	}
}

def installed() {
initLabels()
}

def updated() {
	initLabels()
}

def initLabels() {
    (1..4).each { button ->
    	["Push","Hold"].each { action ->
           	def descriptionText = "Updating button ${button} ${action}"
            def settingName = "lbl${action}${button}"
            log.debug descriptionText + ": ${settings[settingName]}"
			sendEvent(name: "lbl${action}${button}", value: "${settings[settingName]}", descriptionText: descriptionText, isStateChange: true, displayed: false)
		}
    }
}

def parse(String description) {
	def results = []
	if (description.startsWith("Err")) {
	    results = createEvent(descriptionText:description, displayed:true)
	} else {
		def cmd = zwave.parse(description, [0x2B: 1, 0x80: 1, 0x84: 1])
    	if(cmd) results += zwaveEvent(cmd)
		if(!results) results = [ descriptionText: cmd, displayed: false ]
	}
	//log.debug("Parsed '$description' to $results")
	return results
}

def zwaveEvent(physicalgraph.zwave.commands.wakeupv1.WakeUpNotification cmd) {
	def results = [createEvent(descriptionText: "$device.displayName woke up", isStateChange: false)]
    
    results += configurationCmds().collect{ response(it) }
	results << response(zwave.wakeUpV1.wakeUpNoMoreInformation().format())

	return results
}

def buttonEvent(button, held) {
	// Leaving value as pushed or held to stay compatible with Button Controller Smart App for now.
	button = button as Integer
	if (held) {
		createEvent(name: "button", value: "held", data: [buttonNumber: button, action: (held ? "held" : "pushed")], source: "DEVICE", descriptionText: "$device.displayName button $button was held", isStateChange: true)
	} else {
		createEvent(name: "button", value: "pushed", data: [buttonNumber: button, action: (held ? "held" : "pushed")], source: "DEVICE", descriptionText: "$device.displayName button $button was pushed", isStateChange: true)
	}
}

def zwaveEvent(physicalgraph.zwave.commands.sceneactivationv1.SceneActivationSet cmd) {
	Integer button = ((cmd.sceneId + 1) / 2) as Integer
	Boolean held = !(cmd.sceneId % 2)
	buttonEvent(button, held)
}

def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicSet cmd) {
	Integer button = (cmd.value / 40 + 1) as Integer
	Boolean held = (button * 40 - cmd.value) <= 20
	buttonEvent(button, held)
}

def zwaveEvent(physicalgraph.zwave.Command cmd) {
	[ descriptionText: "$device.displayName: $cmd", linkText:device.displayName, displayed: false ]
}

def configurationCmds() {
	def cmds = []
	def hubId = zwaveHubNodeId
	(1..4).each { button ->
		cmds << zwave.configurationV1.configurationSet(parameterNumber: 240+button, scaledConfigurationValue: 1).format()
	}
	(1..4).each { button ->
		cmds << zwave.configurationV1.configurationSet(parameterNumber: (button-1)*40, configurationValue: [hubId, (button-1)*40 + 1, 0, 0]).format()
		cmds << zwave.configurationV1.configurationSet(parameterNumber: (button-1)*40 + 20, configurationValue: [hubId, (button-1)*40 + 21, 0, 0]).format()
	}
	cmds
}

def configure() {
	// Set the number of buttons to 4
	sendEvent(name: "numButtons", value: "4", displayed: false)

	def cmds = configurationCmds()
	//log.debug("Sending configuration: $cmds")
	return cmds
}

def push1() {
	pushed(1)
}

def push2() {
	pushed(2)
}

def push3() {
	pushed(3)
}

def push4() {
	pushed(4)
}

def pushed(button) {
	sendEvent(name: "button", value: "pushed", data: [buttonNumber: button, action: "pushed"], source: "COMMAND", descriptionText: "$device.displayName button $button was pushed", isStateChange: true)
}

def hold1() {
	held(1)
}

def hold2() {
	held(2)
}

def hold3() {
	held(3)
}

def hold4() {
	held(4)
}

def held(button) {
    sendEvent(name: "button", value: "held", data: [buttonNumber: button, action: "held"], source: "COMMAND", descriptionText: "$device.displayName button $button was held", isStateChange: true)
}

Mode Switch device/app