[OBSOLETE] Simple Manual Scenes - Improve Phrases/Routines!

Simple Manual Scenes

##What is this and why would I use it?##
Creating scenes without a lot of custom code seems to be a giant hole in the SmartThings ecosystem. There are phrases which are suppose to act as scenes, and they work ok, unless you want to have devices do different things (or use color bulbs!!). There are multiple scene apps that have been put out already, this isn’t the first, but they all try to do so much (capture state, restore, etc) and only work with varying degrees of success.

This app allows you to create a scene, add devices to it, set the settings for those devices (as granular as you’d like), and then run that scene with a “switch”. There is no on/off, the switch acts more like a button. When you press it, the devices turn to what settings you requested. It’s a virtual switch instead of a virtual button so that it can be used with other apps like scenes and minimotes. This app is designed to work in tandem with phrases, not replace them.


##Current App features##
The app currently only supports controlling switches, but is modular and can easily have other device types added. What other devices would benefit being in this app that isn’t already handled by Phrases?

It will dynamically display options for the switches based on what the device type(s) select indicate. So if you select all color bulbs in a device group, you will have the option to specify the hue and saturation.


##Install instructions##
This app has a Device Type and a Smart App. Download them from the links below and follow the instructions in section two of this post.

Downloads:


##Screen Shots##


##FAQ##
I try to uninstall but I get an error! Why can’t I uninstall your app?
This is due to how SmartThings handles virtual switches created by SmartApps. It is likely one or more of the switches created by this app are being used by another SmartApp. Remove the switch from all other apps and Simple Manual Scenes should uninstall fine.

I deleted a scene or set a scene to inactive but the switch is still there for it, why isn’t it being removed?
This means that another SmartApp is set to use that switch which is preventing it from being removed. Remove the switch from all other apps and next time you change any settings it will be removed.

##Change Log##

  • V1.1 - Created a fix so the app would actually work with phrases and added support for Color Temperature.
  • V1.0 - Initial Release

Thanks to @Mike_Maxwell for the superState app which this GUI was based off of! You can see his work at https://github.com/mikemaxwell.

7 Likes

Very cool! :smile:


1 Like

So the “Simple Manual Scene switch device type” is defined at the link as a smart app, but appears to be a device type.

In any case, attempting to create it in ST as either one generates one or another error.

It is a device type. What error does it give you when you try to publish it as a device type?

Ok! After disappearing for awhile, I have finally updated my app. It now works correctly with phrases and now it will work with the official LIFX device type. As the new device type has Color Temperature as an option that has been added too. Though as a reminder, if you mix two switches that don’t have the same properties, only properties shared by all will show. (i.e. if you mix LIFX and Hue bulbs, you will not see the Color Temperature option)

In my setup I have multiple scenes setup that are controlled by both my mini remotes and by phrases and everything has been working wonderfully.

@noname4444, dude at the least an @mention would have been appropriate given quite a bit of this code is a direct cut and paste from my superState app.
I know this stuff is open source, but really???

2 Likes

Sorry. There is very little actual copy and paste in the code from superState, but I did use it to learn how to make dynamic menus. I also built upon and enhanced a lot of it, including removing scenes and deleting children. There didn’t seem to be an app that let users manually setup scenes, so I created one for myself and figured I’d share it. shrugs

Would I @mention yourself or would I point to your thread? I’m not exactly very active in these forums and don’t know all the etiquette.

Simple shoutout to Mike Maxwell would suffice in comments around the code your borrowed :smile:

// Thanks to Mike Maxwell! https://github.com/mikemaxwell

Something like that would do :smile:

1 Like

Done! In both the code header block and the initial post.

2 Likes

Appreciated, thanks.

This is a fantastic app. Thank you!

1 Like

I was hoping that this app would do what I needed to setup various states for groups of devices (things), but unfortunately it just crashes.

Installed, no problem there.
Setup the first scene. Looked good so far.
Go to listing of “things” and app crashes on Android.

Re-launch, go to the room which has the new device, and again crashes.

Shame, seemed like this app might be what I needed.

I’m open to suggestions on how to make it more stable or willing to offer any further debugging.

Hmm… what type of lights do you have? I currently have LIFX and Philips Hue, so that’s what it’s been tested with. I’m wondering if my code isn’t handling a device type properly that I haven’t tested.

Could you open the Live Logging page and then try setting up your scene? I’m curious if there are any useful log messages when the app crashes.

