Tasker Profile & Virtual Switch

OK, I probably should be able to figure this one out, but how can I use a SmartThings Virtual Switch as a Profile Trigger in Tasker? Is it an Event or a State in Tasker? I assume an Event. I want to do something if the Switch turns one. I used SharpTools Thing State and entered the name of my Virtual Switch (SimpliSafe Alarm) and the attribute (Switch). However, how do I tell Tasker to check for when it turns on? Maybe it doesn’t. Maybe it just checks a change in the Switch? And then I have to check %st_attr_value in my Task as to whether it’s off or on and then act accordingly? Or what? Thanks.

Yes, it would be an Event triggered profile in Tasker. You can find some details on how do use the Event Triggers including how to manually setup the subscriptions and some example filter approaches here:

And the following article has some tips on how to make your Tasker profile conditional upon only a certain value being triggered (you were spot in with checking the %st_attr_value):

1 Like

@Richard_Belthoff here is a quick down and dirty profile of what you want to do. Remember to have subscribed to the virtual switch in the SharpTools android app.

Profile: React To Virtual Switch (363)
	Restore: no
	Event: Thing State [ Configuration:Location: Home
Thing: Test toggle
Attribute: ALL

Triggered when an attribute matching the filters changes.

IMPORTANT: Be sure to manually subscribe to the desired attribute in the main SharpTools app by long-pressing on the desired thing. ]
Enter: Do Stuff (364)
	A1: Thing: Get Attribute [ Configuration:Location: Home
Thing: Test toggle
Attribute: switch Timeout (Seconds):15 ] 
	A2: Flash [ Text:%st_thing_name
%st_attr_name
%st_attr_value Long:Off ] 

https://taskernet.com/shares/?user=AS35m8kLVYpQzE2Ri%2BV1S4lWek3qc%2Fk79TW0Knshz%2FSqTwSYsWfU2xsyKBBLewFS18Id&id=Profile%3AReact+To+Virtual+Switch

Thanks. I will check it out. I haven’t gotten mine working just right yet but yours should get me started on the right course.

Thanks for sharing!

PS. If the Tasker Profile is triggered based on a SharpTools Event Trigger in Tasker, you do not need the A1 action of querying the Thing Attribute as the various Tasker variables are already set based on the event data.

@josh you are correct.

1 Like

Work great, thanks. My problem was I never subscribed to the Switch even though you are warned to do so when you create the profile. :slight_smile:

1 Like