Simple Remote Control Via URL


#1

Here is a simple piston which can be used by any external service capable of making HTTP calls, from simple bookmarks saved in your phone browser / on your desktop to software packages like Blue Iris or other home automation platforms etc.

With this piston you can control any device by quoting the device name in the URL, so no need to hard code devices into separate pistons.

Find the piston URL here:

image

Then add the following to the end of the URL:

?device=device_name&request=on (or request=off)

If your device name includes spaces or special characters, you will need to URL encode the name, for example ā€œD - Kitchenā€ would be encoded to ā€œD%20-%20Kitchenā€

i.e. ?device=D%20-%20Kitchen&request=on

You can use an online encoder to make this simple:

https://meyerweb.com/eric/tools/dencoder/


[Resolved]Execute reusable section of code (subroutine) based on event/conditional/device state
Stringify type http trigger in Webcore
How can a Piston control devices on two locations within the same webCoRE account?
#2

Now with set level option:

Example:

Add the following to the end of the piston URL:

?device=D%20-%20Kitchen&request=dim&level=72

This will dim ā€œD - Kitchenā€ lights to 72%


NFC Tag > iOS Shortcuts > webCoRE
#3

I may have to borrow this. Iā€™ve got an EventGhost + Piston operation that turns on my desk lamp when I unlock my desktop and turns it off when I lock it again. That would combine my On and Off pistons into one and allow me to turn other switches On and Off by URL too. Very Nice.
One of the advantages of using an interpreter-based language like this is that you can get away with stuff like
device device={$args.device};


#4

This is brilliant! I have never tried setting a device variable via arguments before, but I like this very much!

Thanks for sharing!!


#5

As requested by @bwarman on another thread, Iā€™ve added options to wait until a specific time or wait a specific duration:

Arguments in the URL can be as follows:

  • device=URL_Encoded_Device_Name
  • request=on, off or dim
  • level=1-100
  • delayType=until or wait
  • time=time_in_24h_format or duration_in_seconds

Examples:

Set ā€˜D - Kitchenā€™ to 50%:
?device=D%20-%20Kitchen&request=dim&level=50

Set ā€˜D - Kitchenā€™ to 25% in 70 seconds:
?device=D%20-%20Kitchen&request=dim&level=25&delayType=wait&time=70

Turn on ā€˜D - Kitchenā€™ at 4:30pm:
?device=D%20-%20Kitchen&request=on&delayType=until&time=16:30


#6

Just curious Robinā€¦ If there is a device currently waiting, does that mean that other devices cannot be controlled in the meantime without messing up the WAIT?


#7

By default yes, but if you change the ā€˜piston execution parallelismā€™ to ā€˜enabledā€™ in the piston settings, then multiple triggers will spawn multiple concurrent waits.

Iā€™m not 100% certain if this will mess up the existing $args.device value thoughā€¦ have fun testing that one lol! :crazy_face:

For the benefit of others, this setting is accessed by clicking on the piston name whilst in the editor, then the cog symbol.


#8

So I did a quick testā€¦ parallelism enabled does not helpā€¦ if you change any of the $args, only the last sent values are used.

I guess you would need to store the various $args values in variables, so each parallel execution can refer to the original $args values, not the newly updated ones.

Leave that one to you @WCmore

EDIT: Storing $args does not work eitherā€¦ they get overwrittenā€¦ will need to store an array of values, and a counter for each execution so the correct position in the array can be called backā€¦ more than I can be bothered to do lol


#9

LOL. I think I will leave out the extra code for the WAIT.
IMO, piston ā€œ69q0ā€ is much more elegant & useful without it,
so any (all?) devices can be controlled with that one piston.


#10

I agreeā€¦ waits can be processed on the device / software sending the request.


#11

For anyone looking for a use case for this, Iā€™ve setup two iOS shortcuts to disable my Arlo cameras for a certain period of time or until a certain time or day. When running the shortcut I am asked for either the amount of minutes to disable them or the time to turn them back on (dependent on the shortcut run), and that number is then passed at the end of a Webcore URL request in my shortcut. I can post a screenshot of my shortcuts, if anyone else is interested.
Iā€™m not sure why NetGear still hasnā€™t hopped on the shortcut bus yet, but this is actually a more powerful solution than they would have come up with.


#12

I have been experimenting with a wifi ESP8266/arduino device sending status to webcore like thisā€¦

URL/execute/Arduino1?motion=active&door=open&temp=75&humidity=50&pump=on

Ultimately wanted to use this device at another house (which doesnā€™t have SmartThings) to keep an eye on the failing sump pump.


Stringify type http trigger in Webcore
#13

Kevin, What Command are you running in webcore to disable and resume your Arlo cameras. I have not been able to get this accomplished. If I can I will then emulate your iOS short cut. Can you share your piston?


#14

I think you were referring to me when you wrote this. If youā€™ve added your Arlo cameras to Smartthings and Webcore then they should show up there. You then just turn them ā€œoffā€ or ā€œonā€. I would rather the ability to Arm or Disarm, but Samsung doesnā€™t give us that ability.


#15

bwarman, Thanks. I tired on and off sometime ago, but did not work for some reason. I tried a test this morning and seem to work without issue. Agree Arm and Disarm would be much preferable, but I am just turning 2 of my 3 cameras off when my wife or I am at home, and then turn on when we are all away.


#16

@millsjq, yeah, Iā€™ve had spotty reliability with any type of API calls to Arlo. I used to use Stringify to control my Shortcuts and that wouldnā€™t always work either. Iā€™ve noticed that it seems less likely to turn off/on when there is activity being recorded on one of the cameras. If I turn them off because Iā€™ve gotten an alert, I almost always check to make sure theyā€™ve all turned off.


#17

Thanks for the additional info. I also was using Stringify and with Arlo, had greater reliability and options. In almost all other areas Webcore give me more flexibility.


#18

Quick update. Until Webcore can arm/disarm the Arlo base station I have switched to using IFTTT to arm and disarm my Arlo base station. I created a virtual switch in Smartthings called ā€œArlo Camerasā€ and then created an applet in IFTTT which, ā€œIf Arlo Cameras switches to Offā€ will disarm my Arlo base station. Then I created one doing the opposite so ā€œIf Arlo Cameras switches to Onā€ will arm my base station. I used the same iOS shortcuts but just turned my virtual ā€œArlo Camerasā€ switch on and off. Then IFTTT takes care of the rest.

The added bonus of doing it this way is that I can use my Echos and Google Homes to turn on and off ā€œArlo Camerasā€, which turns on and off my base station.


#19

Please be careful with this @bwarmanā€¦

Someone with bad intentions can easily disarm your stationā€¦ even from outside.


#20

Yeah, I considered that but I also added push notifications if the applet ever runs, so Iā€™ll be alerted if they ever do turn off when I donā€™t want them to.

I know itā€™s not rock solid security, but a lot of loopholes would have to be stepped through in order for my security to completely fall through. Iā€™ve also got a security system, Ring doorbell, and a few cameras inside.