Troy,
You are awesome! Your URI Switch is able to activate and deactivate the home mode of my Synology NAS server. Thank you very much for your help! I was experiencing a variety of problems worth being aware of. For any newbies who happens to come across this problem later…I’ll leave the solution below.
First of all - I found it very helpful to listen to these two webcasts:
Introduction to SmartApps - https://youtu.be/-tziJURnet0
Creating and Adding New Devices onto the SmartThings Platform - https://youtu.be/CO5hEWFop5o
While the videos themselves did not provide a direct answer to my question, they helped me understand the relationship between Devices, SmartApps, and Device Handlers.
I also read this thread which explained the http Get request:
While this did not have the direct solution to my problem, it pointed me in the right direction because it confirmed two things…that the http Get request works for sending url requests but not between devices running inside my network. It also confirmed sending a web api from a smartthings hub to another device within the LAN is possible and that you need to use something called hubAction to do this.
This confirmed Troy’s code worked. After a few hours of troubleshooting I realized the following…
Troy was correct, I needed to remove the parenthesis from around the username and password attributes of my command string. This solved the problem BUT…
Because I had tried sending the command so many times with the parenthesis included, my NAS server had blocked the ip address of my SmartThings hub automatically because of the repeated incorrect password attempts. I didn’t realize this because I couldn’t see any error messages. Once I figured this out, I logged into the NAS control panel and identified the IP address for the SmartThings hub as a safe device.
The removal of the parenthesis and the IP setting did the trick. Problem solved.
I wouldn’t have been able to do it without you. THANK YOU for all of your help!
By the way… my NEW settings (minus parenthesis around username and ID) is below for anyone who wants to confirm what worked.
External On URI:
External Off URI:
Internal IP: 192.168.0.20
Internal Port (if not 80): 5000
Internal On Path (/blah?q=this): /webapi/entry.cgi?api=SYNO.SurveillanceStation.ExternalEvent&method=“Trigger”&version=1&eventId=1&eventName=“This is external event1”&account=my_username&password=my_password
Internal Off Path (/blah?q=this): /webapi/entry.cgi?api=SYNO.SurveillanceStation.ExternalEvent&method=“Trigger”&version=1&eventId=2&eventName=“This is external event2”&account=my_username&password=my_password
The text for the paths above was created by logging into the Synology Surveliance System, opening up the Action Rule app, and creating two rules called "Enter Home Mode: and “Leave Home Mode”. The action is defined as entering the Home Mode and the event is “external event 1”. You will find a button called “get command” which allows you to copy the text path above and paste it into Troy’s code.