Page 2 of 3

Re: Dayton Audio Controller Plugin

PostPosted: Sun Jun 26, 2016 10:45 am
by FlyingDiver
I forked your repository on GitHub, made the changes in that fork, and did a pull request. Trying to save you a little work. ;)

Got a question - It appears that no commands are processed by the amp for a zone if the zone is off. For instance, I can't change the zone source if the zone is off. Is that an artifact of the way the plugin handles the command, or an actual restriction on the hardware?

Re: Dayton Audio Controller Plugin

PostPosted: Sun Jun 26, 2016 8:24 pm
by RogueProeliator
Is that an artifact of the way the plugin handles the command, or an actual restriction on the hardware?

Unfortunately that seems to be the hardware; it basically ignores all commands sent without any response indicating it will not process (other than the status not changing for the selected command). I've been toying with having the plugin automatically send a Zone Power On command if you submit another command to a powered-off zone. Thoughts on that?

This is part of the reason that I don't usually turn zones on/off but rather just mute them.

I forked your repository on GitHub, made the changes in that fork, and did a pull request. Trying to save you a little work. ;)

Awesome, thanks... I was literally about to open that to take a look at fixing it and came here to read the forum first. Got it merged in!

Re: Dayton Audio Controller Plugin

PostPosted: Mon Jun 27, 2016 6:19 am
by FlyingDiver
RogueProeliator wrote:
Unfortunately that seems to be the hardware; it basically ignores all commands sent without any response indicating it will not process (other than the status not changing for the selected command). I've been toying with having the plugin automatically send a Zone Power On command if you submit another command to a powered-off zone. Thoughts on that?

This is part of the reason that I don't usually turn zones on/off but rather just mute them.


No, I don't think that's a good solution. Might cause the zone to start playing even if you didn't intend to.

I'll probably redo my control pages to put the mute control where I have the power control now, and move the power control to a secondary page.

Re: Dayton Audio Controller Plugin

PostPosted: Mon Jun 27, 2016 9:46 am
by RogueProeliator
No, I don't think that's a good solution. Might cause the zone to start playing even if you didn't intend to.

That's pretty much why I have not done it... but other (similar) hardware behaves such that if you set certain properties the zone automatically turns itself on; for instance, if you change the source of a zone on a Niles Audio receiver, it turns on if not currently powered on.

Since you are the only other one with an opinion and I don't really care that much since I try not to toggle on/off (unless major power failure maybe) then I will leave as-is.

Adam

Re: Dayton Audio Controller Plugin

PostPosted: Mon Jun 27, 2016 9:48 am
by FlyingDiver
Since I'm switching from power on/off to mute on/off on my control pages, I'm going to need to switch icons. All the ones I used previously have reversed meanings. Any suggestions? Unless I add an isNotMuted state, that is. Hmm...

Re: Dayton Audio Controller Plugin

PostPosted: Mon Jun 27, 2016 10:00 am
by RogueProeliator
Since I'm switching from power on/off to mute on/off on my control pages, I'm going to need to switch icons. All the ones I used previously have reversed meanings. Any suggestions? Unless I add an isNotMuted state, that is. Hmm...

I would just duplicate the icons and reverse the value of the +on / +off state under a new name. I think it is better to keep the states and properties a more "normal" meaning and change the name/look of the graphics. Otherwise triggers/conditions/scripts are a bit confusing (e.g. if states["isNotMute"] == True is sort of hard to read and understand)

Re: Dayton Audio Controller Plugin

PostPosted: Mon Jun 27, 2016 10:03 am
by FlyingDiver
RogueProeliator wrote:
I would just duplicate the icons and reverse the value of the +on / +off state under a new name. I think it is better to keep the states and properties a more "normal" meaning and change the name/look of the graphics. Otherwise triggers/conditions/scripts are a bit confusing (e.g. if states["isNotMute"] == True is sort of hard to read and understand)


Yeah, that's what I just did. I would like to find some nice looking Muted/NotMuted icons though.

Re: Dayton Audio Controller Plugin

PostPosted: Mon Jun 27, 2016 4:46 pm
by FlyingDiver
My testing this afternoon shows I can't change sources or volume when a zone is muted. Can you?

