www.homeseer.com    
 

Go Back   HomeSeer Message Board > Media Plug-ins > Media Discussion > PI-SonosController (3P)

PI-SonosController (3P) Discussion of Sonos Controller Plug-in

Reply
 
Thread Tools Display Modes
  #21  
Old December 14th, 2010, 02:01 PM
dcorsus dcorsus is offline
OverSeer
 
Join Date: Mar 2010
Location: California
Posts: 3,491
Quote:
Originally Posted by fran_joel View Post
Thank you for your quick reply Dirk !

Basically yes...

It could be a button included along with the "Genre", "Tracks", "Artists"... buttons that would be labeled "Line inputs" or something similar.

Pressing that button would then list all the available line inputs connected to the various zone players (including Homeseer) and allow the user to select which one any particular zone player should channel...
(I think this is one of the best feature of Sonos actually : ie listen to any source, aywhere...)

Is that feasible ?
Shouldn't be too hard, check back here, with some luck, should be done by the weekend

Dirk
Reply With Quote
  #22  
Old December 14th, 2010, 02:13 PM
fran_joel's Avatar
fran_joel fran_joel is offline
Seer Master
 
Join Date: Oct 2003
Location: Ottawa, Canada
Posts: 827
Thumbs up

Quote:
Originally Posted by dcorsus View Post
Shouldn't be too hard, check back here, with some luck, should be done by the weekend

Dirk
Awesome thank you... !

This feature would be very useful for me.
Reply With Quote
  #23  
Old December 15th, 2010, 02:15 AM
dcorsus dcorsus is offline
OverSeer
 
Join Date: Mar 2010
Location: California
Posts: 3,491
Quote:
Originally Posted by fran_joel View Post
However, unless I am mistaken, I dont see any option allowing one to select line-inputs to feed the zone players.

Homeseer is obviously one such input but I have several other sources connected to various players and I use these sources to feed music to various Zone as I see fit.

I would very much like to specify which line-in input a specific players should play (beside homeseer TTS and stuff from the music library)

