Ankündigung

Einklappen
Keine Ankündigung bisher.

Vorstellung meiner smartVisu

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

    #91
    Zitat von SebastianFey Beitrag anzeigen
    Nachteil:
    - nur moderne Browser
    Das ist kein Nachteil sondern ein Vorteil. Man wird gezwungen endlich mal auf etwas umzusteigen, was ohnehin Sinn macht (Sicherheit, Features, Standardkonformität). Bei einer Webseite kann ich das vom Kunde natürlich nicht unbedingt verlangen (obwohl: Sondersteuer auf Internet Explorer), aber in meinem Haus setze ich der Sicherheit wegen voraus, dass alle mit einem aktuellen Browser unterwegs sind... sonst kommen sie mir nicht ins LAN (auch Freunde und Bekannte nicht!).
    Mit freundlichen Grüßen
    Niko Will

    Logiken und Schnittstelle zu anderen Systemen: smarthome.py - Visualisierung: smartVISU
    - Gira TS3 - iPhone & iPad - Mobotix T24 - ekey - Denon 2313 - Russound C5 (RIO over TCP Plugin) -

    Kommentar


      #92
      Danke für die Infos!

      Geplant hab ich die "Realtime"-Fähigkeit ab Anfang Septempter anzugehen (nach meinen Urlaub). Hab mir auch schon einen Überblick verschafft und erste erfolgreiche Tests gemacht.

      Das Gerüst bleibt aber so bestehen, d. h. jeder der jetzt sein Haus damit macht, wird das auch so verwenden können.

      Gruss
      Join smartVISU on facebook. Web: smartvisu.de.
      Dir gefällt smartVISU? Bitte spenden für die Weiterentwicklung.

      Kommentar


        #93
        Hallo Apollo,

        deine Visu schaut sehr gut aus, gerne würde ich diese auch wie du auf meiner qnap laufen lassen. Hast du eine Doku wie man dies auf der Qnap zum laufen bekommet?

        Gruss

        Kommentar


          #94
          weather-app

          Servus,

          bei mir funktioniert das wetter leider nicht. Nach einigen Recherchen bei Google & Co. scheint die Google-Weather-API in naher Zukunft abgestellt zu werden.

          Ich habe daher das google-weather plugin für weather-underground angepasst. Bei Weather Forecast & Reports - Long Range & Local | Wunderground | Weather Underground kann man sich einen API key organisieren (für lau). Den key dann im file unten anpassen. Viel Spass


          PHP-Code:
          <?
          /**
           * -----------------------------------------------------------------------------
           * @package     smartVISU
           * @author      Florian Meister
           * @copyright   2012
           * @license     GPL <http://www.gnu.de>
           * ----------------------------------------------------------------------------- 
           */

              // get config-variables 
              require_once '../../../config.php';
              
              // init parameters
              $request = array_merge($_GET, $_POST);
               
              $location = $request['location'];
              $lang = $request['lang'];
              
              // Anstelle einer Stadt bzw. einer PLZ kann auch kommagetrennt
              // Längen- und Breitengrad eines Ortes angegeben werden,
              // z.B. http://www.google.de/ig/api?weather=,,,48187575,11513672&hl=de
              // für München

              if($lang == "de")
                  $wlang="DL";
              else
              $wlang=strtoupper($lang);
              
              $current_url ="http://api.wunderground.com/api/API-KEY-HIER-REIN/conditions/lang:" . $wlang . "/q/" . $location . ".json";
              $forecast_url ="http://api.wunderground.com/api/API-KEY-HIER-REIN/forecast/lang:" . $wlang . "/q/" . $location . ".json";

              // get contents
              $current_json_string = mb_convert_encoding(file_get_contents($current_url), "UTF-8", "ISO-8859-1");
              $current_parsed_json = json_decode($current_json_string);
              
              // get contents
              $forecast_json_string = mb_convert_encoding(file_get_contents($forecast_url), "UTF-8", "ISO-8859-1");
              $forecast_parsed_json = json_decode($forecast_json_string);

              //$location = $parsed_json->{'location'}->{'city'};


              //echo "Current temperature in ${location} is: ${temp_f}\n";
              
              // today
              //$weather['city']       = (string)$forecast_parsed_json->{'forecast'}->{'fcttext_metric'};
              
              if (config_lang == "de")
                  $weather['now_temp']   = (int)$current_parsed_json->{'current_observation'}->{'temp_c'};
              else
                  $weather['now_temp']   = (int)$current_parsed_json->{'current_observation'}->{'temp_f'};
              
              $weather['now_cond']   = (string)$current_parsed_json->{'current_observation'}->{'weather'};
              $weather['now_icon']   = icon((string)$current_parsed_json->{'current_observation'}->{'icon'});
              $weather['now_wind']   = (string)$current_parsed_json->{'current_observation'}->{'wind_string'}; 
              $weather['now_humi']   = (string)$current_parsed_json->{'current_observation'}->{'relative_humidity'};

             

          $i=0;
          foreach($forecast_parsed_json->{'forecast'}->{'simpleforecast'}->{'forecastday'} as $day) {
                  $weather['forecast'][$i]['day_date']       = (string)$day->{'date'}->{'weekday'};
                  $weather['forecast'][$i]['day_cond']       = (string)$day->{'conditions'}; 
                  $weather['forecast'][$i]['day_icon']       = icon((string)$day->{'icon'});
                  $weather['forecast'][$i]['day_ltemp']      = (int)$day->{'low'}->{'celsius'};
                  $weather['forecast'][$i]['day_htemp']      = (int)$day->{'high'}->{'celsius'};
             $i++;
          }


           
              // forecast
              //$days = 4;
              //for ($i = 0; $i < $days; $i++) {
                  //$weather['forecast'][$i]['day_date']       = (string)$forecast_parsed_json->{'forecast'}->{'forecastday[$i]'}->{''};
                  //$weather['forecast'][$i]['day_cond']       = (string)$forecast_parsed_json->{'forecast'}->{'forecastday[$i]'}->{'title'}; 
                  //$weather['forecast'][$i]['day_icon']       = icon((string)$forecast_parsed_json->{'forecast'}->{'forecastday[$i]'}->{'title'});
                  //$weather['forecast'][$i]['day_ltemp']      = (int)$forecast_parsed_json->{'forecast'}->{'forecastday[$i]'}->{'title'};
                  //$weather['forecast'][$i]['day_htemp']      = (int)$forecast_parsed_json->{'forecast'}->{'forecastday[$i]'}->{'title'};
              //}
              
              echo json_encode($weather);
              
              
          // -----------------------------------------------------------------------------
          // I C O N - M A P P E R
          // -----------------------------------------------------------------------------
              function icon($name)
              {
                  $ret = "";
                  
                  $icon["sunny"]              = "sun_1";
                  $icon["mostlysunny"]       = "sun_2";
                  $icon["partlycloudy"]      = "sun_3";
                  $icon["mostlycloudy"]      = "sun_5";
                  $icon["mist"]               = "sun_6";
                  $icon["chancerain"]     = "sun_7";
                  $icon["rain"]               = "sun_8";
                  $icon["chancestorm"]    = "sun_9";
                  $icon["storm"]              = "sun_10";
                  $icon["chancesnow"]     = "sun_11";
                  $icon["snow"]               = "sun_12";  
                  
                  
                  $icon["cloudy"]             = "cloud_4";
                  $icon["showers"]            = "cloud_8";
                  $icon["thunderstorm"]       = "cloud_10";
                  $icon["rain_snow"]          = "cloud_15";
                  $icon["foggy"]              = "cloud_6";
                  $icon["fog"]                = "cloud_6";
                  $icon["icy"]                = "cloud_16";
                  $icon["smoke"]              = "na";
                  $icon["dusty"]              = "na";
                  $icon["hazy"]               = "na";
                  
                  $ret = $icon[$name];
                  
                  return $ret;
              }

          /*
              weather_thunderstorms-40.gif
              weather_partlycloudy-40.gif
              weather_sunny-40.gif
              weather_overcast-40.gif
              weather_rainsnow-40.gif
              weather_mostlycloudy-40.gif
              weather_rain-40.gif
              weather_scatteredthunderstorms-40.gif
              weather_scatteredshowers-40.gif
              weather_snowflurries-40.gif
              weather_haze-40.gif
              weather_smoke-40.gif
              weather_fog-40.gif
              weather_dust-40.gif
              weather_icy-40.gif
              weather_snow-40.gif
              weather_sleet-40.gif
              weather_cloudy-40.gif
              weather_drizzle-40.gif
              weather_windy-40.gif
              weather_heavyrain-40.gif
              weather_heavysnow-40.gif
              weather_scatteredsnowshowers-40.gif
          */
              
          ?>

          Kommentar


            #95
            Gut

            Hoi

            Das mit dem Google-Weather haben wir auch schon gemerkt.
            Welche Variablen hast Du denn in config.php
            Grüsse Bodo
            Fragen gehören ins Forum, und nicht in mein Postfach;
            EibPC-Fan; Wiregate-Fan; Timberwolf-Fan mit 30x 1-Wire Sensoren;

            Kommentar


              #96
              @fmeister: Danke, werde das sofort übernehmen und mit dem nächsten release veröffentlichen.
              Join smartVISU on facebook. Web: smartvisu.de.
              Dir gefällt smartVISU? Bitte spenden für die Weiterentwicklung.

              Kommentar


                #97
                Zitat von Bodo Beitrag anzeigen
                Hoi

                Das mit dem Google-Weather haben wir auch schon gemerkt.
                Welche Variablen hast Du denn in config.php
                wie welche variablen ?

                ich hab prinzipiell nur die lib/weather/service/google.php ersetzt. Dort noch den API-key von dir eintragen.

                Die wetter-widgets brauchen aber noch eine andere Ortsformatierung:

                {{ lib.weather('weather', 'Austria/Hohenems') }}

                Nicht mehr wie bisher bei google-weather einfach nur der Ort, sondern Ort+Land durch einen slash getrennt.

                sonst solltest du nichts ändern müssen.

                lg, Flo

                Kommentar


                  #98
                  Zitat von Apollo Beitrag anzeigen
                  Danke für die Infos!

                  Geplant hab ich die "Realtime"-Fähigkeit ab Anfang Septempter anzugehen (nach meinen Urlaub). Hab mir auch schon einen Überblick verschafft und erste erfolgreiche Tests gemacht.

                  Das Gerüst bleibt aber so bestehen, d. h. jeder der jetzt sein Haus damit macht, wird das auch so verwenden können.

                  Gruss
                  Ich hab das noch nicht ganz gecheckt - kann linknx jetzt notifications über dessen Schnittstelle oder musst du dafür was eigenes bauen ? Oder wirds eine polling Lösung ? Momentan refreshe ich alle 5 Minuten via Meta-Tag, was für meine Verhältnisse ausreichend ist.

                  PS: Finde die Visu auch sehr gelungen, es ist echt einfach damit was vernünftiges auf die Beine zu stellen, ohne sich ständig über Iphone, Ipad, Browser & Co. Gedanken machen zu müssen.

                  lg, Flo

                  Kommentar


                    #99
                    Die (nie offizielle) Google-Wetter-API ist definitiv tot, Alternativen wie bereits genannt wunderground oder yr.no/met.no ..

                    Makki
                    EIB/KNX & WireGate & HS3, Russound,mpd,vdr,DM8000, DALI, DMX
                    -> Bitte KEINE PNs!

                    Kommentar


                      Hier noch V2 der wunderground API.

                      changes:
                      - Umlautproblem behoben
                      - Icon für "Heiter"
                      - Reduktion auf 1 query zur wunderground API

                      ciao, flo

                      PHP-Code:
                      <?
                      /**
                       * -----------------------------------------------------------------------------
                       * @package     smartVISU
                       * @author      Florian Meister
                       * @copyright   2012
                       * @license     GPL <http://www.gnu.de>
                       * ----------------------------------------------------------------------------- 
                       */

                          /config.php';
                          
                          // init parameters
                          $request = array_merge($_GET, $_POST);
                           
                          $location = $request['location'];
                          $lang = $request['lang'];
                          
                          // Anstelle einer Stadt bzw. einer PLZ kann auch kommagetrennt
                          // Längen- und Breitengrad eines Ortes angegeben werden,
                          // z.B. http://www.google.de/ig/api?weather=,,,48187575,11513672&hl=de
                          // für München

                          if($lang == "de")
                              $wlang="DL";
                          else
                          $wlang=strtoupper($lang);
                          
                          $url ="http://api.wunderground.com/api/DEIN_WUNDERGROUND_API_KEY/conditions/forecast/lang:" . $wlang . "/q/" . $location . ".json";

                          // get contents
                          $json_string = file_get_contents($url);
                          $parsed_json = json_decode($json_string);

                          if (config_lang == "de")
                              $weather['now_temp']   = (int)$parsed_json->{'current_observation'}->{'temp_c'};
                          else
                              $weather['now_temp']   = (int)$parsed_json->{'current_observation'}->{'temp_f'};
                          
                          $weather['now_cond']   = (string)$parsed_json->{'current_observation'}->{'weather'};
                          $weather['now_icon']   = icon((string)$parsed_json->{'current_observation'}->{'icon'});
                          $weather['now_wind']   = (string)$parsed_json->{'current_observation'}->{'wind_string'}; 
                          $weather['now_humi']   = (string)$parsed_json->{'current_observation'}->{'relative_humidity'};

                         

                      $i=0;
                      foreach($parsed_json->{'forecast'}->{'simpleforecast'}->{'forecastday'} as $day) {
                              $weather['forecast'][$i]['day_date']       = (string)$day->{'date'}->{'weekday'};
                              $weather['forecast'][$i]['day_cond']       = (string)$day->{'conditions'}; 
                              $weather['forecast'][$i]['day_icon']       = icon((string)$day->{'icon'});
                              $weather['forecast'][$i]['day_ltemp']      = (int)$day->{'low'}->{'celsius'};
                              $weather['forecast'][$i]['day_htemp']      = (int)$day->{'high'}->{'celsius'};
                         $i++;
                      }
                          
                          echo json_encode($weather);
                          
                          
                      // -----------------------------------------------------------------------------
                      // I C O N - M A P P E R
                      // -----------------------------------------------------------------------------
                          function icon($name)
                          {
                              $ret = "";
                              
                              $icon["sunny"]              = "sun_1";
                              $icon["mostlysunny"]       = "sun_2";
                              $icon["clear"]       = "sun_2";
                              $icon["partlycloudy"]      = "sun_3";
                              $icon["mostlycloudy"]      = "sun_5";
                              $icon["mist"]               = "sun_6";
                              $icon["chancerain"]     = "sun_7";
                              $icon["rain"]               = "sun_8";
                              $icon["chancestorm"]    = "sun_9";
                              $icon["storm"]              = "sun_10";
                              $icon["chancesnow"]     = "sun_11";
                              $icon["snow"]               = "sun_12";  
                              
                              
                              $icon["cloudy"]             = "cloud_4";
                              $icon["showers"]            = "cloud_8";
                              $icon["thunderstorm"]       = "cloud_10";
                              $icon["rain_snow"]          = "cloud_15";
                              $icon["foggy"]              = "cloud_6";
                              $icon["fog"]                = "cloud_6";
                              $icon["icy"]                = "cloud_16";
                              $icon["smoke"]              = "na";
                              $icon["dusty"]              = "na";
                              $icon["hazy"]               = "na";
                              
                              $ret = $icon[$name];
                              
                              return $ret;
                          }

                      /*
                          weather_thunderstorms-40.gif
                          weather_partlycloudy-40.gif
                          weather_sunny-40.gif
                          weather_overcast-40.gif
                          weather_rainsnow-40.gif
                          weather_mostlycloudy-40.gif
                          weather_rain-40.gif
                          weather_scatteredthunderstorms-40.gif
                          weather_scatteredshowers-40.gif
                          weather_snowflurries-40.gif
                          weather_haze-40.gif
                          weather_smoke-40.gif
                          weather_fog-40.gif
                          weather_dust-40.gif
                          weather_icy-40.gif
                          weather_snow-40.gif
                          weather_sleet-40.gif
                          weather_cloudy-40.gif
                          weather_drizzle-40.gif
                          weather_windy-40.gif
                          weather_heavyrain-40.gif
                          weather_heavysnow-40.gif
                          weather_scatteredsnowshowers-40.gif
                      */
                          
                      ?>

                      Kommentar


                        Super, dann geht heute abend bei mir das Wetter ja auch wieder.

                        Würde es nicht Sinn machen den Api-Key mit in den lib.weather-Aufruf oder die config zu nehmen? Dann muß nicht jeder an den Source der Visu.

                        Edit: Habe grade mal nachgesehen. Eigentlich reicht es, wenn der Apollo - als Developer - einen Api-Key fest im source einträgt.
                        @Apollo: Evtl. kannst Du den ja posten, dann braucht nicht jeder einen eigenen.

                        Edit2: Weiter gelesen: Der kostenlose Api-Key ist beschränkt auf 500 Anfragen pro Tag und max 10 pro Minute. Also doch jeder einen - oder eine andere Quelle.

                        Viele Grüße

                        Intruder73

                        Kommentar


                          somit erledigt. API key wird via

                          define ('config_wunderground_key', 'DEIN_WUNDERGROUND_APIKEY');

                          in der config.php definiert.

                          Ja das mit den beschränken Anfragen ist das Problem, sonst hätt ich schon meinen mitgepostet

                          Aber nachdem der key nichts kostet, 500 Anfragen/Tag mehr als genug für jeden hier sein sollten und das beschaffen des keys absolut unkompliziert ist, denk ich es ist gut so.

                          Sollte jemand eine gute weather-api alternative kennen die ohne key auskommt - bin für Vorschläge offen.

                          lg, flo

                          PHP-Code:
                          <?
                          /**
                           * -----------------------------------------------------------------------------
                           * @package     smartVISU
                           * @author      Florian Meister
                           * @copyright   2012
                           * @license     GPL <http://www.gnu.de>
                           * ----------------------------------------------------------------------------- 
                           */

                              // get config-variables 
                              require_once '../../../config.php';
                              
                              // init parameters
                              $request = array_merge($_GET, $_POST);
                               
                              $location = $request['location'];
                              $lang = $request['lang'];
                              
                              if($lang == "de")
                                  $wlang="DL";
                              else
                              $wlang=strtoupper($lang);
                              $apikey = config_wunderground_key; 
                              $url ="http://api.wunderground.com/api/$apikey/conditions/forecast/lang:" . $wlang . "/q/" . $location . ".json";

                              // get contents
                              $json_string = file_get_contents($url);
                              $parsed_json = json_decode($json_string);

                              if (config_lang == "de")
                                  $weather['now_temp']   = (int)$parsed_json->{'current_observation'}->{'temp_c'};
                              else
                                  $weather['now_temp']   = (int)$parsed_json->{'current_observation'}->{'temp_f'};
                              
                              $weather['now_cond']   = (string)$parsed_json->{'current_observation'}->{'weather'};
                              $weather['now_icon']   = icon((string)$parsed_json->{'current_observation'}->{'icon'});
                              $weather['now_wind']   = (string)$parsed_json->{'current_observation'}->{'wind_string'}; 
                              $weather['now_humi']   = (string)$parsed_json->{'current_observation'}->{'relative_humidity'};

                             

                          $i=0;
                          foreach($parsed_json->{'forecast'}->{'simpleforecast'}->{'forecastday'} as $day) {
                                  $weather['forecast'][$i]['day_date']       = (string)$day->{'date'}->{'weekday'};
                                  $weather['forecast'][$i]['day_cond']       = (string)$day->{'conditions'}; 
                                  $weather['forecast'][$i]['day_icon']       = icon((string)$day->{'icon'});
                                  $weather['forecast'][$i]['day_ltemp']      = (int)$day->{'low'}->{'celsius'};
                                  $weather['forecast'][$i]['day_htemp']      = (int)$day->{'high'}->{'celsius'};
                             $i++;
                          }
                              
                              echo json_encode($weather);
                              
                              
                          // -----------------------------------------------------------------------------
                          // I C O N - M A P P E R
                          // -----------------------------------------------------------------------------
                              function icon($name)
                              {
                                  $ret = "";
                                  
                                  $icon["sunny"]              = "sun_1";
                                  $icon["mostlysunny"]       = "sun_2";
                                  $icon["clear"]       = "sun_2";
                                  $icon["partlycloudy"]      = "sun_3";
                                  $icon["mostlycloudy"]      = "sun_5";
                                  $icon["mist"]               = "sun_6";
                                  $icon["chancerain"]     = "sun_7";
                                  $icon["rain"]               = "sun_8";
                                  $icon["chancestorm"]    = "sun_9";
                                  $icon["storm"]              = "sun_10";
                                  $icon["chancesnow"]     = "sun_11";
                                  $icon["snow"]               = "sun_12";  
                                  
                                  
                                  $icon["cloudy"]             = "cloud_4";
                                  $icon["showers"]            = "cloud_8";
                                  $icon["thunderstorm"]       = "cloud_10";
                                  $icon["rain_snow"]          = "cloud_15";
                                  $icon["foggy"]              = "cloud_6";
                                  $icon["fog"]                = "cloud_6";
                                  $icon["icy"]                = "cloud_16";
                                  $icon["smoke"]              = "na";
                                  $icon["dusty"]              = "na";
                                  $icon["hazy"]               = "na";
                                  
                                  $ret = $icon[$name];
                                  
                                  return $ret;
                              }

                          /*
                              weather_thunderstorms-40.gif
                              weather_partlycloudy-40.gif
                              weather_sunny-40.gif
                              weather_overcast-40.gif
                              weather_rainsnow-40.gif
                              weather_mostlycloudy-40.gif
                              weather_rain-40.gif
                              weather_scatteredthunderstorms-40.gif
                              weather_scatteredshowers-40.gif
                              weather_snowflurries-40.gif
                              weather_haze-40.gif
                              weather_smoke-40.gif
                              weather_fog-40.gif
                              weather_dust-40.gif
                              weather_icy-40.gif
                              weather_snow-40.gif
                              weather_sleet-40.gif
                              weather_cloudy-40.gif
                              weather_drizzle-40.gif
                              weather_windy-40.gif
                              weather_heavyrain-40.gif
                              weather_heavysnow-40.gif
                              weather_scatteredsnowshowers-40.gif
                          */
                              
                          ?>

                          Kommentar


                            Zitat von Bodo Beitrag anzeigen
                            Welche Variablen hast Du denn in config.php
                            // get config-variables
                            require_once '../../../config.php';
                            Das hatte ich gemeint.

                            Auch noch gute Wetterdaten liefert gratis yr.no
                            Code:
                            http://www.yr.no/place/Switzerland/Z%C3%BCrich/R%C3%BCti~2658909/forecast_hour_by_hour.xml
                            Grüsse Bodo
                            Fragen gehören ins Forum, und nicht in mein Postfach;
                            EibPC-Fan; Wiregate-Fan; Timberwolf-Fan mit 30x 1-Wire Sensoren;

                            Kommentar


                              Zitat von Bodo Beitrag anzeigen
                              Auch noch gute Wetterdaten liefert gratis yr.no
                              Dann muß aber der Hinweis "Weather forecast from yr.no, delivered by the Norwegian Meteorological Institute and the NRK" mit link auf Weather forecast for Rüti, Zürich (Switzerland) in der Visu autauchen ...
                              (siehe xml-file und http://om.yr.no/verdata/vilkar/)

                              Kommentar


                                Zitat von Intruder73 Beitrag anzeigen
                                Dann muß aber der Hinweis...
                                Hoi

                                Wenn ich's öffentlich zugänglich mache schon.
                                Grüsse Bodo
                                Fragen gehören ins Forum, und nicht in mein Postfach;
                                EibPC-Fan; Wiregate-Fan; Timberwolf-Fan mit 30x 1-Wire Sensoren;

                                Kommentar

                                Lädt...
                                X