These are “OSRAM LIGHTIFY RT Tunable White bulbs”, using the “ZigBee White Color Temperature Bulb” device type.

I also have “OSRAM LIGHTIFY RT RGBW” bulbs that I want to use in other scenes that are using the “ZigBee RGBW Bulb” device type, but I haven’t gotten that far since the first scene crashes the app.

Here are the logs (following the same procedures I outlined above):

a570342c-5da7-4da1-be07-142fc0b79b21 7:58:38 AM: trace NON-HUE EVENT devicetype:04, mac:00178824D275, networkAddress:C0A80149, deviceAddress:0050, stringCount:04, ssdpPath:/description.xml, ssdpUSN:uuid:2f402f80-da50-11e1-9b23-00178824d275::upnp:rootdevice, ssdpTerm:, ssdpNTS:ssdp:alive
a570342c-5da7-4da1-be07-142fc0b79b21 7:58:38 AM: trace Location: devicetype:04, mac:00178824D275, networkAddress:C0A80149, deviceAddress:0050, stringCount:04, ssdpPath:/description.xml, ssdpUSN:uuid:2f402f80-da50-11e1-9b23-00178824d275::upnp:rootdevice, ssdpTerm:, ssdpNTS:ssdp:alive
308378a4-894c-44b5-8f26-3f4649643615 7:58:34 AM: info [type:switch, name:switch, value:off]
308378a4-894c-44b5-8f26-3f4649643615 7:58:34 AM: debug description is on/off: 0
8cf84043-9fc1-4cfe-8877-513def38e305 7:58:32 AM: info [type:switch, name:switch, value:off]
8cf84043-9fc1-4cfe-8877-513def38e305 7:58:32 AM: debug description is on/off: 0
308378a4-894c-44b5-8f26-3f4649643615 7:58:01 AM: info [name:switch, value:off, type:switch]
308378a4-894c-44b5-8f26-3f4649643615 7:58:01 AM: debug description is catchall: 0104 0006 03 01 0000 00 ACEE 00 00 0000 0B 01 0000
8cf84043-9fc1-4cfe-8877-513def38e305 7:58:01 AM: info [name:switch, value:off, type:switch]
8cf84043-9fc1-4cfe-8877-513def38e305 7:58:01 AM: debug description is catchall: 0104 0006 03 01 0000 00 49B5 00 00 0000 0B 01 0000
46c3d88f-c7b1-4b27-a0c6-dc4c234896b2 7:58:01 AM: debug Processing device OSRAM LIGHTIFY LED Recessed Kit RT 5/6 Tunable White
46c3d88f-c7b1-4b27-a0c6-dc4c234896b2 7:58:01 AM: debug Processing device OSRAM LIGHTIFY LED Recessed Kit RT 5/6 Tunable White
46c3d88f-c7b1-4b27-a0c6-dc4c234896b2 7:58:01 AM: debug Simple Manual Scene: Switch pressed! s1
6178d8e4-808c-4baa-bec1-5acada29cb81 7:58:00 AM: debug Simple Manual Scene Entry Lights Off:on
9ca87ebf-fab4-4ae9-8d81-6c4400dd0de7 7:57:44 AM: debug summaryData: [[icon:indicator-dot-gray, iconColor:#878787, value:Disarmed], [icon:indicator-dot-green, iconColor:#79b821, value:Everything OK]] - [[icon:indicator-dot-gray, value:Disarmed, iconColor:#878787], [icon:indicator-dot-green, value:Everything OK, iconColor:#79b821]]
46c3d88f-c7b1-4b27-a0c6-dc4c234896b2 7:57:25 AM: debug I am adding a device for scene s1
46c3d88f-c7b1-4b27-a0c6-dc4c234896b2 7:57:25 AM: debug !childList.contains(sceneID): true
46c3d88f-c7b1-4b27-a0c6-dc4c234896b2 7:57:25 AM: debug Child List: []
46c3d88f-c7b1-4b27-a0c6-dc4c234896b2 7:57:25 AM: debug Scene list: [s1]
46c3d88f-c7b1-4b27-a0c6-dc4c234896b2 7:57:25 AM: debug getChildDevices(true), children=0
46c3d88f-c7b1-4b27-a0c6-dc4c234896b2 7:57:25 AM: debug Updated with settings: [s1d1Type:switch, s1d1State:off, s1d1Status:active, s1d1:[Entry Light 1, Entry Light 2], s1:Entry Lights Off, s1Status:active]
6178d8e4-808c-4baa-bec1-5acada29cb81 7:57:25 AM: debug Parsing 'updated’
46c3d88f-c7b1-4b27-a0c6-dc4c234896b2 7:57:24 AM: debug Installed with settings: [s1d1Type:switch, s1d1State:off, s1d1Status:active, s1d1:[Entry Light 1, Entry Light 2], s1:Entry Lights Off, s1Status:active]
46c3d88f-c7b1-4b27-a0c6-dc4c234896b2 7:57:20 AM: debug settings:[s1d1Type:switch, s1d1State:off, s1d1Status:active, s1d1:[Entry Light 1, Entry Light 2], s1:Entry Lights Off, s1Status:active]
46c3d88f-c7b1-4b27-a0c6-dc4c234896b2 7:57:02 AM: debug Settings are dumb: [s1d1Type:switch, s1d1State:off, s1d1Status:active, s1d1:[Entry Light 1, Entry Light 2], s1:Entry Lights Off, s1Status:active]
46c3d88f-c7b1-4b27-a0c6-dc4c234896b2 7:56:54 AM: debug Settings are dumb: [s1d1Type:switch, s1d1:[Entry Light 1, Entry Light 2], s1:Entry Lights Off, s1Status:active]
46c3d88f-c7b1-4b27-a0c6-dc4c234896b2 7:56:49 AM: debug Settings are dumb: [s1d1Type:switch, s1:Entry Lights Off, s1Status:active]
46c3d88f-c7b1-4b27-a0c6-dc4c234896b2 7:56:44 AM: debug Settings are dumb: [s1:Entry Lights Off, s1Status:active]
46c3d88f-c7b1-4b27-a0c6-dc4c234896b2 7:55:50 AM: debug settings:[:]
66848513-fcf2-4415-a830-c0cfaeedd325 7:55:47 AM: debug [name:switch, value:off]
66848513-fcf2-4415-a830-c0cfaeedd325 7:55:47 AM: debug description is on/off: 0
769d5e2e-f868-4d87-9e21-8b0c3c5eef89 7:55:45 AM: debug [name:switch, value:off]
769d5e2e-f868-4d87-9e21-8b0c3c5eef89 7:55:45 AM: debug description is on/off: 0
340c3767-df15-4019-b087-62c408065624 7:55:45 AM: debug [name:switch, value:off]
340c3767-df15-4019-b087-62c408065624 7:55:45 AM: debug description is on/off: 0

Jim, great app, thanks! Quick question.

I’ve successfully created a button that initiates a custom scene.

I’d like to integrate this functionality with my Alexa (Echo) but it doesn’t recognise buttons, only switches and dimmers.

Can your app be designated as a switch rather than a button?

or

Anyone know of a virtual switch that can be triggered by a button?

Hey, thanks again for such a needed ST function!

TAB

So when I first created this tool, I set it up to work off a button (since there was only “on” functionality and not “off”). Then I realized that I couldn’t use it with phrases because they only support switches.

The program is now setup with a virtual switch, which turns “off” as soon as you turn it “on”, after setting the scene of course. Thus, it’s a switch, but it acts like a button and should be able to be used anywhere switches are.

Also, it seems I had messed up the link for the virtual switch device code in the original post. I’ve fixed that link, but here it is as well. https://github.com/noname4444/SmartThingsPublic/blob/master/devicetypes/noname4444/simple-manual-scene-switch.src/simple-manual-scene-switch.groovy

This is exactly what I have been looking for! Thanks!

1 Like

I am having an issue with a scene. I have set the color temperature but it isn’t adjusting to that color. Seems to be using the color from the other lights that I have set in that scene. Any ideas?

Another problem that I am having is that I have created a scene for the basement lights to go on and set certain level, hue, saturation. I have a routine setup to use this scene when motion is detected. All good. However, I have another routine setup to turn off this scene when no motion is detected. This doesn’t seem to work and I think it is because the scene is already off so it doesn’t turn it off. How can i fix this? Any ideas.

The app installed and was working great, until I tried to remove a device from a scene. The app crashed and now I can’t get back into it, I’m getting the exclamation point saying something is wrong and that it cannot load the screen. I installed another instance of the app to verify and the same thing happened. In my log I get a java.lang.NullPointerException error.

The app was a little difficult to uninstall, but once I deleted all the switches I created manually it could be removed in the IDE. I reinstalled and made sure not to try and delete any devices from scenes, and it works fine. Just an FYI for others that might have the same issue.

1 Like