SmartApp that triggers scenes

Hi!
Is it possible to build a SmartApp that will execute a scene that the user as defines instead of turning on/off device/s?

Thanks,
Shahar

Can you be more specific? ST does more than turn things on and off out of the box.

@RVoodoo Thanks for the quick response!
I’m sorry I’ve mixed it up with scenes.
Let’s say I’ve defined a scene that turn on all the lights in the house, sets them to green and sets the volume to 30 in all my Sonos speakers at home.
I want to build a SmartApp that once I’m triggering a motion sensor it will run this automation, is that possible?

Yes, which app are you using?

In the new app you would use an automation… motion on the sensor would be the trigger, and the action would be to fire off the scene.

Like @RVoodoo said, yup! Assuming you’re using the new ST app (not Classic), then this is easily done with an Automation. You can have your motion sensor as part of an IF condition, and the THEN could be anything from running a Scene, changing your security mode, notifying people, etc. Ihave several Automations that kick off Scenes.

Hi guys,
I don’t understand. I am working on the new SmartThings app.
What i’m trying to do is to have a section, with an input of a scene and not a device, is that possible?

Thanks.

Automation

IF
Motion sensor detected movement
THEN
Run Scene X

I believe I understand the question you are asking. You would like to create a custom SmartApp that prompts for the name of a scene in the same way you can use an ‘input’ statement to ask for a device. Then, presumably, you would like to be able to activate that scene too. It is something Smart Lighting can do, but that is, of course, an official SmartApp created by the SmartThings developers that may run in a different security context that gives it access more things. Or it may simply be that they know how to do it and we don’t, and they aren’t telling. Or both.

As far as I am aware, it is not possible to work with scenes in a custom SmartApp in that way. If it is possible, the way to do it has never been documented, has not leaked out, and no one has worked out how it is done.


It’s an Automation

Hello everyone,

You could aboard this from different ways, below are ordered according to their complexity from less to more:

  1. Using the mobile app automations (as suggested above and no development involved)
  2. Create an automation using the Rules API
  3. Create a custom SmartApp to execute scenes. You can refer to this sample and the post of a simple smartapp sample

Last I heard, the Rules API can’t execute a scene. Has that changed? Any documentation?

Hello @Automated_House,

No, you are right, the feature to execute scenes from Rules API is not available yet, but they can help you to execute other commands when an event happens (example: motion capability status changed to active).

I know this is from quite some time ago, but has there been any progress of the inclusion of scene execution from the Rules API?
I’ve been unable to find any concrete evidence one way or another.

Sure, in YAML terms you would see

      then:
        - scene:
            scenes:
              - {{sceneId}}
              - {{sceneId}}

Or in old money that’s

    "then": [
        {
            "scene": {
                "scenes": [
                    "{{sceneId}}",
                    "{{sceneId}}"
                ]
            }
        }
    ]

Here {{something}} represents a UUID.

2 Likes

Fantastic thanks!
I was surprised that I couldn’t find any documentation that seemed to mention it

There was a time when the developer documentation mentioned in passing that it could be done, but that is the most we’ve ever had. It has largely been left to the community to figure things out and whisper quietly between themselves, but with the increase in interest in Rules and the API in general, the whispering quietly bit has necessarily had to become a thing of the past.