Einfache Seite erstellen

Hallo

Ich versuche mich gerade mal wieder im Bau einer eigene Seite für das WebFront.

Die Seite alleine bring ich ja auch schon hin. Nur das mit dem Schalter An/Aus bekomme ich einfach nicht gebacken.

Ich habe vor alle meine IrTrans Skripts auf eine eigene Seite zu setzen um die Übersicht nicht zu verlieren.

Also sprich eine Seite in der ich eben fünf Felder habe mit je einmal an bzw. aus.

Lese mich schon seit Wochen durch das Forum, aber ich bringe es einfach nicht hin.

Könnte mir einer von euch Profis evtl. eine PHP Skript für meine Seite basteln.

Danke im Voraus.

MFG Franz

Hallo Franz,

die Philosophie des IP-Symcon WebFront heißt:

NULL-Konfiguration

Es wird von unser Seite auch darum keinen Support geben.
Für Experten, die mit der Materie vertraut sind,
beantwortet Horst gern die eine oder andere Frage.

MST

Schau Dir mal das an und packe oben einfach den Befehl zum Script schalten rein: http://www.ip-symcon.de/forum/f56/webfront-genereller-diskussionsthread-4847/index16.html#post54070

Hi Horst

Danke

Aber ich bin leider eine Null in PHP.

Wo muss ich den nun was einfügen.

MFG Franz

Hallo Franz,

hier mal Code zum schalten.

<div class="deviceContainer" style="background: transparent url(img/icons/png/Title.png) no-repeat scroll 10px 4px;">
    <div class="deviceTitle">
        <div class="deviceTitleContent">Schalten</div>
   </div> 
  
<?php
    if(isset($_GET['action']) && $_GET['action'] == "S1" && isset($_GET['id'])) 
    {
        SetValue((int)$_GET['id'], !GetValue(18541));
    }  
?>   
<div class="variablesContainer" style="height: auto;">
            <div class="variableContainer" style="background: transparent url(img/icons/png/Schloss.png) no-repeat scroll 10px 4px;">
         <div class="deviceTitle">
             <div class="deviceTitleContent">Haustür Auf/Zu</div>
                </div>                 
                <div class="deviceState"><a href="?action=S1&id=18541"><?php if(GetValue(18541)==1)echo "<div class='SwitchBasic SwitchBasicOn'> <div class='deviceStateContent'>Aufschliessen</div>"; else echo "<div class='SwitchBasic SwitchBasicOff'> <div class='deviceStateContent'>Zuschliessen</div>";?></a></div>
        </div>
      

Ohne gross rumzumachen, binde einfach die Webfront CSS ein.
ID´s der Variablen anpassen !!!

Hallo RWN

Danke

Habe es versucht, aber jetz sagt er mir im Webfront „Variable nur zum Lesen“???

Hier mein Code:

<!--
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-->

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">

<style type="text/css">@import "webintern.css";</style>
<style type="text/css">
html, body { margin: 0; padding: 0; }
</style>

</head><body>

<div class="deviceContainer" style="background: transparent url(img/icons/png/Title.png) no-repeat scroll 10px 4px;">
    <div class="deviceTitle">
        <div class="deviceTitleContent">Schalten</div>
   </div> 
  
<?php
    if(isset($_GET['action']) && $_GET['action'] == "S1" && isset($_GET['id'])) 
    {
        SetValue((int)$_GET['id'], !GetValue(57924));
    }  
?>   
<div class="variablesContainer" style="height: auto;">
            <div class="variableContainer" style="background: transparent url(img/icons/png/Schloss.png) no-repeat scroll 10px 4px;">
         <div class="deviceTitle">
             <div class="deviceTitleContent">Haustür Auf/Zu</div>
                </div>                 
                <div class="deviceState"><a href="?action=S1&id=57924"><?php if(GetValue(57924)==1)echo "<div class='SwitchBasic SwitchBasicOn'> <div class='deviceStateContent'>Aufschliessen</div>"; else echo "<div class='SwitchBasic SwitchBasicOff'> <div class='deviceStateContent'>Zuschliessen</div>";?></a></div>
        </div>

