more G-Labs products

Author Topic: Squeezebox on homegenie  (Read 10931 times)

March 31, 2015, 08:48:56 AM
Reply #30

igorrobertifoc

  • ***
  • Information
  • Full Member
  • Posts: 65
Nice, nolio. I can t test because I'm not at home  :'(
For me commands are instantaneous. Try to connect with putty and write manually commands. It's strange the delay and the missing mac address too.

Maybe I will add an installation  part on the how-to because I see you can configure in various mode . I use the connection with mysqueezebox.com


Top connection are the best way because you have access to all and you can have a feedback when for example the volume is changing.
Thx
« Last Edit: March 31, 2015, 08:50:55 AM by igorrobertifoc »

April 05, 2015, 10:38:01 AM
Reply #31

igorrobertifoc

  • ***
  • Information
  • Full Member
  • Posts: 65
Thx nolio,
i found a link with all features to integrate.

http://www.homegenie.it/docs/api/mig_api_upnp.html

NOW I understand what I have to implement

April 05, 2015, 11:07:14 AM
Reply #32

igorrobertifoc

  • ***
  • Information
  • Full Member
  • Posts: 65
Hello,
this is the refactoring of tthe code. I deleted the code not usefull. I will readd at the of the integration of AVmedia.

I need some help to integrate GetVolume. I think is the response not well formatted


April 05, 2015, 01:29:02 PM
Reply #33

dsa4055

  • **
  • Information
  • Jr. Member
  • Posts: 25
Hello

I have made a other Version last night with a Friend.
People can Change in the Automation Program in Squeezbox Option the:
 Radio Station, Language and what she say.(Media Server,Port and MacAdress)


THX  igorrobertifoc for the example

May 01, 2015, 02:04:40 PM
Reply #34

igorrobertifoc

  • ***
  • Information
  • Full Member
  • Posts: 65
Hi,
This is my last version. Is added the layer for the mediareceiver. Work good.

May 01, 2015, 04:30:28 PM
Reply #35

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Is that version includes the modifications proposed by Dsa4055 ?

May 01, 2015, 05:26:53 PM
Reply #36

igorrobertifoc

  • ***
  • Information
  • Full Member
  • Posts: 65
I removed the code for alert on motion and I leaved only the code for alarm.
This is because I undestood the structure of home genie.

This is only a connection for AV Media, motion on alert could be a second program that use an generic avmedia.

With this version, the module is always connected with the squeeyebox.

I have only a question, with the function 
Code: [Select]
Action<string> HandleMessageReceived = (string message) => {
      string[] msg = ((string)message).Split(' ');
      switch(msg[1])
              {
                case "mixer":
                if (string.Compare(Program.Parameter("HomeAutomation.SqueezeBox.volume").Value,msg[3]) != 0 && string.Compare(msg[2], "volume")==0) {
                    Program.Parameter("HomeAutomation.SqueezeBox.volume").Value = msg[3];
                    Program.RaiseEvent("HomeAutomation.SqueezeBox.volume", msg[3], "Squeeze box Volume");
                }
              }
    };

I catch the change of volume on Squeeyebox, how I can update the structure AVMEdia with the new volume number?

In other word, if I change volume on my squeeyebox I wold like to see on homegenie..

Thnk you

May 01, 2015, 08:04:51 PM
Reply #37

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
You have to get the value and put it yourself in the js code of your widget, in the function RenderView(..)

May 02, 2015, 07:50:12 AM
Reply #38

igorrobertifoc

  • ***
  • Information
  • Full Member
  • Posts: 65
Hello dani,
The widget is the generic widget of homegenie for av media. Do you know if there is a function to call for the refresh?

another question, the result of the function "AvMedia.Browse" where I can see on the generic widget?

Thank you,
Igor

May 02, 2015, 02:37:06 PM
Reply #39

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
In js part You can look at the section :  // get current volume on popup open
In the PollStatus function. I don't know how to make a link with your volume information.
But you have to send a RaiseEvent to that widget for it's make an update. Is the widget link to your programs ?
Your program SqueezeBox is an Upnp interface ?

May 02, 2015, 05:21:09 PM
Reply #40

igorrobertifoc

  • ***
  • Information
  • Full Member
  • Posts: 65
Excellent,
I need the raise event to update the widget.

My avmedia is already linked with :
      
                case "AvMedia.SetVolume":
                Squeeze("mixer volume "+reqs[3]);
                break;
             case "AvMedia.GetVolume":
                responseString = "" + Program.Parameter("HomeAutomation.SqueezeBox.volume").Value + "" ;
                break;


If i update the web page the volume is show correctly. \I nedd just the event.
Now I try, but I don t know how lol