From: Bruce W. <br...@mi...> - 2003-05-09 04:06:19
|
> Sounds like a good idea to me, being that I wouldn't have a clue how to > accomplish this myself. > Is there a way I can start to implement this myself? How do I connect a > voice command to a button press? We have lots of options here. I was thinking one of the more general and flexable options would be to define new Generic_Items for modes we might want to toggle, like this: $vacation_mode = new Generic_Item; Then we could update pages like the ia5 modes page with something like this: <a href='/SET;referer?$vacation_mode=toggle'> <img src=/bin/get_state_image.pl?$vacation_mode alt='Vacation Mode' border=0></a></td> Where we create a new get_state_image.pl script to return an image based on an object name and it's current state. I just created this mh/web/bin/get_state_image.pl script: ---- my ($object) = @ARGV; my $state = eval "state $object"; print "get_state.pl error: $@" if $@; print "returning status of $object: $state\n"; $object = substr $object, 1; # Drop leading $ my $image_file = "$config_parms{html_dir}/graphics/${object}_$state.gif"; $image_file = "$config_parms{html_dir}/graphics/button.jpg" unless -e $image_file; my $image_data = file_read $image_file; return &mime_header($image_file, 1, length $image_data) . $image_data; --- Seems to be working ok! I think now all we need is a set of buttons to match the various states in the ia5 modes menu. Ron, you in a button making mood? If not, I can cook something up, although my buttons never look as nice. > Is it possible to display the state of an input on these screens. At > this stage I'm only using 1 wire interfaces, no X10. Try this url: http://localhost:8080/bin/list?iButton from the ia5 MrHouse 'Browse Items' button. Bruce |