Help combining three shades as one

I have three shades in the same room. I would like to create a device that controls all three shades as if they are one. I have experimented with scenes, groups, and rules but can't seem to get it right. Can someone give me some pointers? Thanks.

How do you want to control them?

Thanks for responding. I was trying to get it to work with a virtual shade device. I am using Sharptools and I want it to show as a shade. Then when I select Open or Close it works on all three shades?

1 Like

It's a simple little Groovy app. Give me a few minutes, will post it for you. You can either use a virtual shade as the controller, or one of the three.

1 Like
definition(
	name: "Shade Control",
	namespace: "hubitat",
	author: "Bruce Ravenel",
	description: "Multi-shade control",
	category: "Convenience",
	iconUrl: "",
	iconX2Url: ""
)

preferences {
	page(name: "mainPage")
}

def mainPage() {
	dynamicPage(name: "mainPage", title: "Multi-Shade Controller", uninstall: true, install: true) {
		section {
			input "master", "capability.windowShade", title: "Select control shade", submitOnChange: true
			input "shades", "capability.windowShade", title: "Select shades to control", submitOnChange: true, multiple: true
		}
	}
}

def updated() {
	unsubscribe()
	initialize()
}

def installed() {
	initialize()
}

void initialize() {
	subscribe(master, "windowShade", "handler")
	subscribe(master, "position", "phandler")
}

def handler(evt) {
	log.info "$evt.name:$evt.value"
	switch(evt.value) {
		case "opening": shades.open(); break
		case "closing": shades.close(); break
	}
}

def phandler(evt) {
	log.info "$evt.name:$evt.value"
	shades.setPosition(evt.value)
}
6 Likes

Hijacking because this is exactly what I was looking for. Thanks for sharing!

Coming from SmartThings, I used an app called "Shady" where it would auto-create a virtual device with selected shades to group. [Release] Shady - Group your shades & blinds and control as a single device - Community Created SmartApps - SmartThings Community

I tried your app, created a virtual shade, and am running into some strange issues with "position." I'm using the generic Z-Wave Shade Device with Bali/Graber/Springs shades.

If I set position 0-100 on the actual shade device, it will act as a 0-100% position closed-to-open (so position 50 would be half-way open). If I set the virtual device to position 20, it fully opened/raised my shades. Thinking it was just an error, I then set to position 10 and it fully closed the shades. Any thoughts on what I may have done wrong?

Thanks!

Thanks. I just got around to installing this, although I am remote at present. It says it is raising and lowering the shades, and I am sure it is, but will confirm when I get home!

1 Like

Okay, that counts as really brave. Hope it worked out well!

One small thing that I found when I went searching for control mechanisms for a group of shades and found @bravenel's code...

I kept getting a null when trying to set position, and then my former engineer brain kicked in and I realized that Bruce accidentally forgot to cast the value in 'phandler' to an Integer:

shades.setPosition((evt.value as Integer))

I know, a small thing, but I turned to my wife and said 'I may be a manager now, but I still know how to debug'. :laughing:

1 Like