</body></html>

Mach ich da was falsch?

Sorry das ich nerve:)

Mit dem was RWN sagt sollte es klappen. Wobei Du da noch deine IR-Trans-Skripte mit aufrufen musst. Dazu siehe IPS_RunScriptWait - IP-Symcon :: Automatisierungssoftware. Die Variable, die den Status anzeigt, würde ich dann auch vom jeweiligen Skript umsetzen lassen.
Wenn es Dich näher interessiert solltest Du vllt eine Runde PHP und HTML lernen. SELFHTML 8.1.2 (HTML-Dateien selbst erstellen) hilft für letzteres und hat auch noch Links zum PHP lernen drin. Wobei es hier im Forum dazu auch Threads/Links gibt, die in Bezug auf IP-Symcon besser helfen könnten.

Du machst was falsch: Du willst Statusvariablen setzen. Statusvariablen zeigen den Status eines Aktors an und werden vom Aktor selber gesetzt. Du versuchst gerade übertragen dein Auto schneller fahren zu lassen, indem Du den Geschwindigkeitszeiger im Tacho verstellst. Das fängt IP-Symcon aber für Dich ab ;).
Du musst natürlich die korrekten Schaltbefehle für deine Hardware benutzen. Wie die nun genau aussehen kannst Du in der Doku nachsehen (Modulreferenz - IP-Symcon :: Automatisierungssoftware).

DANKE DANKE Horst

Ich habs geschaft:):):slight_smile:

Wie könnte ich nun an und aus auf dem selben schalter legen.

Wenn ich nun einmal drücke geht er an. Klar Befehl ist ja auch auf „true“.
Aber gibt es da einen extra Skript dafür.

Ich rede jetzt von einem FS20 Schalter.

MFG Franz

Das stand in dem Post, den ich in meinem ersten Post verlinkt hatte ;).

FS20_SwitchMode((int)$_GET['id'], !GetValue(IPS_GetStatusVariableID((int)$_GET['id'], "StatusVariable")));

Hallo

So weit so gut.

Habe nun eine eigene Seite.

Aber eine Fragen habe ich da noch wie kann ich jetzt meine Skripts den jeweiligen Schaltern zuordnen?

<!--
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-->

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">

<style type="text/css">@import "webintern.css";</style>
<style type="text/css">
html, body { margin: 0; padding: 0; }
</style>

</head><body>

<div class="deviceContainer" style="background: transparent url(img/icons/png/Power.png) no-repeat scroll 10px 4px;">
    <div class="deviceTitle">
        <div class="deviceTitleContent">TV-DVD</div>
   </div> 
  
<?php
    if(isset($_GET['action']) && $_GET['action'] == "S1" && isset($_GET['id'])) 
    {
    IPS_RunScript(38293);  
    }  
?>   

<div class="variablesContainer" style="height: auto;">

                        <div class="variableContainer" style="background: transparent url(img/icons/png/ArrowRight.png) no-repeat scroll 10px 4px;">
         <div class="deviceTitle">
             <div class="deviceTitleContent">TV An</div>
                </div>                 
                <div class="deviceState"><a href="?action=S1&id=38391"><?php if(GetValue(38391)==1)echo "<div class='SwitchBasic SwitchBasicOn'> <div class='deviceStateContent'>An</div>"; else echo "<div class='SwitchBasic SwitchBasicOff'> <div class='deviceStateContent'>Aus</div>";?></a></div>
           </div>
        </div>

       <div class="variableContainer" style="background: transparent url(img/icons/png/Schloss.png) no-repeat scroll 10px 4px;">
         <div class="deviceTitle">
             <div class="deviceTitleContent">TV Aus</div>
                </div>                 
                <div class="deviceState"><a href="?action=S1&id=38391"><?php if(GetValue(38391)==1)echo "<div class='SwitchBasic SwitchBasicOn'> <div class='deviceStateContent'>An</div>"; else echo "<div class='SwitchBasic SwitchBasicOff'> <div class='deviceStateContent'>Aus</div>";?></a></div>
           </div>
        </div>
        
         <div class="variableContainer" style="background: transparent url(img/icons/png/Schloss.png) no-repeat scroll 10px 4px;">
         <div class="deviceTitle">
             <div class="deviceTitleContent">DVD An</div>
                </div>                 
                <div class="deviceState"><a href="?action=S1&id=38391"><?php if(GetValue(38391)==1)echo "<div class='SwitchBasic SwitchBasicOn'> <div class='deviceStateContent'>An</div>"; else echo "<div class='SwitchBasic SwitchBasicOff'> <div class='deviceStateContent'>Aus</div>";?></a></div>
           </div>
        </div>

          
         <div class="variableContainer" style="background: transparent url(img/icons/png/Schloss.png) no-repeat scroll 10px 4px;">
         <div class="deviceTitle">
             <div class="deviceTitleContent">DVD Aus</div>
                </div>                 
                <div class="deviceState"><a href="?action=S1&id=38391"><?php if(GetValue(38391)==1)echo "<div class='SwitchBasic SwitchBasicOn'> <div class='deviceStateContent'>An</div>"; else echo "<div class='SwitchBasic SwitchBasicOff'> <div class='deviceStateContent'>Aus</div>";?></a></div>
           </div>
        </div>
        
           
         <div class="variableContainer" style="background: transparent url(img/icons/png/Schloss.png) no-repeat scroll 10px 4px;">
         <div class="deviceTitle">
             <div class="deviceTitleContent">DVD zu TV</div>
                </div>                 
                <div class="deviceState"><a href="?action=S1&id=38391"><?php if(GetValue(38391)==1)echo "<div class='SwitchBasic SwitchBasicOn'> <div class='deviceStateContent'>An</div>"; else echo "<div class='SwitchBasic SwitchBasicOff'> <div class='deviceStateContent'>Aus</div>";?></a></div>
           </div>
        </div>
           
           <div class="variableContainer" style="background: transparent url(img/icons/png/Schloss.png) no-repeat scroll 10px 4px;">
         <div class="deviceTitle">
             <div class="deviceTitleContent">TV zu DVD</div>
                </div>                 
                <div class="deviceState"><a href="?action=S1&id=38391"><?php if(GetValue(38391)==1)echo "<div class='SwitchBasic SwitchBasicOn'> <div class='deviceStateContent'>An</div>"; else echo "<div class='SwitchBasic SwitchBasicOff'> <div class='deviceStateContent'>Aus</div>";?></a></div>
           </div>
        </div>
        

</body></html>



MFG Franz

Hallo Franz,

ich hätte es so gemacht.

Setzen einer Bool-Variable True/False mit

<?php
    if(isset($_GET['action']) && $_GET['action'] == "S1" && isset($_GET['id'])) 
    {
        SetValue((int)$_GET['id'], !GetValue(18541));
    }  
?> 

Im Script die Variable abgefragt mit(Script auf Variable triggern)

if(!GetValue(18541))

und entsprechende Funktionen ausgeführt.

Dieses Prozedere für jedes Script einzeln.

Wenn Du einen Augenblick Zeit hast, schreib ich dir das Web mal zusammen.
Den Rest anpassen und anlegen der Variablen und anpassen im Script musst du dann selber machen.

Hallo Franz,

hier mal der Code

<!--
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-->

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">

<style type="text/css">@import "webintern.css";</style>
<style type="text/css">
html, body { margin: 0; padding: 0; }
</style>

</head><body>

<div class="deviceContainer" style="background: transparent url(img/icons/png/Power.png) no-repeat scroll 10px 4px;">
    <div class="deviceTitle">
        <div class="deviceTitleContent">TV-DVD</div>
   </div> 
  
<?php
    if(isset($_GET['action']) && $_GET['action'] == "S1" && isset($_GET['id'])) 
    {
        SetValue((int)$_GET['id'], !GetValue(18541));
    }  
?> 

<div class="variablesContainer" style="height: auto;">

                        <div class="variableContainer" style="background: transparent url(img/icons/png/ArrowRight.png) no-repeat scroll 10px 4px;">
         <div class="deviceTitle">
             <div class="deviceTitleContent">TV An/Aus</div>
                </div>                 
                <div class="deviceState"><a href="?action=S1&id=18541"><?php if(GetValue(18541)==1)echo "<div class='SwitchBasic SwitchBasicOn'> <div class='deviceStateContent'>An</div>"; else echo "<div class='SwitchBasic SwitchBasicOff'> <div class='deviceStateContent'>Aus</div>";?></a></div>
           </div>
        </div>
<?php
    if(isset($_GET['action']) && $_GET['action'] == "S2" && isset($_GET['id'])) 
    {
        SetValue((int)$_GET['id'], !GetValue(53162));
    }  
?> 
       <div class="variableContainer" style="background: transparent url(img/icons/png/ArrowRight.png) no-repeat scroll 10px 4px;">
         <div class="deviceTitle">
             <div class="deviceTitleContent">DVD An/Aus</div>
                </div>                 
                <div class="deviceState"><a href="?action=S2&id=53162"><?php if(GetValue(53162)==1)echo "<div class='SwitchBasic SwitchBasicOn'> <div class='deviceStateContent'>An</div>"; else echo "<div class='SwitchBasic SwitchBasicOff'> <div class='deviceStateContent'>Aus</div>";?></a></div>
           </div>
        </div>

<?php
    if(isset($_GET['action']) && $_GET['action'] == "S5" && isset($_GET['id'])) 
    {
        SetValue((int)$_GET['id'], !GetValue(18541));
    }  
?>         
           
         <div class="variableContainer" style="background: transparent url(img/icons/png/ArrowRight.png) no-repeat scroll 10px 4px;">
         <div class="deviceTitle">
             <div class="deviceTitleContent">DVD zu TV</div>
                </div>                 
                <div class="deviceState"><a href="?action=S5&id=38391"><?php if(GetValue(38391)==1)echo "<div class='SwitchBasic SwitchBasicOn'> <div class='deviceStateContent'>An</div>"; else echo "<div class='SwitchBasic SwitchBasicOff'> <div class='deviceStateContent'>Aus</div>";?></a></div>
           </div>
        </div>
<?php
    if(isset($_GET['action']) && $_GET['action'] == "S6" && isset($_GET['id'])) 
    {
        SetValue((int)$_GET['id'], !GetValue(18541));
    }  
?>            
           <div class="variableContainer" style="background: transparent url(img/icons/png/ArrowRight.png) no-repeat scroll 10px 4px;">
         <div class="deviceTitle">
             <div class="deviceTitleContent">TV zu DVD</div>
                </div>                 
                <div class="deviceState"><a href="?action=S6&id=38391"><?php if(GetValue(38391)==1)echo "<div class='SwitchBasic SwitchBasicOn'> <div class='deviceStateContent'>An</div>"; else echo "<div class='SwitchBasic SwitchBasicOff'> <div class='deviceStateContent'>Aus</div>";?></a></div>
           </div>
        </div>
        

</body></html>

4 Variablen Type Bool anlegen und entsprechend zuordnen.
Dann kannst Du mit jedem Schalter separat schalten. Das ganze im Script noch angepasst und einem Fernseh Wochenende sollte nichts mehr im Wege stehen :slight_smile:

VIELEN VIELEN DANK

Es funktioniert.:):slight_smile:

MFG Franz