SharpTools uses push events for two main features -- the `Thing State` Tasker plugin and Widgets that display state. This article explains how push events work with Widgets and Tasker and how to troubleshoot various features.

Widgets

SharpTools includes a widget called "A Thing (Widget)" which can change color to reflect the current state of a device. For example, you might create a widget for a lamp and the widget would show a lit-up yellow color when the lamp is off and a gray color when the lamp is turned off. When you first create this widget, SharpTools automatically sets up an event subscription which is used to keep the widget status up-to-date. This uses the SmartThings event subscription capabilities and then pushes the data for Firebase Cloud Messaging (FCM) by Google. FCM is Google's push event and push notification service that powers millions of Android apps that you like use today.

It may seem like a long process, but all this happens in milliseconds when things are working properly!

In addition to the push events, SharpTools also refreshes the widget data anytime the main SharpTools app is open and the Thing data is refreshed. By default, the Thing data is automatically refreshed when you first open the app. Additionally, you can change the SharpTools Settings to periodically refresh data while the app is open or you can manually refresh the data by tapping the refresh icon in the action bar.

Widget-specific troubleshooting: The first step in troubleshooting widgets is to try deleting the widget and then setting it back up again. After deleting the widget, check to see if there are any subscriptions for the Thing/Attribute that was used for the widget by opening the Subscriptions pane from the SharpTools left navigation and tapping the refresh icon in the action bar. Remove any remaining subscriptions by long-pressing on the subscription and selecting Unsubscribe. Try setting up the widget again and verify if the push events are working as expected.

Tasker

The 'Thing State' event plugin in Tasker uses many of the same principles as the SharpTools widgets -- the main difference being that you must manually subscribe to your desired attribute and setup the 'Thing State' plugin in Tasker. Check out the Event: Thing State tutorial for more information on how to set up a Tasker profile that reacts to SmartThings events.

The summarized version of setting up the profile is as follows: First, subscribe to the desired attribute by long pressing on the Thing in SharpTools and selecting the appropriate "Subscribe to..." option. A small star icon will show up in the top-right corner of the Thing card when you are subscribed to at least one attribute. Then open up Tasker and create a new 'Thing State' event profile and make sure you configure the Thing and Attribute fields to match your subscribed thing/attribute.

The process of an event being triggered is very similar to widgets -- a SmartApp running in the SmartThings cloud watches for the subscribed Thing events and then pushes the data to your device using Firebase Cloud Messaging by Google (FCM).

Again, this may seem like a long process, but it all happens in milliseconds when things are working properly!

*Within Tasker, the 'Thing State' profile has to be configured correctly to trigger the task and the task must be configured properly to take a desired action. One way to test this is to completely clear out the 'Thing' and 'Attribute' fields in the 'Thing State' event plugin configuration -- this will cause the Tasker plugin to match ANY thing and attribute that changes. Additionally, try creating the most basic profile you can with ONLY the 'Thing State' plugin as a context and ONLY an Alert → Notify action with "TEST" as the title. If the simple profile and task are being triggered successfully, build from there adding 'Thing' and/or 'Attribute' filters to the Thing State plugin and adding additional logic and actions to the task.

Subscriptions

SharpTools has a Subscriptions screen which displays all the currently subscribed Device/Attribute pairs for the current Android device. To access this feature, open the left navigation in SharpTools and select Subscriptions. Once the subscriptions screen is open, tap the refresh icon in the action bar to download the latest set of subscriptions from SmartThings.

Note that the subscriptions list shows two different icons -- the first icon is a square/cube which indicates that a subscription is in place and is being used for widgets. The second icon is a star icon which indicates that a subscription is in place and is being used for Tasker.

A subscription can also have both a widget and Tasker subscription -- in this case, if you long-press and try to remove the subcription, SharpTools will only remove the Tasker subscription leaving the widget subscription in tact. Similarly, if you have both a widget and tasker subscription and then remove the widget, SharpTools will remove the widget subscription but leave the Tasker subscription in tact. To completely remove the subscription, you may have to manully unsubscribe from the thing/attribute and then delete the widget from your homescreen.

