Hallo,
bisher lassen sich ja nur Werte von der UVR abfragen.
Mit diesem Plugin lassen sich auch Werte senden.
Alles wird über die Konfigurationsdatei eingestellt. Im Plugin sind keinerlei Änderungen nötig:
[WARNUNG]Und jetzt will ich nie wieder hören, dass CommunityGate User bisher nie zur Community beigetragen haben.
[/WARNUNG]
Hiermit kann man jetzt also alle Ausgänge der UVR schalten.
Ich habe allerdings noch keine Möglichkeit Inputs an die UVR zu senden, die dann von deren Logiken verwendet werden. Da müsste sich jemand mit guten HTML-Kenntnissen das Web-IF ansehen.
Viel Spaß!
Gruß,
Hendrik
bisher lassen sich ja nur Werte von der UVR abfragen.
Mit diesem Plugin lassen sich auch Werte senden.
Alles wird über die Konfigurationsdatei eingestellt. Im Plugin sind keinerlei Änderungen nötig:
Code:
# Ermitteln der URLs über http://IP-Der-1611/580600.htm #IP der UVR: $uvr_ip = '192.168.178.5'; @GAs = ( # Wenn eine 0 auf die 3/7/3 gesendet wird, wird die URL 580600.htm?blw91A12005=1 aufgerufen. { URL=> "580600.htm?blw91A12005=1", ga => "3/7/3", value => 0}, # Ofen Aus { URL=> "580600.htm?blw91A12005=2", ga => "3/7/3", value => 1}, # Ofen Ein { URL=> "580600.htm?blw91A12005=3", ga => "3/7/4", value => 0}, # Ofen Auto { URL=> "580600.htm?blw91A12005=3", ga => "3/7/4", value => 1} # Ofen Auto );
Code:
#!/usr/bin/perl use strict; use LWP::Simple; # ****************************************************************************** # Das Plugin schaltet Ausgänge der UVR1611 # Finden der URL über # http://IP-Der-1611/580600.htm # ****************************************************************************** #################### ###Einstellungen:### #################### my $uvr_ip;# = '192.168.1.5'; my @GAs; &readConf; ###################### ##ENDE Einstellungen## ###################### plugin_log($plugname,'Startet '); $plugin_info{$plugname.'_cycle'} = 86400; plugin_log($plugname,'Grund des Aufruf: ' . $msg{'apci'}. ' '. $msg{'dst'}. ' '. $msg{'value'} ); foreach my $curr_ga (@GAs) { $plugin_subscribe{$curr_ga->{ga}}{$plugname} = 1; #An Gruppenadresse anmelden plugin_log($plugname,'Subscribe: ' . $curr_ga->{ga} ); if (($msg{'apci'} eq "A_GroupValue_Write") and ($msg{'dst'} eq ($curr_ga->{ga})) and ($msg{'value'}eq($curr_ga->{value}))) { get( "http://".$uvr_ip."/".$curr_ga->{URL}); plugin_log($plugname,'Call: ' . "http://".$uvr_ip."/".$curr_ga->{URL} ); } } return; ### READ CONF ### sub readConf { my $confFile = '/etc/wiregate/plugin/generic/conf.d/'.basename($plugname,'.pl').'.conf'; if (! -f $confFile) { plugin_log($plugname, "no conf file [$confFile] found."); } else { #plugin_log($plugname, "reading conf file [$confFile]."); open(CONF, $confFile); my @lines = <CONF>; close($confFile); my $result = eval("@lines"); #($result) and plugin_log($plugname, "conf file [$confFile] returned result[$result]"); if ($@) { plugin_log($plugname, "ERR: conf file [$confFile] returned:"); my @parts = split(/\n/, $@); plugin_log($plugname, "--> $_") foreach (@parts); } } } # Copyright (C) 2013, Hendrik Friedel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>
[/WARNUNG]
Hiermit kann man jetzt also alle Ausgänge der UVR schalten.
Ich habe allerdings noch keine Möglichkeit Inputs an die UVR zu senden, die dann von deren Logiken verwendet werden. Da müsste sich jemand mit guten HTML-Kenntnissen das Web-IF ansehen.
Viel Spaß!
Gruß,
Hendrik
Kommentar