Is this automation possible in new app?

I currrently use the classic app for all automations but trying to migrate to new app. I’m having trouble trying to figure out how to write this automation to combine an ‘OR’. As well as an ‘AND’ statement like this…

If ((motion detector 1 detects motion) OR ( motion detector 2 detects motion)) AND ( status = Away)
THEN do this action.

Seems like I can only do a bunch of OR statements or a bunch of AND statements but can’t combine them or am I missing something?

You’re not missing a thing. You can’t mix between the two. Either all ands or all ors. You can can go the webcore route for complex rules if you want.

1 Like

Perhaps I’m just reiterating what people have been complaining about for some time. That seems so fundamentally odd that the app can’t do that. This new app has been around for so long and it looks fantastic but why would anyone move to it if it has foundational issues.

Is there a roadmap for features in development somewhere?

No roadmaps.

They are adding a new rules API which will be sort of like an official web core, but so far it looks very complicated to me.

1 Like

Also, You should be able to daisychain this. To turn the “or’s” into a result which you can use with the and.

Create a virtual device which is both a sensor and a switch. That way when you turn the switch on, the sensor will look like it is open and when you turn the switch off the sensor will look like it is closed.

Set up an automation so that either of your two sensors turning on turns that switch on, which will make that sensor look open.

Then use your regular automation which combines Geopresence with the virtual sensor being open.

1 Like

Smart Lighting has been my go to for various ‘smarter’ new app Automations. If your ‘action’ is to turn on/off a device then it could work for your situation. In your example for motion, then Smart Lighting can also turn on/off the device X minutes after the motion has stopped/started.

In fact, Smart Lighting has a lot of features since you can even activate ‘scenes’ instead of just devices, and the ‘triggers’ cover a lot of options.

1 Like

This is precisely the point I was making… the concessions I’d have to make to transition from the classic app to the new is are somewhat laughable. It’s not like the thing was released in the last few months. I think the new app has been out there 2+ years. In this smart device market where customer experience is the single driving force, Samsung is really dropping the ball…

1 Like

You can use Smart Lighting for that exact scenario. Use the motion sensors to turn on the light and in the options section set the mode(s) as the condition. Simple!

Hello, @flgator

Try next json code using the new rules API.

{
  "name": "If motion => Light OFF",
     "actions": [{
        "if": {
          "equals": {
	         "left": {
	    	     "device": {
	        	      "devices": [ "YOUR_MOTION_DEVICE_ID" ],
							"component": "main",
							"capability": "motionSensor",
							"attribute": "motion"
		         }
			  },
			  "right": {
			    "string": "activate"
              }
	      },
	    "then": [{
          "command": {
            "devices": ["LIGHT_DEVICE-ID"],
            "commands": [{
              "component": "main",
              "capability": "switch",
              "command": "on",
              "arguments": []
            }]
          }
	    }, 
        {
          "sleep": {
            "duration": {
              "value": {
                "integer": 3
              },
              "unit": "Minute"
            }
          }
        },
        {
          "command": {
            "devices": ["LIGHT_DEVICE_ID"],
            "commands": [{
              "component": "main",
              "capability": "switch",
              "command": "off",
              "arguments": []
            }]
          }
        }],
		"else": []
			}
		}
	]
}

@erickv What are you using to create your JSON, or are you freestyling it with a text editor?

I’ve watched the panels from SDC and am intrigued. I think almost all of my rules can be duplicated with what’s currently available in RULES.API

Im freestyling it as you mention, accordingly to the documentation of course. I’m not sure if in the future there will be release of a proper UI for the Rules SPI so they can be generated easier.

1 Like

If you’re feeling adventurous, and the rules are simple, you can use the webCoRE rulesAPI POC from SDC to generate the JSON.
HTTPS://sdc.webcore.co

2 Likes

@prjct92eh2

I have actually played with that and have it bookmarked. I wrote down the URL from the SDC panel video (and I remember you posting it on webCore too).

I haven’t had a chance to install postman on my Linux machine yet. Too many projects, not enough time, and I don’t even go to a job anymore. I don’t remember how I had time for all this when I worked. LOL

One of the reasons I’m looking is because I’m seeing the “missed events” and it’s getting tiresome for the bride.

3 Likes

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.