Previous Effect/Next Effect commands for Nanoleaf Aurora

Could you add in the nextEffect and previousEffect commands for Nanoleaf Aurora? I want to be able to assign those commands to the dim up/down buttons on a nano remote.

Below is the relevant commands and code from smartthings custom api. Not sure how it’s different from your internal implementation. Obviously all “scene” needs to be replaced with “effect” but after that…

command "previousScene"
command "nextScene"

def previousScene() {
  	def sceneListString = device.currentValue("scenesList").replaceAll(", ", ",")
  	def sceneList = sceneListString.substring(1, sceneListString.length()-1).tokenize(',')
  	def currentSelectedScene = device.currentValue("scene");
  	def index = sceneList.indexOf(currentSelectedScene)
    	log.debug(index)
  
  	if(index == -1) {
    		index = 1;
  	}
  	
	index--
  	if(index == -1) {
     		index = sceneList.size -1
  	}
	
	changeScene(sceneList[index])
}

def nextScene() {
  	def sceneListString = device.currentValue("scenesList").replaceAll(", ", ",")
  	def sceneList = sceneListString.substring(1, sceneListString.length()-1).tokenize(',')
  	def currentSelectedScene = device.currentValue("scene");
  	def index = sceneList.indexOf(currentSelectedScene)
  
  	index++
    	if(index == sceneList.size) {
     		index = 0
  	}
  	
	changeScene(sceneList[index])
}
1 Like

Any traction on this request? Is there somewhere I could access the built-in driver to modify it to add previousEffect and nextEffect so I can tie them to button presses?

At this point, we have no plans to release our built in drivers. I have noted your request to enhance the driver and as we work through our backlog of feature requests and enhancements we will get to it.

Okay. I’ll just wait [mostly] patiently then. I know you guys are flooded with requests.

1 Like

Please, flood us :slight_smile: we love your feedback, ideas, suggestions, etc. We just can’t do them all at once. I wish we could.

I’ll keep 'em coming, don’t worry. I’m an ideas guy. I just need to work on my java understanding a bit more.

1 Like

Any chance this is going to happen soon? I would really like to have my picos select prev/next scene for my nanoleaf. I got distracted by my 3d printer.

Have you looked at doing this with an app? You should be able to get all of the effects from the device into an app with getEffects(), and then do the next/prev logic there, then calling setEffect(effect).

I haven't. Maybe I'll try it eventually. The prev/next scene was part of the original driver from smartthings as linked above, so I was hoping it could just get added in. I'm not much of a programmer, unfortunately.

Oh, I see. I doubt that our driver is at all similar to the ST driver. I'll look into this a bit...

1 Like

Haha, Mr. Maxwell informs me he's going to add these commands to the Nanoleaf driver.

To use them you'll have to setup custom commands in Rule Machine. Once that's done, then a simple trigger fired by a pico button will do the trick.

Perfect! That's just what I'm looking for.

This feature has been added in latest release: Hub Update 1.1.2

You're a superstar. And by you, I also mean Mr Maxwell. :wink:

1 Like

This is all on Maxwell --- blame him! :sunglasses:

@mike.maxwell I'm happy to have the commands added but they don't work. :wink: Next/previous effect just selects the current effect, until I manually change the effect, then I get the following error:
dev:512018-08-01 17:41:47.329:errorjava.lang.NumberFormatException: For input string: "Streaking Notes" (setNextEffect)

can you send a screen shot of the driver state details after you hit getEffects?

State variables is as follows, if you need something different let me know where to find it. :slight_smile:

1 Like