Turn On/Off an activity

Posted on
Sat May 25, 2019 10:03 am
johnofcamas offline
Posts: 36
Joined: Jan 30, 2014

Turn On/Off an activity

How can I create a 'device' that can turn on / off a specific Harmony Hub Activity?

Posted on
Sat May 25, 2019 11:42 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Turn On/Off an activity

Create an Action Group that starts that activity.

Create an Action Group that stops that activity, which means a Power Off command.

Create a Virtual Device -> Virtual On/Off Device that uses those two action groups for on/off.

And yes, that seems like a lot of work for what should be simple. Feel free to create an enhancement request on the GitHub page for the plugin.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat May 25, 2019 11:52 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Turn On/Off an activity

Be aware that this minimalist implementation won't work properly with Siri (using HKB) because the virtual device doesn't maintain state. The device always looks like it's off so Siri won't ever send the actual off command.

I'll see if I can come up with a workaround. Adding virtual activity devices to the plugin would probably be easier. Hmmm.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat May 25, 2019 12:36 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Turn On/Off an activity

OK, to make it work with Siri (and I assume Alexa, but I'm not sure) you need a status variable to associate with the virtual device.

So, create an Indigo variable. Edit the Virtual Device settings. Enable status, and pick the variable from the list.

Now, you need TWO triggers. One to set the variable to true, another to set it to False.

Create a Trigger of type "Device State Changed". Pick the Harmony Hub device and the "Current Activity" state. Select "Becomes Equal to" and put in "PowerOff". Leave Condition to Always. Set the action to Variable Actions->Modify Variable, pick your status variable, then "Set to false". Save.

Repeat previous step, but this time you want "Becomes Equal to" to be the name of the activity you're starting. And set the status variable to True.

There's probably an easier way to do this with one of the plugins that does smarter virtual devices.

I really should add this directly to the plugin....

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun May 26, 2019 7:18 am
johnofcamas offline
Posts: 36
Joined: Jan 30, 2014

Re: Turn On/Off an activity

Brilliant! And thanks for anticipating my Siri question which would have been next :D

Posted on
Sat Jun 01, 2019 4:06 pm
denno offline
Posts: 90
Joined: Sep 17, 2004

Re: Turn On/Off an activity

Is it possible to do a similar thing with a Harmony device instead of an activity? Haven't been able to figure out how to do it.
I tried creating an Action Group to send a device specific command but there are no devices listed in the action settings dropdown.
I did enable XMPP.

Use case: my TV occasionally turns itself off. I'd like to be able to use Siri to turn it back on.
Attachments
2019-06-01_17-27-17.png
2019-06-01_17-27-17.png (218.14 KiB) Viewed 3805 times

Posted on
Sat Jun 01, 2019 5:56 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Turn On/Off an activity

The problem with making a Siri friendly switch for a device is that the plugin has no way to determine what the current state of the device is, so it might be a problem getting Siri to actually send the command.

I think HKB has a stateless switch type, so using that might make it work. Worth a try.


Sent from my iPhone using Tapatalk

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Jun 01, 2019 5:59 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Turn On/Off an activity

I just saw the second part of your post. As far as I remember that dialog should work. I’m not near a computer now so I can’t verify.

Do the formatted device dump from the menu an post it here.


Sent from my iPhone using Tapatalk

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Jun 01, 2019 9:18 pm
denno offline
Posts: 90
Joined: Sep 17, 2004

Re: Turn On/Off an activity

Device dump-
Attachments
2019-06-01 Events.txt
(97.68 KiB) Downloaded 147 times

Posted on
Sat Jun 01, 2019 9:27 pm
denno offline
Posts: 90
Joined: Sep 17, 2004

Re: Turn On/Off an activity

I just checked again and now my devices are showing up as expected

Posted on
Wed Jun 05, 2019 12:13 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Turn On/Off an activity

Activity devices now in pre-release 7.3.0: https://github.com/FlyingDiver/Indigo-H ... /tag/7.3.0

Please test.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest

cron