Troubleshooting

Now that we have a basic understanding of how the Widgets and Tasker push event features work, let's dig into troubleshooting a bit. As of SharpTools 2.3, there is now a "Manage Push Events" feature at the bottom of the SharpTools Settings screen. This is a great place to start for troubleshooting.

Verify Cloud Messaging ID

At the top of the screen, you should see your Firebase Cloud Messaging ID (FCM ID). If you don't see an ID, this likely means that something went wrong when trying to register your device with Google. This registration process is all handled automatically by Google, but if you aren't seeing a FCM ID for some reason, you can try tapping the 'Force Reset FCM ID' option which will forcefully clear the local registration ID and manually ask Google for an ID.

Send Test Message

Once you have confirmed that you have a FCM ID, another helpful feature is the Send Test Message button. This will send a push message to your device using the SharpTools.io cloud servers. This is a great diagnostic feature as it completely takes the SmartThings servers out of the loop and directly communicates with SharpTools.io which is running on Google's Cloud Platform. After pressing the 'Send Test Message' button, you should see a message indicating whether or not the message was successfully posted to SharpTools.io and the Google servers -- when successful, this message will also include a receipt ID which is helpful for diagnostics (more on this in a bit). After a successful post, the next message you should see is a receipt of the push event. If all three messages are shown (FCM ID, Post Successful, Ping Response Received), then the core push event functionality is working on your device.

Push Event Debug Notifications

If the Send Test Message feature works as expected, the next step is to troubleshoot events from SmartThings. Before we get started with that, it may be helpful to enable Push Event Debug Notifications. Once this feature is enabled, SharpTools will display a notification anytime ANY push event is received. This is particularly helpful in troubleshooting Tasker profiles where the profile might need some additional adjustments to work properly. Using the 'Send Test Message' feature will give you an idea how this works -- a notification will be displayed which when expanded displays the content of the received push event.

Verify Subscriptions

Note: The instructions in this section only apply to Tasker subscriptions as the `Things` view only shows a star icon for Tasker subscriptions. If you want to see all of the subscriptions for your device, open the Subscriptions pane instead. See the Subscriptions section for more details.

After Push Event Debug Notifications are enabled, check that the desired attribute is subscribed as expected. To do this, open the Things screen in SharpTools and scroll down to your desired device. You should see a star icon in the top-right corner of the Thing card indicating that at least one attribute is subscribed. Further to that, if you long press on the device, you should see a menu of items you can subscribe to and unsubscribe from. You should see an "Unsubscribe from..." option on the attribute you are trying to receive push events from. If you don't see this option, select the "Subscribe to..." option for your desired option to make sure you are subscribed to push events. Another helpful troubleshooting step is to manually unsubscribe from and then resubscribe to your desired attribute - this forces the SmartApp to clear out the subscription and then re-add it. Additionally, you can try opening the 'Subscriptions' pane from the SharpTools left navigation and then manually tap the refresh icon in the action bar to refresh the list of subscriptions. Once you've refreshed the list of subscriptions, open the Things screen again and check to see if your subscription is setup as expected.

Test a Subscription

After you have confirmed that Push Event Debug Notifications are enabled and your desired attribute is subscribed, try triggering the event. For example, if you are subscribed to the 'switch' attribute of a light, turn the light off and on a few times. If you are subscribed to the 'level' attribute, try dimming the light down and then back up again a few times. If the push events are working as expected, you should receive a push event debug notification at that top of your screen.

Review SmartThings IDE Live Logs

