Is it possible to run a Rule from a custom tile?
I tried calling an http trigger but I get an error ‘Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://trigger.sharptools.io](https://trigger.sharptools.io/rule/…)’ (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
Is there a better way to do this?
I am creating a pin pad (variation on the Community Project: Pin Entry Custom Tile) which I want to use for turning an alarm an and off as either Home mode or Away mode.
Thanks @josh
I am a little surprised this has not come up before as it would seem to be a good feature to have, but then maybe it is just me.
Another option would be to be able to change the value of a variable if that is possible.
Is the API URL mentioned in the PIN Demo (https://api.smartthings.com) usable in the future? I was thinking that it came from the old Groovy option so wouldn’t be available when that support ends.
If it is, then I think that would work for me.
Thanks @josh
I have got it working through the Smartthings API, but it is a bit messy.
I’ll give it a try directly to Sharptools which I think will be a cleaner solution.
I’ll let you know how I go.
I have created a key pad that turns an alarm on and off.
Pressing ‘0’ and either the ‘Home’ or ‘Away’ key will set the alarm in either ‘Home’ (stay) mode or ‘Away’ mode. You key in the 4 digit pin to disarm the alarm (set by the Custom Tile Settings).
I have created three virtual switches (using the vEdge Creator from TAustin) for Set Away, Set home and Set Disarm. These trigger Routines in Smartthings which set the alarm modes.
I have a rule in Sharp Tools, triggered from the Custom Tile (thanks @josh) which sets the virtual switches.
I have a question though:
I had the idea to change the colour if the custom tile depending on the alarm mode (off, home or away), which I have working, but it is not persistent if the dashboard is refreshed. Is there any way to make this persistent?
I am also still testing this against the Smartthings API to see if one or the other has a faster execution.
How are you determining the Alarm Mode in your Custom Tile?
It sounds like that state isn’t being determined properly when the tile loads. One approach might be to query SmartThings for the status of your various Virtual Switches (assuming those track with the expected state). Other people have loosely mapped their SHM states into various ‘modes’ – in which case you could query the current location mode.