@ bumaas - hier wie gewünscht die Beispiele zur IPS Webfront Ansteuerung meiner Wordclock.
Die auf dem mikrocontroller.net WordClock WS2812 Projekt basiert.
Struktur:
Die jeweiligen Profile muss man dann hinterlegen, hier ein Beispiel:
und hier die jeweiligen Skripte gebündelt:
Animation:
<?
if($IPS_SENDER == "WebFront")
{
switch($IPS_VALUE)
{
case 11:
// Laufschrift
Sys_GetURLContent("http://192.168.2.4/animations?animation=11&action=saveanimation");
SetValue(33860 /*[sonstiges\Wortuhr\Animation]*/,11);
break;
case 10:
// Laufschrift
Sys_GetURLContent("http://192.168.2.4/animations?animation=10&action=saveanimation");
SetValue(11792 /*[sonstiges\Wortuhr\Modus]*/,10);
break;
case 9:
// Laufschrift
Sys_GetURLContent("http://192.168.2.4/animations?animation=9&action=saveanimation");
SetValue(33860 /*[sonstiges\Wortuhr\Animation]*/,9);
break;
case 8:
// Laufschrift
Sys_GetURLContent("http://192.168.2.4/animations?animation=8&action=saveanimation");
SetValue(33860 /*[sonstiges\Wortuhr\Animation]*/,8);
break;
case 7:
// Laufschrift
Sys_GetURLContent("http://192.168.2.4/animations?animation=7&action=saveanimation");
SetValue(33860 /*[sonstiges\Wortuhr\Animation]*/,7);
break;
case 6:
// Laufschrift
Sys_GetURLContent("http://192.168.2.4/animations?animation=6&action=saveanimation");
SetValue(33860 /*[sonstiges\Wortuhr\Animation]*/,6);
break;
case 5:
// Laufschrift
Sys_GetURLContent("http://192.168.2.4/animations?animation=5&action=saveanimation");
SetValue(33860 /*[sonstiges\Wortuhr\Animation]*/,5);
break;
case 4:
// Laufschrift
Sys_GetURLContent("http://192.168.2.4/animations?animation=4&action=saveanimation");
SetValue(33860 /*[sonstiges\Wortuhr\Animation]*/,4);
break;
case 3:
// Laufschrift
Sys_GetURLContent("http://192.168.2.4/animations?animation=3&action=saveanimation");
SetValue(33860 /*[sonstiges\Wortuhr\Animation]*/,3);
break;
case 2:
// Laufschrift
Sys_GetURLContent("http://192.168.2.4/animations?animation=2&action=saveanimation");
SetValue(33860 /*[sonstiges\Wortuhr\Animation]*/,2);
break;
case 1:
// Laufschrift
Sys_GetURLContent("http://192.168.2.4/animations?animation=1&action=saveanimation");
SetValue(33860 /*[sonstiges\Wortuhr\Animation]*/,1);
break;
}
}
?>
Es ist:
<?
if($IPS_SENDER == "WebFront")
{
switch($IPS_VALUE)
{
case 1:
// AN ES IST
Sys_GetURLContent("http://192.168.2.4/display?itis=active&action=saveitis");
SetValue(28355 /*[sonstiges\Wortuhr\Es Ist]*/,1);
break;
case 0:
// AUS ES IST
Sys_GetURLContent("http://192.168.2.4/display?action=saveitis");
SetValue(28355 /*[sonstiges\Wortuhr\Es Ist]*/,0);
break;
}
}
?>
Farbe:
<?
if($IPS_SENDER == "WebFront")
{
switch($IPS_VALUE)
{
case 7:
// GRUEN
Sys_GetURLContent("http://192.168.2.4/display?red=0&green=63&blue=0&action=savecolors");
SetValue(12602 /*[sonstiges\Wortuhr\Farbe]*/,7);
break;
case 6:
// BLAU
Sys_GetURLContent("http://192.168.2.4/display?red=0&green=63&blue=63&action=savecolors");
SetValue(12602 /*[sonstiges\Wortuhr\Farbe]*/,6);
break;
case 5:
// ROT
Sys_GetURLContent("http://192.168.2.4/display?red=63&green=0&blue=0&action=savecolors");
SetValue(12602 /*[sonstiges\Wortuhr\Farbe]*/,5);
break;
case 4:
// WEISS
Sys_GetURLContent("http://192.168.2.4/display?red=63&green=63&blue=45&action=savecolors");
SetValue(12602 /*[sonstiges\Wortuhr\Farbe]*/,4);
break;
case 3:
// ROSA
Sys_GetURLContent("http://192.168.2.4/display?red=63&green=0&blue=25&action=savecolors");
SetValue(12602 /*[sonstiges\Wortuhr\Farbe]*/,3);
break;
case 2:
// LILA
Sys_GetURLContent("http://192.168.2.4/display?red=34&green=34&blue=63&action=savecolors");
SetValue(12602 /*[sonstiges\Wortuhr\Farbe]*/,2);
break;
case 1:
//ORANGE
Sys_GetURLContent("http://192.168.2.4/display?red=63&green=32&blue=0&action=savecolors");
SetValue(12602 /*[sonstiges\Wortuhr\Farbe]*/,1);
break;
case 0:
//GELB
Sys_GetURLContent("http://192.168.2.4/display?red=63&green=63&blue=0&action=savecolors");
SetValue(12602 /*[sonstiges\Wortuhr\Farbe]*/,0);
break;
}
}
?>
Helligkeit:
<?
if($IPS_SENDER == "WebFront")
{
switch($IPS_VALUE)
{
case 15:
Sys_GetURLContent("http://192.168.2.4/display?brightness=15&action=savebrightness");
SetValue(11879 /*[sonstiges\Wortuhr\Helligkeit]*/,15);
break;
case 14:
Sys_GetURLContent("http://192.168.2.4/display?brightness=14&action=savebrightness");
SetValue(11879 /*[sonstiges\Wortuhr\Helligkeit]*/,14);
break;
case 13:
Sys_GetURLContent("http://192.168.2.4/display?brightness=13&action=savebrightness");
SetValue(11879 /*[sonstiges\Wortuhr\Helligkeit]*/,13);
break;
case 12:
Sys_GetURLContent("http://192.168.2.4/display?brightness=12&action=savebrightness");
SetValue(11879 /*[sonstiges\Wortuhr\Helligkeit]*/,12);
break;
case 11:
Sys_GetURLContent("http://192.168.2.4/display?brightness=11&action=savebrightness");
SetValue(11879 /*[sonstiges\Wortuhr\Helligkeit]*/,11);
break;
case 10:
Sys_GetURLContent("http://192.168.2.4/display?brightness=10&action=savebrightness");
SetValue(11879 /*[sonstiges\Wortuhr\Helligkeit]*/,10);
break;
case 9:
Sys_GetURLContent("http://192.168.2.4/display?brightness=9&action=savebrightness");
SetValue(11879 /*[sonstiges\Wortuhr\Helligkeit]*/,9);
break;
case 8:
Sys_GetURLContent("http://192.168.2.4/display?brightness=8&action=savebrightness");
SetValue(11879 /*[sonstiges\Wortuhr\Helligkeit]*/,8);
break;
case 7:
Sys_GetURLContent("http://192.168.2.4/display?brightness=7&action=savebrightness");
SetValue(11879 /*[sonstiges\Wortuhr\Helligkeit]*/,7);
break;
case 6:
Sys_GetURLContent("http://192.168.2.4/display?brightness=6&action=savebrightness");
SetValue(11879 /*[sonstiges\Wortuhr\Helligkeit]*/,6);
break;
case 5:
// Helligkeit
Sys_GetURLContent("http://192.168.2.4/display?brightness=5&action=savebrightness");
SetValue(11879 /*[sonstiges\Wortuhr\Helligkeit]*/,5);
break;
case 4:
// Helligkeit
Sys_GetURLContent("http://192.168.2.4/display?brightness=4&action=savebrightness");
SetValue(11879 /*[sonstiges\Wortuhr\Helligkeit]*/,4);
break;
case 3:
// Helligkeit 8
Sys_GetURLContent("http://192.168.2.4/display?brightness=3&action=savebrightness");
SetValue(11879 /*[sonstiges\Wortuhr\Helligkeit]*/,3);
break;
case 2:
// Helligkeit 5
Sys_GetURLContent("http://192.168.2.4/display?brightness=2&action=savebrightness");
SetValue(11879 /*[sonstiges\Wortuhr\Helligkeit]*/,2);
break;
case 1:
// Helligkeit 2
Sys_GetURLContent("http://192.168.2.4/display?brightness=1&action=savebrightness");
SetValue(11879 /*[sonstiges\Wortuhr\Helligkeit]*/,1);
break;
case 0:
// Helligkeit 1
Sys_GetURLContent("http://192.168.2.4/display?brightness=0&action=savebrightness");
SetValue(11879 /*[sonstiges\Wortuhr\Helligkeit]*/,0);
break;
}
}
?>
Modus:
<?
if($IPS_SENDER == "WebFront")
{
switch($IPS_VALUE)
{
case 4:
// Laufschrift
Sys_GetURLContent("http://192.168.2.4/?ticker=hallo&action=saveticker");
SetValue(11792 /*[sonstiges\Wortuhr\Modus]*/,4);
break;
case 3:
// Wetterbericht Lauftext
$text1=GetValueFloat(58453 /*[Infos\Wetter\WUNDERGROUND\WundergroundWetter\Temperatur]*/);
$text2=GetValueString(25022 /*[Infos\Wetter\WUNDERGROUND\WundergroundWetter\WetterText]*/);
$text3=GetValueFloat(46964 /*[Infos\Wetter\WUNDERGROUND\WundergroundWetter\Sonnenstrahlung]*/);
// Wetterbericht Lauftext
Sys_GetURLContent("http://192.168.2.4/?ticker=$text1+Grad,+$text2,+$text3+W/qm&action=saveticker");
SetValue(11792 /*[sonstiges\Wortuhr\Modus]*/,3);
break;
case 2:
// TEST
Sys_GetURLContent("http://192.168.2.4/display?action=testdisplay");
SetValue(11792 /*[sonstiges\Wortuhr\Modus]*/,2);
break;
case 1:
// AUS
Sys_GetURLContent("http://192.168.2.4/display?action=poweroff");
SetValue(11792 /*[sonstiges\Wortuhr\Modus]*/,1);
break;
case 0:
// AN
Sys_GetURLContent("http://192.168.2.4/display?action=poweron");
SetValue(11792 /*[sonstiges\Wortuhr\Modus]*/,0);
break;
}
}
?>
Sprache:
<?
if($IPS_SENDER == "WebFront")
{
switch($IPS_VALUE)
{
case 3:
// Modus Sprache RHEIN_RUHR
Sys_GetURLContent("http://192.168.2.4/display?displaymode=3&action=savedisplaymode");
SetValue(24984 /*[sonstiges\Wortuhr\Sprache]*/,3);
break;
case 2:
// Modus Sprache OSSI
Sys_GetURLContent("http://192.168.2.4/display?displaymode=2&action=savedisplaymode");
SetValue(24984 /*[sonstiges\Wortuhr\Sprache]*/,2);
break;
case 1:
// WESSI
Sys_GetURLContent("http://192.168.2.4/display?displaymode=1&action=savedisplaymode");
SetValue(24984 /*[sonstiges\Wortuhr\Sprache]*/,1);
break;
case 0:
// SCHWABEN
Sys_GetURLContent("http://192.168.2.4/display?displaymode=0&action=savedisplaymode");
SetValue(24984 /*[sonstiges\Wortuhr\Sprache]*/,0);
break;
}
}
?>
Wetterbericht:
<?
if($IPS_SENDER == "WebFront")
{
switch($IPS_VALUE)
{
case 1:
$text1=GetValueFloat(58453 /*[Infos\Wetter\WUNDERGROUND\WundergroundWetter\Temperatur]*/);
$text2=GetValueString(25022 /*[Infos\Wetter\WUNDERGROUND\WundergroundWetter\WetterText]*/);
$text3=GetValueFloat(46964 /*[Infos\Wetter\WUNDERGROUND\WundergroundWetter\Sonnenstrahlung]*/);
// Wetterbericht Lauftext
Sys_GetURLContent("http://192.168.2.4/?ticker=$text1+Grad,+$text2,+$text3+W/qm&action=saveticker");
SetValue(31727 /*[sonstiges\Wortuhr\Wetterbericht]*/,1);
break;
case 0:
//Sys_GetURLContent("http://192.168.2.4/?ticker=Hab+dich+Lieb&action=saveticker");
break;
}
}
?>