Harmony Hub plugin

Posted on
Fri Jun 03, 2016 10:26 am
FlyingDiver offline
User avatar
Posts: 7265
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Harmony Hub plugin - BETA

autolog wrote:
I haven't been able to reproduce the error yet (just installed 0.2.4) - I will leave debugging on so that if it happens again, I will have the detail for you :)


Was there something else going on that was causing the plugin to restart constantly? Because the only time I actually hit the Logitech servers is when the device is started, which is creation or plugin restart. I'm actually anticipating that the session token I get from their server will expire after some period of time and I'll need to re-authenticate, but I don't know how long that takes and don't want to do it too often. So I'm sort of waiting for someone to report that error. I restart mine for development purposes way to often to get it myself. ;)

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

Posted on
Sat Jun 04, 2016 5:41 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Harmony Hub plugin - BETA

Just an update to say the problem hasn't reoccurred and I was using the Harmony Hub last night.

The one thing I hadn't done when I updated to 0.2.3 was to delete the device and re-install. When I installed 0.2.4 I deleted everything (including removing the plugin) and did a fresh install.

A few additional points I have noticed while testing the plugin:
  1. The State in the device list is empty, I recall previously it showed the currentActivityName
  2. Having created a new device, I renamed it from "New Device 2" to 'Harmony Hub' - the plugin debug messages continued to refer to it as 'New Device 2' making me think that the name hadn't been updated internally within the plugin? It corrected itself on a reload of the plugin. :)
  3. My hi-fi / TV etc is all run off a TKB plug that is off when it isn't being used. Ideally the Harmony Hub would show a status of disconnected when no contact can be made.
    Running a command (such as dump current activity to log) is getting a timeout error - if the hub is know to be disconnected then maybe the command shouldn't be allowed?

Posted on
Sat Jun 04, 2016 10:17 am
FlyingDiver offline
User avatar
Posts: 7265
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Harmony Hub plugin - BETA

Thanks for the feedback. I'll look at the state issue, I don't recall changing anything, but I'm not sure I ever implemented it right in the first place.

I've run into the name issue too. I'm not sure what method I need to implement to capture that correctly. I'll look into it.

As far as I know, the hub has no idea that you've shut off the equipment with the Z-wave plugin switch, so it has no way for me to tell it's disconnected. Is the hub on the switch too? I guess if I get a timeout from the hub I could change the status until I get another message. But I see timeouts kinda randomly sometimes, so it could go back and forth.

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

Posted on
Sat Jun 04, 2016 11:02 am
FlyingDiver offline
User avatar
Posts: 7265
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Harmony Hub plugin - BETA

1 and 2 are fixed in my development version, and will be in the next release.

Not sure what's to be done about #3.

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

Posted on
Sat Jun 04, 2016 11:24 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Harmony Hub plugin - BETA

The Hub is on the same TKB switch, so yes it is turned off as well.

I think if you get a timeout then flipping the status to disconnected until a valid message is received would be good. You could also then stop any command being sent to the hub until it came back online. At the moment if you issue a command while in this state, the plugin throws an error. For example, In my Squeezebox plugin, if a player is disconnected and a command is issued to it, I write a message to the log saying command has been ignored as the player is disconnected.

I don't know how common turning equipment off is but I don't like to have it on (or in standby) if it isn't going to be used. :)

Posted on
Sat Jun 04, 2016 12:36 pm
FlyingDiver offline
User avatar
Posts: 7265
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Harmony Hub plugin - BETA

autolog wrote:
The Hub is on the same TKB switch, so yes it is turned off as well.

I think if you get a timeout then flipping the status to disconnected until a valid message is received would be good. You could also then stop any command being sent to the hub until it came back online. At the moment if you issue a command while in this state, the plugin throws an error. For example, In my Squeezebox plugin, if a player is disconnected and a command is issued to it, I write a message to the log saying command has been ignored as the player is disconnected.

I don't know how common turning equipment off is but I don't like to have it on (or in standby) if it isn't going to be used. :)


OTOH, I'm not a big fan of turning off control equipment. YMMV.

Can you post the exact error message you're getting when the hub it turned off? I'll make the plugin a little smarter about dealing with that condition.

