#!/usr/bin/perl # convert ZWAVE-Alliance XML description file into openzwacve format, which can # be digested by the FHEM ZWave module. Note: only the config parameters are converted. if($#ARGV != -1) { print STDERR "Usage: perl zwave_alliance2open.pl < zwavealliance.xml > openzwave.xml\n"; exit(1); } my ($inTag, $name,$desc,$pnum,$size,$dflt,$min,$max); print "\n"; print " \n"; while(my $l = <>) { $inTag = 1 if($l =~ //); $inTag = 0 if($l =~ //); if($inTag) { $name = $1 if($l =~ m/(.*)<\/Name>/); $desc = $1 if($l =~ m/(.*)<\/Description>/); $pnum = $1 if($l =~ m/(.*)<\/ParameterNumber>/); $size = $1 if($l =~ m/(.*)<\/Size>/); $dflt = $1 if($l =~ m/(.*)<\/DefaultValue>/); $min = $1 if($l =~ m/(.*)<\/minValue>/); $max = $1 if($l =~ m/(.*)<\/maxValue>/); } if($l =~ /<\/ConfigurationParameterExport>/) { print " \n"; print " $desc\n"; print " \n"; $inTag = 0; } } print " \n"; print "\n";