If you still haven't received a push event as expected, try reviewing the SmartThings IDE Live Logs. To do this, open the SmartThings IDE Live Logs, then manually trigger your event (eg. turning the light on/off). To make it easier to sort through the logs, tap the "SharpTools" option in the top filter bar. When the subscribed attribute is changed, we expect to see a message that starts with "event triggered for [attribute] on [device_id]" -- this message indicates that SmartThings internally received the event from the Thing. If you aren't receiving this event, it means that SmartThings isn't seeing the change from your device -- the first troubleshooting step would be to manually unsubscribe and resubscribe to the attribute in SharpTools. The next message you should see is "Event data successfully posted" and then "RegIDs triggered" showing the FCM ID(s) that the push event was sent to. These last two messages indicate that SmartThings has successfully handed the messages off to Firebase Cloud Messaging and it is up to Google to deliver the message now.

Note: some IP devices like the Belkin Wemo are notorious for having slow status updates on the SmartThings platform. Submit a support ticket to SmartThings to show that you want this improved on the platform! Try testing with a Zigbee or Z-wave device as these tend to have the fastest update times on the SmartThings platform.

Complete Reset

If the push events still aren't working as expected, one option is to completely reset your environment. To do this, first open the SmartThings mobile application and remove the SharpTools SmartApp. As of writing this document, you can remove a SmartApp by opening the right-hand navigation menu, select SmartApps, scroll down and select SharpTools, then scroll down and select 'Remove'.

After the SharpTools SmartApp is removed, clear the data from the SharpTools. While many devices should not require clearing the data from the app (as an uninstall and reinstall process should clear the data), experience has shown that some device manufacturers cache app data longer than they should. To work around this, manually clear the data from the SharpTools app before removing and reinstalling it. The instructions on how to do this vary from device to device, but in general the process includes navigating to your main Android Settings screen, then selecting Applications, select "All Applications" or "Installed Applications", then scroll down and find SharpTools, then select "Clear Data". Again, the process may vary from manufacturer to manufacturer, so refer to manufacturer instructions as needed.

After the app data has been cleared, uninstall and then reinstall the SharpTools Android app. Open Google Play and search for SharpTools -- select SharpTools and then select the 'Remove' option. Once the application is removed, restart your Android device. After your device has restarted, open Google Play and search for 'SharpTools' and select Install.

After installing SharpTools, complete the Authorization of your Things from the SharpTools Settings screen and setup the subscription again. Once the subscription is setup, try the troubleshooting steps again.

In this tutorial, we will demonstrate how to use Tasker, AutoVoice, and SharpTools to run a SmartThings routine using your voice. At the end of this tutorial, you will be able to say "Okay Google, run the routine Good Morning" and have the "Good Morning!" routine/phrase run.

This tutorial uses the SmartThings Voice Control with Tasker tutorial as a baseline. If you are unfamiliar with using AutoVoice or Tasker, I would strongly recommend reviewing the SmartThings Voice Control with Tasker tutorial.

Create a new Event Profile in Tasker

Choose AutoVoice → Recognized

For the command filter, enter:Run the routine (?<routine>.+)Note: Make sure "Use Regex" is checked

Proceed to creating your task (optionally providing a name for the task)

At this point, we will create several actions for each desired phrase and will make these actions trigger conditional upon our desired phrase being spoken. (More details on conditional actions)

In the task, create an action using Plugin → SharpTools → A PhraseNote: A Phrase is the legacy name for A Routine

Use the pencil icon in Tasker to edit the "A Phrase" plugin and select your desired phrase.

In the Action Edit screen for "A Phrase", scroll down to the If section and enter the %routine variable on the left and the phrase on the right that you would like to trigger the action.Example: If %routine ~ goodnight

Repeat steps 5-7 for each desired phrase. When you are finished adding Phrases, press back multiple times to fully exit Tasker and enable the profile.

In the end, your task will have several actions like:

A Phrase: "Good Night!"

If %routine ~ "goodnight"

A Phrase: "Good Morning!"

If %routine ~ "good morning"

A Phrase: "Special Phrase!"

If %routine ~ "custom spoken trigger"