I'm concerned that suppressing sending to the hub may get the system in a situation that it won't correct itself. Like if the plugin registers with the hub, the hub gets shut off, then restarted, will the hub send anything to the plugin without the plugin attempting to talk to it first? I don't know how XMPP is supposed to deal with that situation.

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

Posted on
Sun Jun 05, 2016 8:18 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Harmony Hub plugin - BETA

OK - Here is some further testing using V0.2.4.

The hub is currently off with no power (TKB switch is off).

I execute an Action to turn the volume down and get this error:
Action Group Harmony Hub Test 1
Harmony Hub Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 444, in volumeDown
KeyError: ('-1',)



I then ran an action to Start Activity (Watch Apple TV) and got this error:
Action Group Harmony Hub Test 2
Harmony Hub Debug Harmony Hub: Start Activity - Watch Apple TV

Harmony Hub Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 400, in startActivity
AttributeError: 'Plugin' object has no attribute 'plugin'



I then turned on the TKB Switch to power the hub and waited for it to initialise (green light on hub). I then re-ran the previous action and then got this output:
Action Group Harmony Hub Test 2
Harmony Hub Debug Harmony Hub: Start Activity - Watch Apple TV
Harmony Hub Debug Harmony Hub: messageHandler: Event state notify, activityId = 12838999, activityStatus = 1
Harmony Hub Debug Checking Trigger Harmony Hub (216697977), Type: hubMessage
Harmony Hub Debug Checking Trigger Harmony Hub (216697977), Type: hubMessage
Harmony Hub Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 408, in startActivity
File "plugin.py", line 293, in triggerCheck
KeyError: key hubID not found in dict


Harmony Hub Debug Harmony Hub: messageHandler: Event state notify, activityId = 12838999, activityStatus = 2
Harmony Hub Debug Checking Trigger Harmony Hub (216697977), Type: hubMessage
Harmony Hub Debug Harmony Hub: messageHandler: Event startActivityFinished, activityId = 12838999, errorCode = 200, errorString = OK
Harmony Hub Debug Checking Trigger Harmony Hub (216697977), Type: hubMessage
Harmony Hub Debug Harmony Hub: messageHandler: Event state notify, activityId = 12838999, activityStatus = 2
Harmony Hub Debug Checking Trigger Harmony Hub (216697977), Type: hubMessage


The remote switched to show Watch Apple TV was active.

I then did a Power Off action and got the following:
Action Group Harmony Hub - Power Off
Harmony Hub Debug Harmony Hub: Power Off
Harmony Hub Debug Harmony Hub: messageHandler: Event state notify, activityId = 12838999, activityStatus = 3
Harmony Hub Debug Checking Trigger Harmony Hub (216697977), Type: hubMessage
Harmony Hub Debug Checking Trigger Harmony Hub (216697977), Type: hubMessage
Harmony Hub Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 425, in powerOff
File "plugin.py", line 293, in triggerCheck
KeyError: key hubID not found in dict

Harmony Hub Debug Harmony Hub: messageHandler: Event state notify, activityId = -1, activityStatus = 0
Harmony Hub Debug Checking Trigger Harmony Hub (216697977), Type: hubMessage
Harmony Hub Debug Harmony Hub: messageHandler: Event startActivityFinished, activityId = -1, errorCode = 200, errorString = OK
Harmony Hub Debug Checking Trigger Harmony Hub (216697977), Type: hubMessage
Harmony Hub Debug Harmony Hub: messageHandler: Event state notify, activityId = -1, activityStatus = 0
Harmony Hub Debug Checking Trigger Harmony Hub (216697977), Type: hubMessage



I then turned off the TKB switch so that the hub was powered off.

I then ran an action to Watch Fire TV and got the AttributeError: 'Plugin' object has no attribute 'plugin' error again.

Hope this helps :)

Posted on
Sun Jun 05, 2016 4:11 pm
FlyingDiver offline
User avatar
Posts: 7265
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Harmony Hub plugin - BETA

OK, first two errors are because I wasn't checking to see if there was an active Activity before trying to send activity specific command. Fixed in next release to not allow sending volume or activity commands if the system is in the PowerOff state. Which Indigo would think your system was if you turned off the hub after using the power-off command.

