Ankündigung

Einklappen
Keine Ankündigung bisher.

MusicPal als kleine Leute VISU

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    HS/FS MusicPal als kleine Leute VISU

    nachdem der Thread "Radiowecker" etwas unübersichtlich geworden ist und ich noch immer an einer "Visu für arme" interessiert bin hat mein EDV-Mufti Nils mit mir zusammen den Musicpal so gepimpt daß das Ding jetzt Statusmeldungen vom HS als RSS - Feed anzeigen kann.

    Als Bordmittel sind ausschließlich der Musicpal und der HS notwendig, keine weitere Rechnerleistung erforderlich.

    1.) Mpal so verbiegen, daß er selbst einen eine RSS-Feed aus einer Statusmeldung kreiert.
    Hierzu sind 2 Skripte notwenig:

    Skript: /var/www/cgi-bin/hs-input.cgi
    Code:
    [SIZE=2]#!/bin/sh
    # Nimmt beim Aufruf einen TextString an, legt diesen in einer Datei fuer den RS
    param=`echo "$1|" | sed 's/&/|/g' | sed 's/%26/\&/g' | sed 's/\+/ /g'`
    grundstatus=`echo "$param" | sed 's/.*grundstatus=\([0-9a-zA-Z_ ]*\).*|.*/\1/g'
    status1=`echo "$param" | sed 's/.*status1=\([0-9a-zA-Z_ ]*\).*|.*/\1/g'`
    status2=`echo "$param" | sed 's/.*status2=\([0-9a-zA-Z_ ]*\).*|.*/\1/g'`
    status3=`echo "$param" | sed 's/.*status3=\([0-9a-zA-Z_ ]*\).*|.*/\1/g'`
    # Daten in RSS Feed einbauen
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > /tmp/rss
    echo "<rss version=\"2.0\">" >> /tmp/rss
    echo " <channel>" >> /tmp/rss
    echo " <title>$grundstatus</title>" >> /tmp/rss
    echo " <item>" >> /tmp/rss
    echo " <title>$status1</title>" >> /tmp/rss
    echo " </item>" >> /tmp/rss
    echo " <item>" >> /tmp/rss
    echo " <title>$status2</title>" >> /tmp/rss
    echo " </item>" >> /tmp/rss
    echo " <item>" >> /tmp/rss
    echo " <title>$status3</title>" >> /tmp/rss
    echo " </item>" >> /tmp/rss
    echo " </channel>" >> /tmp/rss
    echo "</rss>" >> /tmp/rss
    wget "http://admin:admin@192.168.130.15/admin/cgi-bin/admin.cgi?f=show_clock&n=../show_clock"
    [/SIZE]

    skript: /var/www/cgi-bin/rss-output.cgi

    Code:
    [SIZE=2]#!/bin/sh
    cat /tmp/rss
    [/SIZE]


    dann beide ausführbar machen.

    Im Musicpal den RSS FEed folgendermassen einstellen:
    http://<IP-Musicpal>/cgi-bin/rss-output.cgi

    Mit dem HS folgendes Telegramm kreieren:

    http://<IP_Musicpal>/cgi-bin/hs-input.cgi?grundstatus=Meldungen+des
    +Hauses&status1=TEXT&status2=TEXT&status3=TEXT

    Damit sendet der HS seinen STatus, der Musicpal baut einen eigenen RSS Feed mit den Infos und zeigt diesen an.

    ->-> MERCI an NILS!!
    never fummel a running system...

    #2
    für diejenigen die sich das script erstellen wollen hier noch erganzend zu Peters Post, noch der Link zur Anleitung wie man sich auf dem Musicpal eine Datei erzeugen kann
    https://knx-user-forum.de/30199-post27.html


    P.S. Peter, wie war das mit Deinen Linux Kenntnissen? ;-)
    Gruß Christian

    Homeserver 2.2
    Anbindung an Fritzbox 80%
    LinVDR 10% - Reelbox 0%

    Kommentar


      #3
      ich habe nach wie vor nur rudimentäre Linux-kenntnisse, die Idee und der "Plan" ist von mir, denn ich wollte die Texteinblendungen nur in der untersten Zeile, wo normalerweise der RSS Feed läuft. Die Uhrzeit und das Datum sollten wie bereits beschrieben bestehen bleiben.

      Die Programmierung hat mir mein EDV-Leiter erledigt.

      Ich plane, die Meldungen nach "Wichtigkeit" einzublenden. Z.B. Störungen und Alarme im eigenen Popup-Window, das bestätigt werden muss, Statusmeldungen und Temperautren als RSS - Feed einzublenden.
      Parallel dazu werden dann noch die Helligkeit in Abhängigkeit der Aussenhelligkeit modifiziert und, wenn eine neue Meldung ansteht, dann wird die Helligkeit auf max gedreht.

      Zuletzt dann wird noch ein entsprechender Ton eingespielt, z.B. bei Alarmen BlockBuster von Sweet oder "Fire" von "The crazy world of Arthur Brown" usw...

      Als weiteres Projekt will ich die HS-Visuseite dann noch für den HS-Browser optimieren, dann kann ich vom Musicpal alles notwendige steuern.

      Da macht dann das aufstehen wieder spass!
      never fummel a running system...

      Kommentar


        #4
        Hi,

        Digging out old stuff.
        You guys seem to have done wonders with the MusicPal
        I would like to simply remote control the device, that is i.e. change a radio station. Is it possible ?
        I first took the classical approach and asked TechSup France
        "can I remotely change a radio station".
        The answer was
        Le musicpal est compatible avec les normes upnp ainsi que dlna
        Ha! This brings me to the utmost happyness but gives no clue to my request.

        So, if everything else fails, ask knx-user-forum

        PS: the idea is to have a kind of multi-room, with a MusicPal in each room, sounds crazy ?

        Kommentar


          #5
          Musicpal as multiroom source

          I use my Musicpal as one source for my Russound multiroom system.
          The Musicpal is controlled by PlugPlayer (iPhone app) and streams the music from my Linux server running Twonkey using UPnP.
          Currently I am working on creating an interface for OpenRemote.

          My goal is to have at least two or three Musicpals as sources for my multiroom system.
          And I want to put the hardware of all Musicpal's into one 19" casing
          --Marcus

          Kommentar


            #6
            Hi Markus,

            Thank you for the quick reply
            Zitat von mredeker Beitrag anzeigen
            The Musicpal is controlled by PlugPlayer (iPhone app) and streams the music from my Linux server running Twonkey using UPnP.
            I understand that you focus on the streaming feature of the MusicPal.
            Any idea if the radio station can be controlled ?

            Any pointer to a detailed technical document ? as TechSup seems to be of no help.

            Zitat von mredeker Beitrag anzeigen
            Currently I am working on creating an interface for OpenRemote.
            OpenRemote ?!? yet another remote control ?
            I'd love to integrate these functions in the HS and make them available in the Visu.

            Thanks again

            Kommentar


              #7
              @Raymond: Good news is: the Musicpal ist controllable by UPnP/DLNA with any standard* device, bad news: there is AFAIK no real mentionable implementation for UPnP (control-point) on the HS
              These guys obviously prefer to "help us" implementing rather proprietary stuff like controlling a single Loewe-TV etc..

              Makki

              *standard means for me: public and open for anyone, like UPnP/DLNA but unfortunately it's not (yet?) adopted in the context of HA..
              EIB/KNX & WireGate & HS3, Russound,mpd,vdr,DM8000, DALI, DMX
              -> Bitte KEINE PNs!

              Kommentar


                #8
                Hi Makki,

                Nice to hear from you again.

                Zitat von makki Beitrag anzeigen
                the Musicpal ist controllable by UPnP/DLNA with any standard* device
                Sorry to disclose my ignorance , but I don't know what UPnP/DLNA can do for me in the context of the MusicPal.

                Many posts speak about the streaming feature, maybe it makes sense in that context ?

                Zitat von makki Beitrag anzeigen
                there is AFAIK no real mentionable implementation for UPnP (control-point) on the HS
                Oh well, I don't mind, if our "friends" have some spare time , they could implement the routing facility
                But, I wasn't really thinking about a UPnP stuff on the HS, I was rather hoping for some hints as to how send IP/UDP packets to the MusicPal. If that was possible, I would be happy.

                Zitat von makki Beitrag anzeigen
                These guys obviously prefer to "help us" implementing rather proprietary stuff like controlling a single Loewe-TV
                I get your point.... but the Loewe works, and I'm nowhere close to a solution with my MusicPal.
                My last request for a detailes doc, yielded this answer
                Non il est impossible de piloter le musicpal a distance
                loosely translated as "no, it's not possible to remote control the MusicPal"
                NB: it took 3 mails to get this simple answer
                NB: I've a very limited confidence in this statement, as he didn't bother to mention "other" alternatives. I've read about telnet which could be enabled via a menu option.
                I think I'll end up nowhere unless I get a detailed manual or get in touch with a real TechSup (instead of this "gap filler")

                Anyone managed to get in contact with MusicPal Germany ?

                PS: I just got the "technical doc" which is a 2 page flyer with the same info as printed on the MusicPal box.

                Kommentar


                  #9
                  Zitat von Warichet Beitrag anzeigen
                  ... I was rather hoping for some hints as to how send IP/UDP packets to the MusicPal. If that was possible, I would be happy.
                  Hi Raymond,
                  be happy! The 'Radiowecker'-Thread gives you all the information you need to 'mod' your MusicPal (read the whole thread, there was a change in the commands with a new firmware) for use with the HS.
                  I run my MusicPal e.g. as 'remote door bell', triggered by the HS, of course . Change a radio station? Save them as favorites and call them.
                  Angehängte Dateien
                  Gruß, Rainer

                  Kommentar


                    #10
                    Zitat von Warichet Beitrag anzeigen
                    Any idea if the radio station can be controlled?
                    You can put the radio stations in the favorites list. You can select the different favorites through the web-interface. There is some info about that in the musicpal forums.

                    Zitat von Warichet Beitrag anzeigen
                    OpenRemote ?!? yet another remote control ?
                    I'd love to integrate these functions in the HS and make them available in the Visu.
                    OpenRemote is a open source project which tries to integrate all kinds of HA hardware. The final goal will be to have a system that can talk any HA hardware
                    no matter which protocol (KNX, X10, UPnP, RS232, Ethernet, ir, ...), includes a rule engine, timer based events and visualization for different platforms (iPhone, Android, Web, Flash)
                    --Marcus

                    Kommentar


                      #11
                      @Taxus
                      The 'Radiowecker'-Thread gives you all the information you need
                      OK, thank you
                      read the whole thread
                      Ouch, some reading for the long winter evening
                      I run my MusicPal e.g. as 'remote door bell'
                      Hey ! clever trick ! I'd love to do the same, I might come back to you (if you don't mind)
                      @mredeker
                      You can put the radio stations in the favorites list. You can select the different favorites through the web-interface.
                      Mmhm, TechSup says it's not possible, and you managed to do it
                      First conclusion, one of you is wrong
                      There is some info about that in the musicpal forums.
                      There is even a forum !?! Great news

                      Thank you both for your kind reply

                      Kommentar


                        #12
                        Zitat von Warichet Beitrag anzeigen
                        There is even a forum !?! Great news
                        You can find the forum here: Freecom Supportforum - Index page
                        I mostly read within the "german/musicpal" section, so I don't know how well Musicpal is talked about within the other languages.
                        --Marcus

                        Kommentar


                          #13
                          Zitat von Warichet Beitrag anzeigen
                          Mmhm, TechSup says it's not possible, and you managed to do it
                          First conclusion, one of you is wrong
                          I use firmware 1.65 and all you have todo is push the navigate button when the radio station is playing. A menu will show up where you can select "Add favorite"
                          --Marcus

                          Kommentar


                            #14
                            Zitat von mredeker Beitrag anzeigen
                            all you have todo is push the navigate button when the radio station is playing. A menu will show up where you can select "Add favorite"
                            Yes, no problem !
                            My question was: how can I do it remotely ?
                            But I'll first follow Taxus's recommendation and read the 'Radiowecker'-Thread.

                            Kommentar


                              #15
                              I have written a php class to control the MusicPAL. Maybe you find it useful. Feel free to use or modify it.


                              PHP-Code:
                              <?php

                              define
                              ("MP_OFF",0);
                              define("MP_ON",1);

                              class 
                              musicpal
                              {
                                  var 
                              $ip;
                                  var 
                              $user;
                                  var 
                              $password;
                                  var 
                              $state;
                                  
                                  
                              // 
                                  // musicpal(): creates the object and saves the IP address, user name and password 
                                  // to access the musciapl device
                                  //
                                  
                              function musicpal($mp_cfg)
                                  {
                                      
                              $this->ip $mp_cfg["ip"];
                                      
                              $this->user $mp_cfg["user"];
                                      
                              $this->password $mp_cfg["password"];
                                      
                              $this->get_state();
                                  }
                                  
                                  
                              //
                                  // power_up(): switches the musicpal on from standby
                                  //    
                                  
                              function power_up()
                                  {
                                      
                              $this->get_state();
                                      if (
                              $this->state->power_state == MP_OFF)
                                      {
                                          
                              $get_url "http://".$this->ip."/admin/cgi-bin/ipc_send?power_up";
                                          
                              $options = array('httpauth' => $this->user.':'.$this->password);
                                          
                              $response http_get($get_url,$options,$info);
                                          
                              sleep(1);
                                          return 
                              $response;
                                      }
                                      else return 
                              FALSE;
                                  }
                                  
                                  
                              //
                                  // power_down(): switches the musicpal down to standby
                                  //    
                                  
                              function power_down()
                                  {
                                      
                              $this->get_state();
                                      if (
                              $this->state->power_state == MP_ON)
                                      {    
                                          
                              $get_url "http://".$this->ip."/admin/cgi-bin/ipc_send?power_down";
                                          
                              $options = array('httpauth' => $this->user.':'.$this->password);
                                          
                              $response http_get($get_url,$options,$info);
                                          return 
                              $response;
                                      }
                                      else return 
                              FALSE;
                                  }
                                  
                                  function 
                              volume($vol)
                                  {
                                      
                              $get_url "http://".$this->ip."/admin/cgi-bin/admin.cgi?f=volume_set&v=".$vol;
                                      
                              $options = array('httpauth' => $this->user.':'.$this->password);
                                      
                              $response http_get($get_url,$options,$info); 
                                  }
                                  
                                  function 
                              favorite($no)
                                  {
                                      
                              $get_url "http://".$this->ip."/admin/cgi-bin/admin.cgi?f=favorites&n=../favorites.html&a=p&i=".$no;
                                      
                              $options = array('httpauth' => $this->user.':'.$this->password);
                                      
                              $response http_get($get_url,$options,$info);
                                  }
                                      
                                  function 
                              play_pause()
                                  {
                                      
                              $get_url "http://".$this->ip."/admin/cgi-bin/admin.cgi?f=play_pause";
                                      
                              $options = array('httpauth' => $this->user.':'.$this->password);
                                      
                              $response http_get($get_url,$options,$info);
                                  }
                                  
                                  


                                  function 
                              get_state()
                                  {
                                      
                              $get_url "http://".$this->ip."/admin/cgi-bin/state.cgi?fav=0";
                                      
                              $options = array('httpauth' => $this->user.':'.$this->password);
                                      
                              $response http_get($get_url,$options,$info);
                                      
                              $start strpos($response,"<volume>");
                                      
                              $end strpos($response,"<url>");
                                      if (!
                              $end$end strpos($response,"<url/>");
                                      
                              $state_xml "<state>".substr($response,$start,$end-$start)."</state>";
                                      echo 
                              "STATUS in XML: ".$state_xml."\n";
                                      
                              $this->state simplexml_load_string($state_xml);
                                      
                              print_r($this->state);
                                  }

                                  function 
                              is_on()
                                  {
                                      
                              $this->get_state();
                                      if (
                              $this->state->power_state == MP_ON)
                                          return 
                              TRUE;
                                      else     
                                          return 
                              FALSE;
                                  }

                                  function 
                              is_off()
                                  {
                                      
                              $this->get_state();
                                      if (
                              $this->state->power_state == MP_OFF)
                                          return 
                              TRUE;
                                      else     
                                          return 
                              FALSE;
                                  }

                                  
                              //
                                  // This functions sets the brightness of the MusicPal display depending of its status
                                  //
                                  // $brightness: value in range from 0 to 10
                                  //
                                  // $displayStatus indicates which of the following 3 status you want to change
                                  // "active" - brightness when MP is in active mode
                                  // "sleeping" - brightness when MP is in dleeping mode
                                  // "sleep_timer" - brightness when sleep timer of MP is active
                                  // 
                                  
                              function brightness($brightness,$mpStatus="active")
                                  {
                                      
                              $post_url "http://".$this->user.":".$this->password."@".$this->ip."/admin/cgi-bin/admin.cgi?f=display_brightness_".$mpStatus."&n=../display_brightness_".$mpStatus.".html";
                                      
                              $post_data = array('brightness'=>$brightness'apply' => 'Verwenden');
                                      
                              http_post_fields($post_url,$post_data);
                                  }
                                  
                                  function 
                              is_playing()
                                  {
                                      
                              $this->get_state();
                                      if (
                              $this->state->player_state == MP_PLAYING)
                                          return 
                              TRUE;
                                      else     
                                          return 
                              FALSE;
                                  }
                                  
                                  function 
                              pause()
                                  {
                                          if (
                              $this->is_playing())
                                              
                              $this->play_pause();
                                  }

                                  function 
                              play()
                                  {
                                          if (!
                              $this->is_playing())
                                              
                              $this->play_pause();
                                  }
                                  
                                  function 
                              get_volume()
                                  {
                                      
                              $this->get_state();
                                      return 
                              $this->state->volume;
                                  }

                                  function 
                              is_radio()
                                  {
                                      if (
                              $this->state->is_internet_radio == 1)
                                          return 
                              TRUE;
                                      else     
                                          return 
                              FALSE;
                                      
                                  }
                                  
                                  function 
                              send_message($rows)
                                  {
                                      
                              $msg rawurlencode(implode("§",$rows));
                                      
                              $get_url "http://".$this->user.":".$this->password."@".$this->ip."/admin/cgi-bin/ipc_send?show_list%20".$msg;
                                      echo 
                              "URL: ".$get_url."\n";
                                      
                              http_get($get_url); 
                                  }
                                  
                                  function 
                              confirm_message()
                                  {
                                      
                              $get_url "http://".$this->user.":".$this->password."@".$this->ip."/admin/cgi-bin/ipc_send?menu_collapse"
                                      if (!
                              $this->is_on())
                                      {
                                          
                              $this->power_up();
                                          
                              sleep(1);
                                          
                              http_get($get_url);
                                          
                              $this->power_down();
                                      } else 
                                          
                              http_get($get_url);
                                      
                                  }

                                  function 
                              show_clock()
                                  {
                                      
                              $post_url "http://".$this->ip."/admin/cgi-bin/admin.cgi?f=show_clock&n=../show_clock.html";
                                      
                              $post_data = array('apply' => 'Uhrzeit anzeigen');
                                      
                              $options = array('httpauth' => $this->user.':'.$this->password);
                                      
                              http_post_fields($post_url,$post_data,array(),$options);
                                  }
                                  
                                  function 
                              wait($seconds)
                                  {
                                      
                              sleep($seconds);
                                  }
                              }
                              ?>
                              You have to intantiate the class as follows:

                              PHP-Code:
                              $mp_config = array(
                               
                              "ip" => "xxx.xxx.xxx.xxx",
                               
                              "user" => "musicpal_user",
                               
                              "password" => "musicpal_password");
                               
                              $mp = new musicpal($mp_config); 
                              Then you can control the musicpal, e.g.
                              PHP-Code:
                              $mp -> volume(10); // set volume to 10 

                              Kommentar

                              Lädt...
                              X