Note: For debugging purposes, you may want to include a simple Notify or Flash action to show the contents of the variable captured with AutoVoice. Sometimes the words captured by AutoVoice/Google are slightly different than you expected and you will want to adjust your conditional actions accordingly (eg. "good night" → "goodnight", "10" → "ten")

For additional troubleshooting steps, see the troubleshooting section of the SmartThings Voice Control with Tasker tutorial.

In this tutorial, we'll show how to react to specific mode changes. By default, when you subscribe to mode changes in SharpTools, the 'Mode Change' event plugin will be triggered anytime ANY mode change occurs. If you want to trigger mode changes only for specific modes, you will need to use a conditional action (IF).

In this example, we will explain how to setup a task that only runs if the mode is changed to `Night`.

Open SharpTools

Open the left navigation and select Modes

Long press on any mode and select 'Subscribe to all mode changes'Note: If you are presented with the option 'Unsubscribe from all mode changes', you are already subscribed and no action is needed.

Open Tasker

Create a new Profile > Event > Plugins > SharpTools: Mode Change

Click the pencil icon to edit the plugin

No configuration is needed, so simply click the Apply button

Press back to exit the profile configuration

When you are prompted to enter a name for the task, leave the task blank and tap the checkmark to continue

This example shows how to save the state of a device for later use in Tasker. If you are subscribed to multiple devices, you might find that you want to have a Tasker profile react to the current state of many devices at once. In order to do this, you can save the device status off to a global Tasker variable, so it is available for use in other profiles and tasks.

Note: This same approach can be used with the action "Thing: Get Attribute" within a profile. Immediately after triggering the Thing: Get Attribute action, you would setup a Variable Set action to copy data into a global variable.

When the 'Thing State' event triggers in Tasker, there are four variables that are set. Using a Porch Light as an example:

In order to make this data available in other profiles, you need to copy the data from the %st_attr_value to your desired permanent variable. For example:

SetVariable%PORCHLIGHT to %st_attr_value

There are a couple of options on how to do this conditionally:

Option 1: One option is to setup several "Thing State" events each with the configuration filters set to react to each individual thing and then have each Task set the desired variable (eg. %PORCHSTATUS) to the value from %st_attr_value. At the end of running through your variable copying tasks, you could then trigger the main tasks which would evaluate all the global variables you have set.

Option 2: Another option is to have one main "Thing State" event that does not have any filters applied to the plugin so it catches everything... then use conditional actions to transfer the data from the %st_attr_value to the appropriate variable. So like in the above scenario, you would use Tasker's "VariableSet" %PORCHSTATUS to %st_attr_value but only IF the %st_thing_name matched "porch light". You would setup an action for each thing that you want to transfer the variable for (eg. IF %st_thing_name matched "hall light" then set%HALLSTATUS to %st_attr_value, then at the end of the task, you would trigger the main taskswhich would evaluate all the global variables you have set.

Keep in mind that local variables are only available during the execution of a task, so you should global variables so the data will be retained. From the Tasker variable guide:

Variables which have an all-lower-case name (e.g. %fruit_bar) are local, meaning that their value is specific to the task or scene in which they are used.

Variables which have one or more capital letters in their name (e.g. %Car, %WIFI) are global, meaning that wherever they are accessed from the same value is returned.

In this tutorial, we will show how to use SharpTools and Tasker to create a custom widget that displays Thing state in Android. If you are looking for a quick and easy way to control your Things without Tasker and without showing the current state, the built-in widget 'A Thing' is ready-to-go right out of the box.

Instructions

Create the Widget + Action

Follow the steps for your launcher to pick a Widget to be added to your homescreenNote: Many launchers display the list of widgets after a long press of the homescreen or within the app drawer. Consult the manual for your homescreen or install the Google Now Launcher.

Select the 'Task' widget

Select the 'New Task' option

Enter the name 'Light Toggle' for the Task and click OK to continue.Note: You must enter a name here as we will use it later to change the Widget icon based on the Thing state changing.

Tap the '+' icon at the bottom of the screen to add a new Action

Select Plugin > SharpTools > A Thing

