Create Automations via computer

One thing that really annoys me with SmartThings is that all routines have to be set up in the app. I use a mobile phone and to get an overview or to edit stuff is really cumbersome. That’s why I’m considering using SharpTools for most automations, as it’s a whole lot easier to set these up on a computer with their rule engine (but I would lose the advantage of routines running locally on the hub).

Is there really no way to set up local automations in SmartThings via a computer? I suppose I could go the Rules API route, but it feels too overwhelming to even know where to start (and not sure it’s worth the time investment).

I will keep a Google Spreadsheet for all automations, but juggling between this spreadsheet on the computer and the SmartThings app on the phone is not as easy as to have two tabs open in Google Chrome to know I have the spreadsheet up to date and to implement ideas from the spreadsheet in SmartThings.

1 Like

Bedsides my Android SmartPhone, I have both an Android tablet and an iPad. The larger screen make it easier. I mostly use the Android tablet to program in SmartThings since my iPad SmartThings experience is total garbage.

I recently upgraded my smartphone to a new Samsung Galaxy S22+ which has the ability to use the Windows Phone Link app to access the Android apps from the smartphone on the Windows computer. And, there use also the Samsung DEX mode that is available too, but I’ve never really used it that much.

If I didn’t have the tablets, or a Windows computer, then I guess that I would try using my smartphone’s Screen Mirroring feature and mirror the screen to either an HDTV, a Fire TV, a Roku, or any other device that supports screen mirroring with a Bluetooth keyboard and mouse connected to the smartphone for a more immersive experience.

1 Like

I believe the intended method for this is the Rules API. The idea is to eventually Create on a computer, run locally on the hub. Meanwhile, some “recipes” (their equivalent to pistons) still run in the cloud, I believe. But others will know the details.

The Rules API is still in Beta and many of us are hoping for an eventual UI more like SharpTools or Webcore, but it isn’t here yet. And no promises.

Meanwhile, here’s where to start. (The topic title is a clickable link.)

@Automated_House might know more or suggest more resources.

1 Like

Thanks. The Rules API does look powerful indeed, but I’m getting lost long before I get anywhere near starting to create a rule… Are there any beginner tutorials for the Rules API that is not aimed at experienced programmers? I have some programming experience, but I need to get to somewhere where I can continue on my own…

1 Like

Thanks @DaWeav. I just realized I can actually control my Samsung Galaxy S20 from my Windows computer… Its still just the size of a phone though, but at least easier to type on the keyboard. Hoping there’ll be an interface for computer later.

Rules API Getting started

Instructions for Windows PC

Use Notepad++ for writing rules
Notepad++ supports JSON language checking

CLI is also needed

Read Device Ids using CLI command
smartthings devices

When for example RulesAPI_test.json is ready
make rule using CLI command
smartthings rules:create -j -i RulesAPI_test.json

List rules and Rule-Ids using CLI command
smartthings rules

Delete rule using CLI command
smartthings rules:delete

Example Rules API rule

Change Switch-Device-Id and Bulb-Device-Id to Ids
that you get from CLI command smartthings devices

{
    "name": "Switch on Turn on Bulb",
    "actions": [
        {
            "if": {
                "equals": {
                    "left": {
                        "string": "on"
                    },
                    "right": {
                        "device": {
                            "devices": [
                                "Switch-Device-Id"
                            ],
                            "component": "main",
                            "capability": "switch",
                            "attribute": "switch"
                        }
                    }
                },
                "then": [
                    {
                        "command": {
                            "devices": [
                                "Bulb-Device-Id"
                            ],
                            "commands": [
                                {
                                    "component": "main",
                                    "capability": "switch",
                                    "command": "on"
                                }
                            ]
                        }
                    }
                ]
            }
        }
    ]
}
3 Likes