I'm not exactly sure what's going on with the rest of them, but I changed a lot of code in those areas to try to avoid these kinds of issues. We'll see how well I did.

For your specific scenario, where you're turning off the hub. I recommend you add an action to your shutdown action group that disables the HarmonyHub device. It's in the Server Actions area. Then add a command to reenable the device when you turn the hub on (after an appropriate delay). I think that's a more suitable solution than for me to write a lot of code trying to figure out if the hub's been turned off or on. I think that leaving the hub running all the time is the normal usage case.

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

Posted on
Sun Jun 05, 2016 4:12 pm
FlyingDiver offline
User avatar
Posts: 7265
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Harmony Hub plugin - BETA


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

Posted on
Mon Jun 06, 2016 1:51 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Harmony Hub plugin - BETA

FlyingDiver wrote:
... For your specific scenario, where you're turning off the hub. I recommend you add an action to your shutdown action group that disables the HarmonyHub device. It's in the Server Actions area. Then add a command to reenable the device when you turn the hub on (after an appropriate delay). I think that's a more suitable solution than for me to write a lot of code trying to figure out if the hub's been turned off or on. I think that leaving the hub running all the time is the normal usage case.

I will do that as I am already running actions when the power goes off and on.

Installed v0.2.5 and all seems to be working OK on initial testing. :)

Posted on
Mon Jun 06, 2016 2:20 am
aderrington offline
Posts: 116
Joined: Feb 03, 2015

Re: Harmony Hub plugin - BETA

Hi,

I'm loving the development of this plug in, I've only just started to implement it as a test but i've come across an issue.
When i try and create a button to send an activity command (Guide button to my virgin box - TIVO) it has an error.

Taken a screen grab for you.

Thank you for developing this plug in!
Andrew
Attachments
Tv Guide error.jpg
Tv Guide error.jpg (366.9 KiB) Viewed 3621 times

Posted on
Mon Jun 06, 2016 4:09 am
FlyingDiver offline
User avatar
Posts: 7265
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Harmony Hub plugin - BETA

aderrington wrote:
Hi,

I'm loving the development of this plug in, I've only just started to implement it as a test but i've come across an issue.
When i try and create a button to send an activity command (Guide button to my virgin box - TIVO) it has an error.

Taken a screen grab for you.

Thank you for developing this plug in!
Andrew


Please copy the complete error from the log and post it. I can't see all of it in the screen grab.

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

Posted on
Mon Jun 06, 2016 4:17 am
aderrington offline
Posts: 116
Joined: Feb 03, 2015

Re: Harmony Hub plugin - BETA

Hi Joe,

Heres the log.

Thank you!
Andrew

Code: Select all
Harmony Hub Debug               commandGroupListGenerator Activity: Watch TV, id: 16928587
  Harmony Hub Debug               commandListGenerator Activity: Watch TV, id: 16928587
  Harmony Hub Debug               commandGroupListGenerator Activity: Watch TV, id: 16928587
  Harmony Hub Debug               commandListGenerator Activity: Watch TV, id: 16928587
  Harmony Hub Debug               validateActionConfigUi sendActivityCommand
  Harmony Hub Error               Error in plugin execution UiValidate:

Traceback (most recent call last):
  File "plugin.py", line 741, in validateActionConfigUi
<type 'exceptions.NameError'>: global name 'targetId' is not defined

Posted on
Mon Jun 06, 2016 6:46 am
FlyingDiver offline
User avatar
Posts: 7265
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Harmony Hub plugin - BETA

Wow. I have no idea how I managed to break that.

Fixed in v0.2.6 available now.

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

Posted on
Wed Jun 08, 2016 5:40 am
Woetjes offline
Posts: 117
Joined: Apr 04, 2016
Location: Belgium

Re: Harmony Hub plugin - BETA

Hi Joe,

Sometimes I have a relatively long delay (+- 10-15 seconds) when starting an activity. Is this normal or is this due the authentication process?

Thanks,
Wouter

Page 6 of 13 1 ... 3, 4, 5, 6, 7, 8, 9 ... 13

Who is online

Users browsing this forum: No registered users and 3 guests

cron