Click the pencil icon on the Configuration line

Select the device type, device, and command you would like to perform when the widget is tapped. For this example, we are going to use the 'toggle' command of a light.

Tap apply to save the 'A Thing' settings

Press the back button of your Android device to save the Action

In the bottom-right corner of the Widget configuration, select the 'icon-grid' button to select an icon to be displayed on the widget.

Select 'Built-In Icon' and select the Panda Bear.

Press the back button of your Android device to save the Widget

At this point, you should now see a Panda Bear widget on your homescreen and if you tap this icon, the selected light should toggle on and off.

Subscribe to an Attribute

Launch SharpTools

Scroll down to your desired 'Thing'Note: In this example, we are using the Upstairs Hall light.

Long press on the Thing name and a Subscription menu should pop up

Subscribe to the desired attribute by tapping itNote: In this example, we are interested in when the light turns on and off, so we will use the 'Subscribe to switch' option.

The Thing should now show a star in the top-right corner of the card

Create the State-change Context

Launch Tasker

From the Profiles tab, click the '+' icon at the bottom of the screen

Select Event > Plugin > SharpTools > Thing State

In the Thing Name field, enter the name of the subscribed Thing

In the Attribute Name field, enter the name of the subscribed attribute

Click Apply to save the Thing State settingsNote: several variables are saved in Tasker whenever the Thing State event is triggered. We will use these variables in the following steps to determine how to change the widget icon.

Press the back button on your Android device to save the event

Select the 'New Task' option when prompted

Optionally provide a Task name and tap the checkmark to continue

Tap the '+' icon at the bottom of the screen to add a new action

Select Tasker > Set Widget Icon

Tap the search icon (magnifying glass) and the select the widget 'Light Toggle' that we created earlier

Tap the 'icon-grid' button to select an icon to be used for the 'on' conditionFor demonstration purposes, we used the colored Tasker icon from the bottom of the 'Built-in Icons' list.

Tap the '+' button in the If section to add a conditional

Set the conditional to: %st_attr_value ~ onNote: The left hand side of the conditional if the variable which we will evaluate. This is the 'Attribute Value' variable from step 6. The '~' indicates we will be performing a 'Matches' condition. And the 'on' indicates we will look for the word 'on' in the attribute value - make sure this is all lowercase.

Press the back button on your Android device to save the Action

Tap the '+' icon at the bottom of the screen to add another action

Select Tasker > Set Widget Icon

Tap the search icon (magnifying glass) and the select the widget 'Light Toggle' that we created earlier

Tap the 'icon-grid' button to select an icon to be used for the 'off' conditionFor demonstration purposes, we used the grayed out Tasker icon from the bottom of the 'Built-in Icons' list.

Tap the '+' button in the If section to add a conditional

Set the conditional to: %st_attr_value ~ off

Press the back button on your Android device to save the Action

Press the back button on your Android device again to save the Task

Press back one more time to exit Tasker and activate the profile

Closing Comments

In this article, we demonstrated how to setup a 'Task' widget to toggle a light then how to subscribe to an attribute in SharpTools and react to that change in Tasker. Putting all this together, we now have a widget that toggles a light and displays the current state of the device.

In the example, we used a somewhat boring built-in Tasker icons, but I implore everyone to get creative with your use of widgets. Perhaps you want to have an actual picture of the light showing the status of the device; Or perhaps you might use a custom graphic or icon pack; Or perhaps even use Zooper Widget to create a completely custom Widget.

Troubleshooting

Make sure you have subscribed to the appropriate attribute of the right device inside the main SharpTools app. You can tell if you are subscribed to a device as a star will show up in the top-right corner of the card.

Double check the data and spelling in the 'Thing State' event.

For troubleshooting purposes, try clearing the Thing Name and Attribute Name fields which will make the plugin match all subscribed attribute events.

If you receive the message "Error: The disclaimer has not been accepted" when trying to add a Task widget, launch the Tasker app and accept the disclaimer that is shown.

