Custom widget to show temperature

(Shawn) #1

So I’ve been playing around with Tasker this weekend setting up some widgets for my lights, and would like to make one that reports the temperature of a multi-sense. I’ve spent hours looking, but I can’t seem to get the temperature into a widget using Minimilistic Text, Zooper, or Zoom. I have to be screwing something up passing the info along. I’ve followed 3 or 4 examples on how to do this, so I’m guessing it’s something small. Any chance someone could lend a hand on this?

(Joshua Lyon ( Dashboard)) #2

Here’s some instructions on doing this with Minimalistic Text. From our email discussions, you are using SharpTools, so these instructions are based around that.

  1. Open SharpTools, long press on the multi sensor, and subscribe to the temperature attribute
  2. In Tasker, create an event profile using Plugin > SharpTools > Thing State
  3. Configure the Thing State plugin with your device name and temperature attribute
  4. Add an action that updates a widget (Minimalistic Text, Zooper, Zoom) with the %st_attr_value

Note that the last step takes the temperature value as a variable from the Thing State event being triggered (by the subscribed temperature value changing) and updates the widget with that value.

And here’s some details on setting it up with Minimalistic Text:

  1. Add a Minimalistic Text widget to your home screen (typically done via a long press on your home screen or opening your app drawer and selecting widgets)
  2. Select a default layout (I chose the first one, but we are going to edit it, so it doesn’t really matter)
  3. Swipe over to Layout, hit the three dot menu over flow on the first row and delete it, then hit the plus icon at the bottom of the screen
  4. Swipe over to MISC and check the box next to Locale and hit OK at the bottom of the screen
  5. Tap the Locale box in the row layout to configure it. Enter a name for the variable like ‘mytemperature’
  6. Press OK. Make sure you press the Save icon at the top of the screen to save your changes.

Go back to Tasker to finish the configuration of the profile from above:

  1. In your Task, add a Minimalistic Text action and hit the pencil icon to configure it
  2. In the first field, enter ‘mytemperature’ for the variable name and enter %st_attr_value for the value field. Then press OK to save your configuration.
  3. Press back until you have fully backed out of Tasker which will save your changes and activate the profile.

PS. I’m on my mobile, so please excuse any typos and the lack of formatting.

(Shawn) #3

So now I can pass text from Taskers MT plug in, but I can’t get the actualtemp to appear. I can change the text in the Variable content, and it changes on the widget, but when I use %st_attr_value, that’s exactly what appears, not the actual temp. I’m also still having issues finding how to make the widget update with anything besides using time and selecting every 14 minutes. I’d like it to update whenever the temp changes. SOOOO close…

(Shawn) #4

SUCCESS!!! Well, sort of. I created a task using Plugin > SharpTools >Get Attribute, then used the Minimalistic plugin to pass the attribute to the widget. Now I just need to figure out the bit of getting the widget to update when the temp changes.

(Joshua Lyon ( Dashboard)) #5

Awesome - I am glad to hear you are making progress!

There are two different approaches to triggering the updates to your widget:

  1. Event Driven (eg. Thing State changing)
  • Event Profile > Thing State: this will react to the state change of a subscribed attribute
  • ‘Thing State’ is a profile/context in Tasker which triggers a set of actions
  1. Time / Other Context (eg. Every 15 minutes requesting the current status)
  • Action > Thing: Get Attribute: this tells SharpTools to go out and ask SmartThings for the current attribute value
  • ‘Thing: Get Attribute’ is an action which runs inside a triggered profile

Note that the event driven approach will only update the widget when an event actually occurs. So if you follow the steps I listed above and manually run the task, you will see the raw %st_attr_value show up in the widget since the push-event was not triggered. As soon as the temperature changes, the Tasker profile should be triggered and your actions will run which will update the widget with the changed value.

Also note that temperature values sometimes change as infrequently as once every few hours depending on the device type (sensitivity) and how much the temperature is changing where the sensor is. So if you follow the steps above, you may have to wait a few hours for the first widget update.

(Joshua Lyon ( Dashboard)) #6

Here’s a video I put together showing the steps mentioned above end-to-end. This is using the event driven approach, so it will update the widget automatically whenever the thing’s state changes: