I am trying to use Rule Engine to make a POST/JSON request to a local device (a WLED server on the local network). The command will turn the attached LEDs on or off. My problem, I THINK, is that the target URL has to be Internet accessible.
The SharpTools rule engine is running outside of your local network and you will not be able to access a 192.168.x.x address (or any other private address) since it not on your local LAN. There are solutions to tunnel and then DNS, but a ‘better’ solution would to run a local device handler on your hub. Are you running SmartThings or Hubitat?
webCoRE does issue the command within the local LAN when using a non DNS address. It uses the hubAction class to have the SmartThings query devices local. Outside of the externally hosted web GUI, webCoRE itself is just a [very] well designed SmartThings application and has the same ability to issue commands from the hub just like any other purpose built SmartThings application.
Update: With the deprecation of Groovy, you may want to use the Web Requestor Edge Driver as the HTTP Button will no longer be available.
@Bry you may want to check out the HTTP Button device below as @Bloodtick_Jones allured to, which also uses hubaction to send local HTTP request, and you will just use the rule to trigger the button push to send the HTTP request locally.
IMHO - Probably better to use webCoRE similar to your test and hit the pistons external address with SharpTools. Since webCoRE is a ST application and not Device Handler it should be in viable longer as they depreciate groovy. The SmartThings team has indicated that applications will move later.
@josh how come you can’t send Get requests like webCoRE that also runs in the cloud?
Have you thought about using HubAction to do it? Could you add it at some point in the future? Does this feature need voting on?
You can see the Web Requestor part. The rule is still incomplete, as it’s too cumbersome and time consuming to finish. I have 10 radio switches that 9 need to turn off when 1 turns on, that then sends Radio URL to a speaker, and a local web request to a Raspberry Pi to change a media image on a dashboard. On webCoRE it took minutes, here I’ve only done 2, I would need a day to complete it. Very underwhelmed with Sharptools at the moment, it’s like trying to drive a car whilst being in a straitjacket.
Something odd is going on with the screenshot, everything is on top of each other. I agree using sharptools is a bit cumbersome compared to webCore. It would help if they would let you select multiple devices at the same time.
Thanks for the info, I voted on the request. I currently have some automation that checks if the garage door was left open and then broadcast to my speakers in the home. I would like to move that over, would that work in sharptools.
Web Requestor has 5 slots that can be preconfigured with ‘body’ data to be sent over with the request. But these don’t include a JSON ‘content-type’ header, which means it won’t work with a lot of servers.
I submitted a request to either default to JSON or provide a configuration option… and also to expose the ability to dynamically send body content via the Web Requestor driver. It sounds like the device author has their hands full at the moment, but lets see what happens…