In this tutorial, we will briefly demonstrate how to use Tasker and SharpTools to create an accurate and effective custom presence solution for SmartThings. The built-in presence feature of the SmartThings mobile application has been criticized for randomly indicating that a person is no longer present in their home (when they are sleeping or sitting on the couch).

At the end of the tutorial, you will have a custom presence solution using the proximity to your WiFi access point as the trigger for determining your presence. Additionally, the tutorial provides commentary on areas where you might choose to use alternative methods/customization that would better determine presence for your home.

Requirements:

Optional: AutoLocation - fused location provider plugin for TaskerAlternatively, you can also use the built-in Tasker location providers

If you are interested in setting up a high accuracy presence solution with AutoLocation, @destructure00 from the SmartThings Community has a fantastic write-up showing how to set nested geofences which balance high-accuracy with great battery life.

You should now have a new 'Custom Presence' device listed in your SmartThings mobile app. Unlike normal presence devices, you can manually control this presence device setting it to 'not present' (away) or 'present' (arrived). Continue to the instructions below to see how we can use this simulated presence device along with Tasker to create an accurate and effective presence device.

Create a context for entering/leaving your defined area

In this section, we will explain how to create a Tasker context for which will trigger when you enter or leave your defined area. Note that there are many different approaches to determining location and only a few of those are noted here. So if you have other ideas on how you might be able to more effectively determine your location, feel free to use those.

GPS - Latitude/Longitude positioning (example)

WiFi - proximity or connection to a particular Access Point (example)

Cellular - proximity or connection to cellular towers in the area (example)

In order to keep this tutorial accessible to the broadest audience, we are going to use the 'WiFi Near' condition that is built into Tasker. GPS, WiFi, and Cellular options are built-in to Tasker, but we have found that the Fused Location via AutoLocation provider provides the best accuracy both indoors and outdoors (particularly when WiFi is left on).

Open Tasker

From the Profiles tab, click the '+' icon at the bottom of the screen.

Select the 'State' context > Net > Wifi Near

In the SSID field, press the search icon to list the nearby access points

Select your preferred access point from the displayed listNote: the SSID field should get filled in with your access point's name (SSID)

Press the back button on your mobile device to save the ContextNote: Continue onto setting up the action in the section below.

Wifi Near does regular Wifi Scans and will activate when it recognizes an AP you have configured is nearby. Note: you don't have to connect to the AP. You could configure e.g. the neighbours AP if the signal is strong enough.

Check the Wifi Toggle box if you don't want wifi on all the time. It will then be toggled when Tasker needs to do a scan. This isn't needed in In Android 4.4+ if you select Scanning Always Available in Advanced Wifi Settings and will save power.

Set the Simulated Presence Device to present or away

Following the previous section where we had just completed setting up the context of a Tasker profile and had just clicked the back button to save the context.

After setting up the context section of the profile, you should now be prompted to setup or select a TaskNote: You can also setup the task outside of a profile by opening Tasker and switching to Tasks tab.

Select the 'New Task +' option

Optionally, enter a Task Name and click the checkmark to continue.Note: At this point, we are creating the task for the 'enter' portion of the context (eg. the WiFi is nearby). Later we will create an 'exit' condition for when the Wifi AP is not nearby.

Press the back button one last time to exit out of Tasker and activate the newly created profile

Closing Comments

At this point, Tasker is setup to check to see if you are in range of your Wifi access point and will automatically change the presence sensor to arrived when you are near the Wifi access point and away if you are no longer in range of the access point.

We used the 'Wifi Near' Tasker context in this example to as it is included with Tasker and is easy to understand. Note that the author of this article recommends the AutoLocation plugin which provides a fused location provider which can provide a more flexible geolocation solution. As you might guess, the 'Wifi Near' context is dependent on being able to detect the access point... so if for some reason there are connectivity issues with the access point, the phone will trigger the exit condition.

