I’m wondering if there is a way to create a single Sharptools widget to open/close the garage door with GoControl garage door opener linked to SmartThings. So far I could only create 2 widgets side by side - one to open the door and another one to close it, which doesn’t make much sense.
This is pretty much the only thing I need Sharptools for. Please let me know if it’s doable.
Thanks!
Does the device expose a push
or toggle
command? If it does, you could use those to have a single widget.
Otherwise you can do it with Tasker and the SharpTools Tasker Plugins. Or you could create a virtual switch to mirror the garage door state and use that as your widget.
I added my GoControls some time ago so I cannot remember exactly what I did, but I have one icon that will either open or closed the door depending on it’s current status. Mine are Door Control tiles.
OP is talking about Android widgets if I understand correctly.
Dashboard tiles should handle this just fine as you noted - no tricks necessary.
Crap, nevermind, lol.
I appreciate the community support! I love seeing the community help each other!
Thanks for quick reply! No, it only shows open, close and ping. It works with a single button in SmartThings though, so it operates as a toggle while reading the door sensor, I guess.
I’ve tried to create a virtual switch, but the problem is that the widget does not reflect the actual door state, so you can never tell for sure whether it’s open or closed (unless it can be linked to the door sensor, but I couldn’t figure out how to do it).
Could you please elaborate on the Tasker option? I’d really appreciate some basic steps.
Thanks again!
Yeah, you would have to create rules in both directions and it would still leave you with a widget that looked more like a light.
The high level steps would be to:
- In SharpTools, subscribe to
door
events on the garage and setup a SharpTools Thing State event profile in Tasker to store the state changes in a Tasker variable - Create a Tasker widget (‘Task’) and create the associated Tasker Task to open or close the garage based on the door state variable from step 1
- Create a Tasker Profile to change the widget (icon and/or label) whenever the variable from step 1 changes
Have you used Tasker before? It’s a very powerful app, but it’s also a bit of a tinkerer’s paradise so it can take some getting used to.
Great, thank you very much Josh!
A light bulb widget is exactly what I got with the virtual switch, so it was pretty useless.
I’ve tried Tasker once but it looked too convoluted and counterintuitive for a simple task. But I’ll try again to follow your steps and see if I can figure it out.
Hi Josh,
Sorry for the delay - I was away but now I’m back and already pulled all my hair out trying to make it work.
It’s probably more a question for Tasker forum, but I thought you might help since you really know how it works.
I tried to do what you suggested, but got stuck in the following:
I subscribed to door events and set up a SharpTools Thing State event profile (Thing: ALL, Attribute: door). However, it didn’t allow me to save it unless the profile is linked to a Task, so I created a task containing A Thing sending “open” command if %door ~ closed (the value A Thing Attribute widget returns). However, the task doesn’t work unless the ‘if’ condition is removed.
Assuming that this problem is solved, how can I create a task that would contain both “open” and “close” commands, so it operates from a single Tasker widget?
Thanks!
1. Store the Garage Door events (state) in Tasker Variable
For this part, you would create an event triggered profile using the SharpTools Thing State plugin (making sure to configure it to receive events for just the door
attribute of your garage).
Then in the Task, you would copy the %st_attr_value
variable into a Tasker variable using the Variable Set action (eg. %GarageDoor
)
Note that variables that have an all lowercase name are local variables, so you need to have some capital letters in the variable name so it’s a global variable that persists across different tasks.
2. Create a Tasker widget (and ‘Task’) to toggle the garage open/closed
From your Android homescreen, add a ‘Tasker (Task)’ widget to your homescreen. When you are prompted, create a new Task and name it as you see fit (eg. Toggle Garage).
In that Task, you’ll use an IF condition to determine if you want to send the open()
or close()
command based on the state that’s stored in the variable.
Note: you may want the IF condition to explicitly check for ‘open’ or ‘closed’ states explicitly rather than IF ‘closed’ do X, ELSE do Y` which has the risk of trying to send a command while the door is opening or closing.
Alternatively, you might prefer the first step of the Task to be an action that retrieves the latest state of the garage door. This would be a more accurate and safe approach, but might take an extra second or so to run as it retrieves the state first.
3. Update the Widget based on the Door State variable changing
Create a Tasker Profile that’s triggered by Event > Variable Set
Note: You can leave the ‘Value’ field empty as we want it to trigger anytime the value changes no matter what the value is.
When Tasker prompts you to create a Task, create a Task named accordingly (eg. Update Widget). In that Task, you’ll use an IF condition based on the %GarageDoor
variable that you created earlier. If the door is ‘closed’, you can adjust the icon of your widget from Step 2 accordingly. Otherwise you can adjust the icon of the widget accordingly and assume the door is open (default to the ‘bad’ state as a safety precaution).
Finally made it work. Guess even a basic scripting is not my strong point.
Thank you very much for your help Josh!
I know I’m late to this but this is super simple. You’ll have to edit the sharptools portion to match your stuff but that should be self-explanatory.
Here’s a link to the task.
GoControl Garage Door (349)
A1: Thing: Get Attribute [ Configuration:Location: Home
Thing: GoControl Garage Door
Attribute: door Timeout (Seconds):15 ]
A2: If [ %st_attr_value ~ closed ]
A3: A Thing [ Configuration:Location: Home
Thing: GoControl Garage Door
Command: open Timeout (Seconds):0 ]
A4: Else
A5: A Thing [ Configuration:Location: Home
Thing: GoControl Garage Door
Command: close Timeout (Seconds):0 ]
A6: End If
A7: Wait [ MS:0 Seconds:30 Minutes:0 Hours:0 Days:0 ]
A8: Thing: Get Attribute [ Configuration:Location: Home
Thing: GoControl Garage Door
Attribute: door Timeout (Seconds):15 ]
A9: Flash [ Text:The garage door is now: %st_attr_value Long:Off ]
That’s great, thank you very much. I just didn’t know that if/else conditions can be added as standalone actions, which makes things so much easier.