[Pusch] zufälliges Schalten

… hatten wir schon mal - egal :rolleyes:


$id_ch1_Leuchtstaebe = 58737;
$id_ch2_VerandaLK = 19614;
$id_ch3_Rentier = 34719;
$id_ch4_VerandaLampe = 46709;
$id_LK_KK = 31576;
$id_LK_Silvia = 30079;
$id_LK_Giebel = 56530;
$id_LK_Sternschnuppe = 18831;

srand ((double)microtime()*1000000);   // Startwert für den Zufallsgenerator festlegen
$zufall = rand(1,254);                 // von 1 bis 254 > mindestens ein Licht (alles AUS = 0) und nicht alle AN (würde 255 bedeuten)
echo "Zufall: $zufall
";

FS20_SwitchMode($id_ch1_Leuchtstaebe, ($zufall & 1)==1 );   // Web_LK_Giebel
FS20_SwitchMode($id_ch2_VerandaLK, ($zufall & 2)==2 );   // Web_LK_Veranda
FS20_SwitchMode($id_ch3_Rentier, ($zufall & 4)==4 );   // Web_LK_Links - KK
FS20_SwitchMode($id_ch4_VerandaLampe, ($zufall & 8)==8 );   // Web_LK_Rechts - Xmas Stern
FS20_SwitchMode($id_LK_KK, ($zufall & 16)==16);  // Web_LK_Oben - Gäste
FS20_SwitchMode($id_LK_Silvia, ($zufall & 32)==32);  // Web_LK_Rentier
FS20_SwitchMode($id_LK_Giebel, ($zufall & 64)==64);  // Fensterlicht
FS20_SwitchMode($id_LK_Sternschnuppe, ($zufall & 128)==128);  // Web_LK_Sternschnuppe

Wieviel kW verbraucht die Weihnachtsbeleuchtung :smiley: