Here is my perl script that I use to feed room temperature to with a cron job...
Example:
./zm_trigger_sock.pl 4 32F
root@system-z:~/bin/cron_scripts# cat zm_trigger_sock.pl
#!/usr/bin/perl -w
use strict;
use IO::Socket;
our $mid = $ARGV[0]||'1';
our $string = $ARGV[1]||'Test';
our $port = $ARGV[2]||'6802';
my $buffer = $mid . '|show||||' . $string;
my $sock = new IO::Socket::INET (
PeerAddr => 'localhost',
PeerPort => $port,
Proto => 'tcp',
);
die "Could not create socket: $!\n" unless $sock;
print $sock "$buffer";
close($sock);
exit 0;