Menü
Startseite
Foren
Neue Beiträge
Foren durchsuchen
Aktuelles
Neue Beiträge
Letzte Aktivität
Mitglieder
Registrierte Mitglieder
Zurzeit aktive Besucher
Chat
0
Spende
Anmelden
Registrieren
Aktuelles
Suche
Suche
Nur Titel durchsuchen
Von:
Neue Beiträge
Foren durchsuchen
Menü
Anmelden
Registrieren
Startseite
Foren
Alles was nicht LTspice betrifft
Mikrocontroller, Raspberry und Co.
Velux Dachrollo Steuerung
JavaScript ist deaktiviert. Für eine bessere Darstellung aktiviere bitte JavaScript in deinem Browser, bevor du fortfährst.
Auf Thema antworten
Nachricht
<p>[QUOTE="spicer, post: 882, member: 1"]</p><p>Hier mal ein php. Ist aber noch im beta Status.</p><p>Verbesserungsvorschläge sind natürlich immer willkommen.</p><p></p><p>Zuerst Webserver installieren:</p><p></p><p><strong>sudo apt update</strong></p><p><strong>sudo apt upgrade</strong></p><p><strong>sudo apt install apache2 php</strong></p><p><strong></strong></p><p><strong>sudo chown -R pi:www-data /var/www/html/</strong></p><p><strong>sudo chmod -R 770 /var/www/html/</strong></p><p></p><p>Bei Zugriff von Aussen, unbedingt eine <strong>.htaccess</strong> im Verzeichnis <strong>/var/www/html</strong> anlegen.</p><p><strong>favicon.ico</strong> und <strong>favicon.png</strong> ins Verzeichnis <strong>/var/www/html</strong></p><p></p><p></p><p> index.php (ins Verzeichnis /var/www/html)</p><p></p><p>[SPOILER][CODE]</p><p><!DOCTYPE HTML></p><p><html></p><p><head></p><p><style></p><p>body {</p><p> background-color: #00B233</p><p>}</p><p>.buttons {</p><p> border-radius: 12px;</p><p>}</p><p></style></p><p><link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"></p><p><link rel="shortcut icon" href="/favicon.ico"></p><p><link rel="icon" type="image/png" href="/favicon.png" sizes="32x32"></p><p></p><p><title>VelCont Velux Control</title></p><p><meta charset="utf-8"></p><p><meta http-equiv="X-UA-Compatible" content="IE=Edge"></p><p><meta http-equiv="refresh" content="15; url=https://domainname:8083/"></p><p></head></p><p></p><p><body></p><p></p><p><center></p><p><table></p><p>Dachfenster 1</p><p><br></p><p><tr></p><p><a href="?function=switch1_on"><input type="submit" value="Auf" style="width: 120px; height: 120px; color: black; background-color: #99CC00" class="buttons"></a></p><p><a href="?function=switch1_off"><input type="submit" value="Ab" style="width: 120px; height: 120px; color: black; background-color: #99CC00" class="buttons"></a></p><p></tr></p><p></table></p><p><br></p><p><table></p><p>Dachfenster 2</p><p><br></p><p><tr></p><p><a href="?function=switch2_on"><input type="submit" value="Auf" style="width: 120px; height: 120px; color: black; background-color: #99CC00" class="buttons"></a></p><p><a href="?function=switch2_off"><input type="submit" value="Ab" style="width: 120px; height: 120px; color: black; background-color: #99CC00" class="buttons"></a></p><p></tr></p><p></table></p><p><br></p><p></p><p><?php</p><p></p><p>// Funktionsvariable</p><p></p><p>$function = $_GET['function'];</p><p></p><p>// Auszuführende Commands / send Command</p><p></p><p>if($function == 'switch1_on')</p><p>{</p><p>system('sh /home/pi/man_auf.sh');</p><p>}</p><p>if($function == 'switch1_off')</p><p>{</p><p>system('sh /home/pi/man_ab.sh');</p><p>}</p><p>if($function == 'switch2_on')</p><p>{</p><p>system('sh /home/pi/man_auf2.sh');</p><p>}</p><p>if($function == 'switch2_off')</p><p>{</p><p>system('sh /home/pi/man_ab2.sh');</p><p>}</p><p></p><p>$temp = file_get_contents("/home/pi/Temperatur");</p><p>$hum = file_get_contents("/home/pi/HUM");</p><p>$alarm = file_get_contents("/home/pi/ALARM");</p><p>$alarm2 = file_get_contents("/home/pi/SIGNAL");</p><p>$letzt = file_get_contents("/home/pi/last");</p><p></p><p>echo "<br>Die Aussentemperatur ist $temp °C";</p><p>echo "<br>Die Luftfeuchtigkeit ist $hum %";</p><p>echo "<br>Letzter automatischer Befehl: $letzt";</p><p>echo "<br>Batterie-Status: $alarm";</p><p>echo "<br>Empfangs-Status: $alarm2";</p><p></p><p>?></p><p></p><p></center></p><p></body></p><p></html></p><p> [/CODE][/SPOILER]</p><p></p><p>Ich behandle das Dachfenster2 etwas stiefmütterlich hier, zumal ich selber da nichts angeschlossen habe.</p><p>Auch wird in meinem Scripts bei dem nichts automatisch gesteuert.</p><p>[/QUOTE]</p>
[QUOTE="spicer, post: 882, member: 1"] Hier mal ein php. Ist aber noch im beta Status. Verbesserungsvorschläge sind natürlich immer willkommen. Zuerst Webserver installieren: [B]sudo apt update sudo apt upgrade sudo apt install apache2 php sudo chown -R pi:www-data /var/www/html/ sudo chmod -R 770 /var/www/html/[/B] Bei Zugriff von Aussen, unbedingt eine [B].htaccess[/B] im Verzeichnis [B]/var/www/html[/B] anlegen. [B]favicon.ico[/B] und [B]favicon.png[/B] ins Verzeichnis [B]/var/www/html[/B] index.php (ins Verzeichnis /var/www/html) [SPOILER][CODE] <!DOCTYPE HTML> <html> <head> <style> body { background-color: #00B233 } .buttons { border-radius: 12px; } </style> <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"> <link rel="shortcut icon" href="/favicon.ico"> <link rel="icon" type="image/png" href="/favicon.png" sizes="32x32"> <title>VelCont Velux Control</title> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="refresh" content="15; url=https://domainname:8083/"> </head> <body> <center> <table> Dachfenster 1 <br> <tr> <a href="?function=switch1_on"><input type="submit" value="Auf" style="width: 120px; height: 120px; color: black; background-color: #99CC00" class="buttons"></a> <a href="?function=switch1_off"><input type="submit" value="Ab" style="width: 120px; height: 120px; color: black; background-color: #99CC00" class="buttons"></a> </tr> </table> <br> <table> Dachfenster 2 <br> <tr> <a href="?function=switch2_on"><input type="submit" value="Auf" style="width: 120px; height: 120px; color: black; background-color: #99CC00" class="buttons"></a> <a href="?function=switch2_off"><input type="submit" value="Ab" style="width: 120px; height: 120px; color: black; background-color: #99CC00" class="buttons"></a> </tr> </table> <br> <?php // Funktionsvariable $function = $_GET['function']; // Auszuführende Commands / send Command if($function == 'switch1_on') { system('sh /home/pi/man_auf.sh'); } if($function == 'switch1_off') { system('sh /home/pi/man_ab.sh'); } if($function == 'switch2_on') { system('sh /home/pi/man_auf2.sh'); } if($function == 'switch2_off') { system('sh /home/pi/man_ab2.sh'); } $temp = file_get_contents("/home/pi/Temperatur"); $hum = file_get_contents("/home/pi/HUM"); $alarm = file_get_contents("/home/pi/ALARM"); $alarm2 = file_get_contents("/home/pi/SIGNAL"); $letzt = file_get_contents("/home/pi/last"); echo "<br>Die Aussentemperatur ist $temp °C"; echo "<br>Die Luftfeuchtigkeit ist $hum %"; echo "<br>Letzter automatischer Befehl: $letzt"; echo "<br>Batterie-Status: $alarm"; echo "<br>Empfangs-Status: $alarm2"; ?> </center> </body> </html> [/CODE][/SPOILER] Ich behandle das Dachfenster2 etwas stiefmütterlich hier, zumal ich selber da nichts angeschlossen habe. Auch wird in meinem Scripts bei dem nichts automatisch gesteuert. [/QUOTE]
Zitate einfügen…
Vorschau
Name
Authentifizierung
U=24 V, R=6 Ohm, Wieviel Strom fliesst?
Antworten
Startseite
Foren
Alles was nicht LTspice betrifft
Mikrocontroller, Raspberry und Co.
Velux Dachrollo Steuerung
Oben