nayelyz
(SmartThings Developer Support)
July 22, 2020, 5:53pm
2
Hello @CMREEVES ,
The Rules API is an option, in the time properties such as sleep you can use bigger units like Hour or Day. In the API documentation , you can see the syntax and in the posts below, there are some examples and the instructions to install a rule.
Hello @X0mbie ,
Using the Rules API is another good option, you just need to use an API test tool, like Postman.
The sample below has this workflow:
IF the button is pushed
THEN set a 30-minute timer to turn OFF the TV
{
"name":"If button is pushed, set timer to turn the TV off",
"actions": [
{
"if":{
"equals": {
"left": {
"device": {
"devices": [
"device-id-button"
],
"component": "main",
"capability": "button",
"attribute": "button"
}
},
"right": {
…
Hi, @mpnret
You can create your Rule Automation using either Postman or Insomnia. Personally, I’d suggest you to use Insomnia, as it has a simplier and intuitive UI to perform your API calls. Please, follow the steps below:
First, you must create a Personal Access Token that you’ll be using at your Requests Headers to the SmartThings API.
Then, you must get the list of your devices making a GET HTTP Request at the SmartThings Devies API and track your GE SmartSwitch’s Id.
Finally, update the JSON file from above with your GE SmartSwitch Id and make a POST Http Request to the Rules API .
I hope this information results useful to you.
Best regards,
Erick.
Let me know if you have any questions.
1 Like