Re: Dayton Audio Controller Plugin

PostPosted: Mon Jun 27, 2016 8:35 pm
by RogueProeliator
My testing this afternoon shows I can't change sources or volume when a zone is muted. Can you?

Doesn't look like it... can't say that I had tried doing changes muted before (or rather hadn't paid attention at least). Volume not being set while muted is not all that unusual, but don't really see the point of not allowing source changes while muted. Still, ideally should be able to change ANY settings in any state if the receiver is active and responding.

These API's always seem to be a secondary thought for nearly every hardware company. :(

Re: Dayton Audio Controller Plugin

PostPosted: Sat Jul 02, 2016 4:11 pm
by FlyingDiver
Is the plugin scriptable?

Normally I could answer that question by looking at the plugin code, but with your custom framework I really can't tell.

I was trying to write an Action Group that would save the current source for a zone, change it, play an announcement, then change it back. As far as I can tell, there's no way with the defined actions to set a zone to a value saved in a variable. There's a menu command for sending an arbitrary command, but it's not exposed as an Action.

Re: Dayton Audio Controller Plugin

PostPosted: Sat Jul 02, 2016 8:02 pm
by RogueProeliator
Is the plugin scriptable?

Of course, it is a standard plugin, so you can write scripts to call actions in the standard way.

I was trying to write an Action Group that would save the current source for a zone, change it, play an announcement, then change it back. As far as I can tell, there's no way with the defined actions to set a zone to a value saved in a variable. There's a menu command for sending an arbitrary command, but it's not exposed as an Action.

I would use python script action... something like this should work:
Code: Select all
targetZoneDeviceId =123456789
zoneDev = indigo.devices[targetZoneDeviceId]
oldSource = zoneDev.states["source"]

daytonPlugin = indigo.server.getPlugin("com.duncanware.daytonAudioController")
daytonPlugin.executeAction("changeZoneSource", targetZoneDeviceId, props={"zoneSource":2})

... announcement code or other action or whatever...

daytonPlugin.executeAction("changeZoneSource", targetZoneDeviceId, props={"zoneSource":oldSource})

Re: Dayton Audio Controller Plugin

PostPosted: Sat Jul 02, 2016 8:14 pm
by FlyingDiver
Great, thanks.

Re: Dayton Audio Controller Plugin

PostPosted: Sun Jul 03, 2016 4:07 pm
by FlyingDiver
Final script, if anyone else is interested in doing something similar:

Code: Select all
alertSource = indigo.variables[430326258].value
alertText = indigo.variables[1786407594].value

daytonPlugin = indigo.server.getPlugin("com.duncanware.daytonAudioController")
if not daytonPlugin.isEnabled():
   return

devList = []
for device in indigo.devices.iter():
   if device.deviceTypeId == "daytonAudioZone":
      devList.append(device)
      daytonPlugin.executeAction("changeZoneSource", device.id, props={"zoneSource": alertSource})

indigo.server.speak(alertText, waitUntilDone=True)

for device in devList:
   daytonPlugin.executeAction("changeZoneSource", device.id, props={"zoneSource": str(device.states["source"])})

Re: Dayton Audio Controller Plugin

PostPosted: Sat Apr 08, 2017 9:40 am
by alphaboy
Seems like there might be a bug... I'm using 6 zone monoprice receiver and can't seem to set "Set Source (all Zones)" action group. The menu is completely blank- while I'm able to set individual source select action groups.

Any idea why this might be happening? Everything else seems to work!

Thanks for sharing this great plug-in!



Screen Shot 2017-04-08 at 11.24.53 AM.jpg
Screen Shot 2017-04-08 at 11.24.53 AM.jpg (371.4 KiB) Viewed 12254 times


Screen Shot 2017-04-08 at 11.24.07 AM.jpg
Screen Shot 2017-04-08 at 11.24.07 AM.jpg (390.75 KiB) Viewed 12254 times

Re: Dayton Audio Controller Plugin

PostPosted: Mon Apr 10, 2017 9:04 pm
by RogueProeliator
Sorry for the delay, was out of town for the weekend. I think that I found the issue -- I'll see if I can get a new version up tonight or tomorrow and will post to let you know.