Just posted version .48 (http://board.homeseer.com/showpost.p...45&postcount=1) which supports selecting Line Inputs. Please post if all looks OK.

Thanks

Dirk
Reply With Quote
  #24  
Old December 15th, 2010, 08:12 AM
fran_joel's Avatar
fran_joel fran_joel is offline
Seer Master
 
Join Date: Oct 2003
Location: Ottawa, Canada
Posts: 827
Will look into it, most probably tonight.

Thx.
Reply With Quote
  #25  
Old December 20th, 2010, 11:19 AM
fran_joel's Avatar
fran_joel fran_joel is offline
Seer Master
 
Join Date: Oct 2003
Location: Ottawa, Canada
Posts: 827
Hi Dirk,

Sorry I didn't have the time to install your upgrade and play with it yet...

I'll report back once I had a chance to look at it.

Joel
Reply With Quote
  #26  
Old December 21st, 2010, 09:53 AM
Flame
Guest
 
Posts: n/a
I have a problem initializing the Sonos plugin when HS is running as a Service. When the computer restarts and starts HS service the sonos plugin fails to initialize. Then if I manualy restart only the HS service, the plugin initilizes corectly and I have to enable it. Does anybidy else experience the same behavior of the plugin?
Reply With Quote
  #27  
Old December 21st, 2010, 11:22 AM
dcorsus dcorsus is offline
OverSeer
 
Join Date: Mar 2010
Location: California
Posts: 3,491
Quote:
Originally Posted by Flame View Post
I have a problem initializing the Sonos plugin when HS is running as a Service. When the computer restarts and starts HS service the sonos plugin fails to initialize. Then if I manualy restart only the HS service, the plugin initilizes corectly and I have to enable it. Does anybidy else experience the same behavior of the plugin?
Flame, what version of plug-in and HS are you running? I used to run HS as a service, including the plug-in, but stopped doing that because I had issues with the speaker client. Is it possible to set the debug flag in the setup screen, save it, set HS as service, restart computer and send me the full HS log. Would be interested to see where it gets stuck. I'll try tonight here on my set-up as well. Any special firewall or antivirus SW activated on that PC or anything else that may prevent access to Ethernet at start-up?

edit: Just tested it on a Vista machine, see no issue w/ running as a service. Suggest you take debug log file.
second edit: just tested it on a win7 machine, see no issue running it as a service

Dirk

Last edited by dcorsus; December 21st, 2010 at 12:27 PM.
Reply With Quote
  #28  
Old December 21st, 2010, 03:47 PM
Flame
Guest
 
Posts: n/a
Dirk,

Here is part of the log file when the HS service starts, during windows start:


12/20/2010 8:19:06 PM ~!~Startup~!~*********************************************** *********************************
12/20/2010 8:19:06 PM ~!~Startup~!~ HomeSeer version 2.5.0.4 (Service Mode) Starting Now (PRO Build)
12/20/2010 8:19:06 PM ~!~Startup~!~*********************************************** *********************************
...

12/20/2010 8:19:14 PM ~!~Startup~!~Checking for available plug-ins
12/20/2010 8:19:14 PM ~!~Plug-In~!~Found plug-in: ActiveBackup Plugin, version: 2.0.0.26
12/20/2010 8:19:14 PM ~!~Plug-In~!~Found plug-in: BLLAN, version: 1.0.6.0
12/20/2010 8:19:15 PM ~!~Plug-In~!~Found plug-in: HSTouch Server, version: 1.0.0.33
12/20/2010 8:19:15 PM ~!~Plug-In~!~Found plug-in: HSTouch Android, version: 1.0.0.0
...

12/20/2010 8:20:27 PM ~!~Info~!~HS Compatibility, cannot access plug-in HSPI_SONOSCONTROLLER.HSPI ActiveX component can't create object
12/20/2010 8:20:27 PM ~!~System~!~Registering HSPI_SONOSCONTROLLER.dll with Windows
12/20/2010 8:20:29 PM ~!~Info~!~HS Compatibility, cannot access plug-in HSPI_SONOSCONTROLLER.HSPI ActiveX component can't create object
12/20/2010 8:20:29 PM ~!~Error~!~Unable to access plugin: HSPI_SONOSCONTROLLER.dll, try reinstalling plug-in



After HS service starts, I manually restart the HS service and there is no error in the SONOSCONTROLLER initialization.

I'm using Latest version " SONOSCONTROLLER, version: 1.0.0.48" and "HomeSeer version 2.5.0.4 (Service Mode)" . The antivirus program is the current version of Avast.
Also "SONOSCONTROLLER is running as a trial, 10 days remaining."




Flame
Reply With Quote
  #29  
Old December 21st, 2010, 03:58 PM
dcorsus dcorsus is offline
OverSeer
 
Join Date: Mar 2010
Location: California
Posts: 3,491
Quote:
Originally Posted by Flame View Post
12/20/2010 8:20:27 PM ~!~Info~!~HS Compatibility, cannot access plug-in HSPI_SONOSCONTROLLER.HSPI ActiveX component can't create object
12/20/2010 8:20:27 PM ~!~System~!~Registering HSPI_SONOSCONTROLLER.dll with Windows
12/20/2010 8:20:29 PM ~!~Info~!~HS Compatibility, cannot access plug-in HSPI_SONOSCONTROLLER.HSPI ActiveX component can't create object
12/20/2010 8:20:29 PM ~!~Error~!~Unable to access plugin: HSPI_SONOSCONTROLLER.dll, try reinstalling plug-in



After HS service starts, I manually restart the HS service and there is no error in the SONOSCONTROLLER initialization.

I'm using Latest version " SONOSCONTROLLER, version: 1.0.0.48" and "HomeSeer version 2.5.0.4 (Service Mode)" . The antivirus program is the current version of Avast.
Also "SONOSCONTROLLER is running as a trial, 10 days remaining."
Hi Flame,

not really sure what to think about this except that HS seems to have no access for some reason to the DLL. Maybe you can check the security file settings for the hspi_sonoscontroller.dll and compare it with other DLL or other files in the same directory (your HS root directory or <hsroot>\bin). Do you have different users configured on that PC? Is HS and the Plugin installed as "for all users" or "admin"?

Can't think of anything else. Maybe a question to be forwarded to the HS guys.

I'll give it some more thought and maybe play with some ACL settings (I do have them turned off on my PCs)

Dirk
Reply With Quote
  #30  
Old December 21st, 2010, 04:31 PM
Flame
Guest
 
Posts: n/a
Dirk,
There is only one user account set on the pc and it is administrator, "Require password" is OFF. I can't check the individual plugins security permissions right now. I'll check them tonight. If the permissions are the problem, why it works after restarting the service.
Reply With Quote
  #31  
Old December 21st, 2010, 04:45 PM
dcorsus dcorsus is offline
OverSeer
 
Join Date: Mar 2010
Location: California
Posts: 3,491
Quote:
Originally Posted by Flame View Post
Dirk,
There is only one user account set on the pc and it is administrator, "Require password" is OFF. I can't check the individual plugins security permissions right now. I'll check them tonight. If the permissions are the problem, why it works after restarting the service.
I'm assuming (and I could be very wrong .. not a MicroSoft expert) that running it at start-up as a service requires it to run in a different "group" or "username" than when you are logged in like group "Adminstrators" versus "Users". As you can see, I'm just guessing here a bit. There are postings out there where a DLL couldn't be registered (had it myself) when UAC is turned on in Vista/Win7 (http://board.homeseer.com/showthread...250#post926250). Do you have User Account Controller On, if so, turn it off and see if it makes a difference.

Dirk
Reply With Quote
  #32  
Old December 22nd, 2010, 01:10 AM
Flame
Guest
 
Posts: n/a
Cool

Dirk,

I found the problem. Avast antivirus is taking time to initialize and is not enabling the network until is done. During that time HS service is trying to validate the plug-ins, and is failing to do it with the SonosControler, because the network is not available yet. To solve it , I changed the HS Service option for "Startup Type:" from "Automatic" to "Automatic (Delayed Start)". This new option for windows services is available only in Win 7 and WS 2008. Now it's working. It initializes the Sonoscontroler plug-in correctly.

Regards,
Plamen
Reply With Quote
  #33  
Old December 22nd, 2010, 01:18 AM
dcorsus dcorsus is offline
OverSeer
 
Join Date: Mar 2010
Location: California
Posts: 3,491
Quote:
Originally Posted by Flame View Post
Dirk,

I found the problem. Avast antivirus is taking time to initialize and is not enabling the network until is done. During that time HS service is trying to validate the plug-ins, and is failing to do it with the SonosControler, because the network is not available yet. To solve it , I changed the HS Service option for "Startup Type:" from "Automatic" to "Automatic (Delayed Start)". This new option for windows services is available only in Win 7 and WS 2008. Now it's working. It initializes the Sonoscontroler plug-in correctly.

Regards,
Plamen

Great! Thanks for posting an update.
Enjoy the plug-in
Dirk
Reply With Quote
  #34  
Old December 29th, 2010, 06:50 PM
PosterBoy PosterBoy is offline
Seer
 
Join Date: May 2008
Location: Arizona
Posts: 45
Hi Dirk

Would it be possible to add a way to dynamically select the zones to be linked for making announcements. Having to create static configurations for all the possibilities is not ideal for me

Thanks

Kent
Reply With Quote
  #35  
Old December 29th, 2010, 07:24 PM
dcorsus dcorsus is offline
OverSeer
 
Join Date: Mar 2010
Location: California
Posts: 3,491
Quote:
Originally Posted by PosterBoy View Post
Hi Dirk

Would it be possible to add a way to dynamically select the zones to be linked for making announcements. Having to create static configurations for all the possibilities is not ideal for me

Thanks

Kent
Hi Kent,

what would you use to dynamically select zones? Are we talking about using scripting or can you give an example of what you have in mind. You can call the plug-in methods directly from a script, I'd be more then happy to post an example if you tell me what you want to achieve. I have published all the methods that are part of the HS MusicAPI and a bit reluctant to publish every method, as they tend to change, but the few methods to link/unlink are very simple and I can add them to the API documentation if that's what you have in mind.

Dirk
Reply With Quote
  #36  
Old December 29th, 2010, 08:02 PM
PosterBoy PosterBoy is offline
Seer
 
Join Date: May 2008
Location: Arizona
Posts: 45
I am making the calls from a script. An example would be very helpful, and adding the link/unlink calls to the API documentation would be perfect.

Thanks for the fast response

Kent

Last edited by PosterBoy; December 29th, 2010 at 08:14 PM.
Reply With Quote
  #37  
Old December 29th, 2010, 08:37 PM
dcorsus dcorsus is offline
OverSeer
 
Join Date: Mar 2010
Location: California
Posts: 3,491
Quote:
Originally Posted by PosterBoy View Post
I am making the calls from a script. An example would be very helpful, and adding the link/unlink calls to the API documentation would be perfect.

Thanks for the fast response

Kent
You need to be a bit more specific in what you plan to do. Is this for an announcement that comes from an audio line input or is this to link zones to play music? Is there an expectation that you should "revert" to previous state, if so, the only way to do that properly is to go to pre-populate them. Even pre-populating 20 different configurations can be done within a few minutes ......

Here is an example to Link one player to the input of another player. It doesn't store state and not sure what you want to do to unlink

Sub LinkAZoneToAudioInput(ByVal SourceZoneName As String, ByVal DestinationZoneName As String)
Dim pi As Object
pi = hs.Plugin("SONOSCONTROLLER")
If pi Is Nothing Then
hs.writelog("Script", "empty")
Exit Sub
End If
Dim MusicApi
Try
MusicApi = pi.GetMusicAPI(DestinationZoneName) ' specify here which Zone you want to use as stream the input to
Catch ex As Exception
hs.writelog("Script", "Music API not found")
Exit Sub
End Try
Try
MusicApi.PlayLineInput(SourceZoneName) ' specify here which Zone you want to use the audio input from
Catch ex As Exception
hs.writelog("Script", "Error in calling PlayLineInput with error = " & ex.message)
Exit Sub
End Try
End Sub

Dirk
Reply With Quote
  #38  
Old December 29th, 2010, 08:53 PM
PosterBoy PosterBoy is offline
Seer
 
Join Date: May 2008
Location: Arizona
Posts: 45
It is for an announcement that comes from a line input. I want each zone to go back to it's old state after the script completes. I have 6 zones, and the number of permutations to cover all of that gets a little ugly. I already have a script that parses a | separated list of zone names working with one of the older Sonos control packages. I guess I can take my parsing code and just create a look up table to the configurations I make and issue an error to any of the combos I hit that I am too lazy to make.

Kent
Reply With Quote
  #39  
Old December 29th, 2010, 09:22 PM
PosterBoy PosterBoy is offline
Seer
 
Join Date: May 2008
Location: Arizona
Posts: 45
Quote:
Originally Posted by PosterBoy View Post
It is for an announcement that comes from a line input. I want each zone to go back to it's old state after the script completes. I have 6 zones, and the number of permutations to cover all of that gets a little ugly. I already have a script that parses a | separated list of zone names working with one of the older Sonos control packages. I guess I can take my parsing code and just create a look up table to the configurations I make and issue an error to any of the combos I hit that I am too lazy to make.

Kent
I guess in order to do what I need, we would need some sort of GetZoneState, and RestoreZoneState functions. I will certainly work around it, but this is the suggestion thread, so I figured I would add it.

Kent
Reply With Quote
  #40  
Old December 30th, 2010, 02:05 PM
dcorsus dcorsus is offline
OverSeer
 
Join Date: Mar 2010
Location: California
Posts: 3,491
How to Link from scripts

Quote:
Originally Posted by PosterBoy View Post
It is for an announcement that comes from a line input. I want each zone to go back to it's old state after the script completes. I have 6 zones, and the number of permutations to cover all of that gets a little ugly. I already have a script that parses a | separated list of zone names working with one of the older Sonos control packages. I guess I can take my parsing code and just create a look up table to the configurations I make and issue an error to any of the combos I hit that I am too lazy to make.

Kent
Hi Kent,

here is my suggestion. There are methods to add your own Linkgroup to the .ini file from scripts. Assuming you don't have overlapping Link events, you can just use the same name, if you have overlapping Link event, you would need different LinkgroupNames. Here is the code example, you can also find it in the SonosController.vb file which you can find in the scripts subdirectory.


PHP Code:
Sub LinkAGroupOfZones(ByVal LinkGroupName As StringByVal SourceZoneName As StringByVal DestinationZonesString As String)
    
'Sub LinkAGroupOfZones(ByVal SourceZoneName As String)

    Dim pi As Object
    '
Example Dim LinkgroupName As String "Test"
    'Example Dim SourceZoneName As String = "Family Room"
    '
Example Dim DestinationZonesString As String "Master Bedroom;20;1|Kitchen;20;1"
    
pi hs.Plugin("SONOSCONTROLLER")
    If 
pi Is Nothing Then
        hs
.writelog("Script""empty")
        Exit 
Sub
    End 
If
    Try
        
pi.SetLinkgroupZoneSource(LinkgroupNameSourceZoneName' store the zone source info
    Catch ex As Exception
        hs.writelog("Script", "Error in calling SetLinkgroupZoneSource with error = " & ex.message)
        Exit Sub
    End Try
    Try
        pi.SetLinkgroupZoneDestination(LinkgroupName, DestinationZonesString) ' 
store the zone destination info
    
Catch ex As Exception
        hs
.writelog("Script""Error in calling DestinationZonesString with error = " ex.message)
        Exit 
Sub
    End 
Try
    Try
        
pi.HandleLinking(LinkgroupNameTrue' Link!
    Catch ex As Exception
        hs.writelog("Script", "Error in calling HandleLinking with error = " & ex.message)
        Exit Sub
    End Try
End Sub

Sub UnLinkAGroupOfZones(ByVal LinkGroupName As String)
    Dim pi As Object
    pi = hs.Plugin("SONOSCONTROLLER")
    If pi Is Nothing Then
        hs.writelog("Script", "empty")
        Exit Sub
    End If
    Try
        pi.HandleLinking(LinkgroupName, False) ' 
UnLink!
    Catch 
ex As Exception
        hs
.writelog("Script""Error in calling HandleLinking with error = " ex.message)
        Exit 
Sub
    End 
Try
End Sub 
You would call the procedure with your own LinkgroupName, the second parameter would be the zone name from the Sonos Player you use to stream the announcement from and the third parameter would be a string representing the zones you want to stream it to.

Note the DestinationZonesString should be of the format:

- ZoneName
- Separator ";"
- Volume as integer between 0 and 100
- Separator ";"
- Mute overwrite indicator where "0" means false

Because the "HandleLinking" method was declared Private, I had to recompile and post version .49

Let me know if this meets your requirement

Dirk
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:01 PM.


Copyright HomeSeer Technologies, LLC