Steuerung der Außenbeleuchtung

Einmal stand ich vor der Aufgabe, das Beleuchtungssteuerungssystem für den Außenbereich zu modernisieren: künstlerische Beleuchtung von Fassaden, Werbeschildern, Straßenmasten, Beleuchtung von Adressschildern usw. Der Modernisierungsbedarf wurde dadurch verursacht, dass die Arbeiten an Beleuchtungsanlagen häufig erforderlich waren menschliche Beteiligung. Damit die Steuerung wie erwartet, war es notwendig, manuell einstellen die ein- und ausgeschaltet Zeiten .





IT . , . , , . . , , , .





: , , , .





, , . . , - . , . () .





. (). RS485 -, . SCADA OPC-, Ethernet, . .





, . , : , . . , . . .





, , . . , / , . , . : , () 0. . , "-6" , 6°. , , . .





, . , . -, - . , . , Ethernet, , Linux-.





-, . - , Modbus TCP.





Modbus modpoll. Linux :





$ wget https://www.modbusdriver.com/downloads/modpoll.tgz
$ tar xzf modpoll.tgz
$ sudo cp modpoll/linux_x86-64/modpoll /usr/local/bin/
      
      



:





# 
$ modpoll -m tcp -r 2 -t 0 -a 1 -p 502 192.168.0.227 1 1 1 1 1 1 1 1 

# 
$ modpoll -m tcp -r 2 -t 0 -a 1 -p 502 192.168.0.227 0 0 0 0 0 0 0 0 
      
      



- . , . , , "".





, «». , . : , . , 0°50′ 6°, — 6° 12°, — 12° 18°.





. , , . , ( -6° ) ( -6° ). , , , -6° .





.

, , . . , . , , . , , . - .





, , .





Youtube - / How the sun moves across the sky (by daybit).





, . - , - . Linux Perl, . :





$ sudo cpan install Astro::Coord::ECI
      
      



get_sun_elevation.pl, .





#!/usr/bin/perl
#          
# get_sun_elevation.pl 55.7558 37.6173 127
# 55.7558 -   
# 37.6173 -   
# 127 -      

use Astro::Coord::ECI::Sun;
use Astro::Coord::ECI::Utils qw{:all};

my ($lat, $lon, $elev) = (deg2rad($ARGV[0]), deg2rad($ARGV[1]), $ARGV[2]/1000);

my $time = time ();

my $loc = Astro::Coord::ECI->geodetic ($lat, $lon, $elev);

my $sun = Astro::Coord::ECI::Sun->universal ($time);

my ($azimuth, $elevation, $range) = $loc->azel ($sun);

print rad2deg ($elevation), "\n";
      
      



moscow_lights_ctrl.sh . , , - :





#!/bin/sh

[ -z "$1" ] && angle=-6 || angle=$1

sun_angle=`./sun_pos.pl 55.751244 37.618423 124`

if [ $(echo "$sun_angle >= $angle" |bc -l) -eq "0" ]; then
  modpoll -m tcp -r 2 -t 0 -a 1 -p 502 192.168.0.227 1 1 1 1 1 1 1 1
  exit 0
fi

modpoll -m tcp -r 2 -t 0 -a 1 -p 502 192.168.0.227 0 0 0 0 0 0 0 0
      
      



, , -1.5°. , , .





cron moscow_lights_ctrl.sh :





#    1.5  -  ,  - 
* * * * * root /path/to/moscow_lights_ctrl.sh -1.5
      
      



. , . -, Modbus TCP.





. .





ZABBIX

, . . , . , .. , . , - ZABBIX.





. ZABBIX.





ZABBIX

astro_outdoor_lighting Zabbix :





  • {$CIVIL_DEGREES} - . ,





  • {$ELEV} - ,





  • {$LAT} - ,





  • {$LON} - .





- elevation. .





, get_sun_elevation.pl.





/usr/lib/zabbix/externalscripts/get_sun_elevation.pl
#!/usr/bin/perl
#          
# get_sun_elevation.pl 55.7558 37.6173 127
# 55.7558 -   
# 37.6173 -   
# 127 -      

use Astro::Coord::ECI::Sun;
use Astro::Coord::ECI::Utils qw{:all};

my ($lat, $lon, $elev) = (deg2rad($ARGV[0]), deg2rad($ARGV[1]), $ARGV[2]/1000);

my $time = time ();

my $loc = Astro::Coord::ECI->geodetic ($lat, $lon, $elev);

my $sun = Astro::Coord::ECI::Sun->universal ($time);

my ($azimuth, $elevation, $range) = $loc->azel ($sun);

print rad2deg ($elevation), "\n";
      
      



ZABBIX .





civil_twilight_dawn , . . , .





github.





, , . .





ZABBIX

[]->[] facade light off facade light on.





civil_twilight_dawn "", , .. facade light on. , facade light off. []->[] facade light, .





.





ZABBIX .





. - .





, ( cron) . . , . ., . , - , .





Die Variante mit einem Überwachungssystem kann noch interessantere Probleme lösen. Zusätzlich zur Steuerung ist es möglich, den Betrieb des Geräts zu überwachen und das Personal zu benachrichtigen, wenn eine Fehlfunktion festgestellt wird. Ein Beispiel ist die synchrone Aufnahme von Werbeschildern an der Fassade eines Einkaufszentrums. Und im Falle einer Fehlfunktion eines Zeichens erhält das Bedienpersonal eine Nachricht.





All dies ist natürlich relevant, wenn irgendeine Art von IT-Infrastruktur vorhanden ist. In der Regel ist es jedoch verfügbar.





Das ist alles. Vielen Dank für Ihre Aufmerksamkeit!








All Articles