The fused location provider in AutoLocation helps get around this by using a geofence and location determined using Wifi+GPS+Cellular so there is a bit of fail-over built into the provider. The geofence capabilities of Autolocation also provide a visual representation your location and makes it easier to increase the size of the circle to reduce false alarms.

Other Community Thoughts

Resiliency and Retries: You may be interested in adding more resiliency to your profiles through the use of retries. Some users have found that the transition from Wifi to Cellular (or vice-a-versa) can cause the SharpTools commands to timeout while the network is unavailable.

Hellfire51 put together a nice example showing how to add retries to your profile:

Prompt to unlock doors: You may decide that you don't want your phone to automatically perform an action for you. For example, you may prefer the phone to display a notification or prompt asking you if you really want to perform the action.

eibyer put together an example showing how to use custom presence to trigger a prompt asking if he wants to manually unlock his doors

In this tutorial, we will briefly demonstrate how to use Tasker, AutoVoice, and SharpTools to use voice commands to control devices in your smart home using variables. If you are looking for a more basic tutorial on controlling your devices, see here - and if you are interested in just the details of dimming a light (without voice control), see here. At the end of the tutorial, you will be able to say Okay Google, Dim the bedroom light to 60 percent. and your phone will send a command to your Bedroom Light to change the dimming level.

In this tutorial, we will briefly demonstrate how to use Tasker, AutoVoice, and SharpTools to query the status of devices in your home. At the end of the tutorial, you will be able to say Okay Google, is the bedroom light on? and your phone will check the status of the light and say the status as a voice response (eg. "The bedroom light is on" or "The bedroom light is off").

Instructions

Tap the Speak Filter option and say the following when prompted:Is the bedroom light on

Select the option that matches your query from the list that is presented to you.Note: AutoVoice will attempt convert your voice command into text and will display the list of options with the most likely option in the first position.

Check the Exact Command box

Select the checkmark at the top of the screen to save your plugin settings

Press the back button on your phone to save the Tasker event profile

At the prompt to select a Task, select New Task

Leave the optional Task Name blank and click the check mark to continue

Click the + icon at the bottom of the screen to add an action

Choose Plugin > SharpTools> Thing: Get Attribute

Click the pencil icon to configure the SharpTools plugin

Select the 'Thing' you want to check the status ofExample: Bedroom Light

Select the attributeExample: switch

Press ApplyNote: the names of the Tasker variables that will be set are displayed at this point

Press the back button on your phone to save the SharpTools Action

Click the + icon at the bottom of the screen to add another action

Choose Alert > Say

In the Text field, enter: The bedroom light is %st_attr_value

Press the back button on your phone to save the Say Action

At the bottom of the screen, press the play icon to test the TaskNote: With Tasker 4.6+ you will see a play icon next to each Action in the task as it is executed

Press the back button again to close out the Task Edit

Press the back button one more time to back out of Tasker completely and ensure the profile becomes active

Other Thoughts:

This approach can be used to answer other queries like:

What temperature is the AC set to?

AutoVoice filter: What temperature is the AC set to

Thing: Downstairs AC

Attribute: thermostatSetpoint

Is the front door locked?

AutoVoice filter: Is the front door locked

Thing: Front Door

Attribute: lock

Did I leave the garage open?

AutoVoice filter: Did I leave the garage open

Thing: Garage

Attribute: contact or door or switch (depends on device type)

The same concept applies as was used in the instructions above. Simply swap out the AutoVoice filter for your updated query and replace the thing and attribute in the Thing: Get Attribute configuration.

If you don't want to have the response spoken aloud, you might consider using the Alert > Notify or Alert > Flash action to have the result of the attribute query displayed on screen.

Many devices have several different attributes that may be of interest to you, so play around and see what's out there. For example, in addition to pulling in the thermostatSetpoint, you might also be interested in pulling in the thermostatMode to see if it is set to heat or cool.

Dynamic Queries

You can also use the `Thing: Get Attribute` plugin with variables to get the current status of many of your things at once or to use variables to get the status of a desired device. To do this, tap the tag icon in the top action bar to switch to variable mode.

Once you have switched the plugin into variable mode, you can either directly enter a string into the fields or you can use a Tasker variable (eg. %device)

For example, if we wanted to setup a profile that allowed us to ask 'Is the [device] on?', we could change the voice query from above to use AutoVoice's RegEx feature to allow us to dynamically ask if a device is on using a query like:

AutoVoice Filter: (?<q>Is|Are) the (?<device>.+?) (?<onoff>on|off|on or off|off or on)

Note: Make sure the "Use RegEx" box is checked in AutoVoice when using this approach -- this will convert the funky groups in parenthesis to variables that get captured.

Then in the `Thing: Get Attribute` plugin we would use the following configuration:

Thing: %device

Attribute: switch

And finally, we could spit out the result using an action like Alert > Flash:

Text: The %device is %st_attr_values(1)

Important: When you are using `Thing: Get Attribute` in variable mode, the response changes from a set of single-value strings to a set of string arrays.

When you are using `Thing: Get Attribute` for a single device (Eg. with the drop-downs), you'll get the following variables:

%st_attr_name

%st_attr_value

%st_thing_id

%st_thing_name

When you use `Thing: Get Attribute` in variable mode, you'll get the following variables (which are each arrays):

%st_attr_names()

%st_attr_values()

%st_thing_ids()

%st_thing_names()

For more information on variable arrays in Tasker, see the documentation linked below:

Select the setLevel commandNote: after selecting the setLevel command, parameter fields should become available

Enter the following settings in the parameter fields:
Parameter 1: 50
Parameter 2: 0Note: Some devices, like GE Links, will only work with one parameter. See the notes below.

Press Apply to save your settingsNote: If prompted to unlock Tasker/Widgets, follow the prompt to either start the trial or perform the In-App-Purchase

Press the back button to save your Task

From the Task Edit screen, press the play icon at the bottom of the screen to test your Task

Setting up the Task is just one part of having a complete Tasker setup. Check out the Introduction to Tasker article to better understand how a Task fits with a Context or the Voice Control Things articles for an example.

Widgets

Each phone/launcher has different ways to add widgets to your homescreen. This guide assumes the reader has knowledge of how to add a widget to their homescreen.

Follow the steps for your launcher to pick a Widget/Shortcut to be added your homescreen

Select the setLevel commandNote: after selecting the setLevel command, parameter fields should become available

Enter the following settings in the parameter fields:
Parameter 1: 50
Parameter 2: 0Note: Some devices, like GE Links, will only work with one parameter. See the notes below.

Press Apply to save your settingsNote: If prompted to unlock Tasker/Widgets, follow the prompt to either start the trial or perform the In-App-Purchase

Note: Many launchers display the list of widgets after a long press of the homescreen or within their app drawer. Several of the SharpTools widgets are actually shortcuts and some launchers, like Nova Launcher, group these separate from traditional widgets.

Notes

Parameter 1 is the percentage we would like to dim to (eg. 50 = 50%)

Parameter 2 is the duration over which we would like to dim

Only certain devices actually accept this value. You must enter a value even if your device does not support dimming over a duration.

For an immediate dim or for devices that don't support dimming over a duration , enter 0

Some devices, like GE Link light bulbs, will only dim when using 1 parameter for setLevel

These devices still report that 2 parameters are required from SmartThings, so you must override the settings

From the 'A Thing' configuration screen, open the menu and check the box for 'Override Parameters'

You should now see 'X' icons show up to the right of each parameter field. Click the 'X' next to Parameter 2.

Follow the instructions above as normal, ignoring Parameter 2.

The device type must support the setLevel command to perform dimming

This is supported with the out-of-the-box Dimmer Switch types and the Better Virtual Dimmer device types.

Some custom launchers do not support adding a Shortcut widget (like those used with SharpTools). Make sure your launcher supports adding Shortcuts or use a launcher like the Google Now Launcher.