[Project] Audrey Interface

electron

Administrator
Staff member
I noticed there is some interest in this audrey interface project I am working on, so I figured I would start a thread since some people want to help out to make things move faster.

Requirements:
  • 640x480 (audrey screen resolution in full screen mode)
  • GIF or JPG, depending on the need for animation and/or speed
  • Should be generated on the fly using the HS activex object
  • Generated using apache/php and GD or ImageMagick (IIS/ASP is an option, but not as fast)
My sig is a proof of concept, it's a GIF file, built from several other GIF files (i.e. the background, the car icon) and data pulled from the HS object. My sig:

homeseer.php


Why?

This method wouldn't use much cpu power, allows you to create a very nice looking interface (including status of devices, latest snapshot of your security cams, etc) with an advanced layout considering the Audrey browser doesn't support advanced HTML. I have done this using HTML using many GIF's to build the layout, which slowed down Audrey considerably. the HTML imagemap code can be used to control objects, clicking on an object would refresh the GIF anyways, but for now, it will be all about a nice status screen. Considering the screen is 640x480, this display could also be used on TV's. Of course, this setup could be used with any touchscreen no matter what resolution, the point here is to do as much as possible with your tiny audrey cpu ;)
 
here is the php code for my sig, might be a good starting point

Code:
<?
  $hs = new COM("HomeSeer.Application");

  Header("Content-type: image/png");
  $im = ImageCreate(290,80);
  $im = imagecreatefrompng("bg.png");

  $car = imagecreatefromgif("images/taurus.gif");
  #imagecolortransparent ($car, imagecolorat ($car, 0, 0));
  imagecopy ($im, $car, 233, 2, 0, 0, imagesx($car), imagesy($car));

  #$blue = ImageColorAllocate($im,0x5B,0x69,0xA6);
  $white = ImageColorAllocate($im,255,255,255);
  $black = ImageColorAllocate($im,0,0,0);
  $font = "arial.ttf";
  $List=$hs->GetDeviceList();
  $devices = $List->Count();
  $devices = "Devices: " . $devices;
  $events = "Events: " . $hs->EventCount();
  $uptime = "Uptime: " . $hs->SystemUptime();
  $version = "Version: " . $hs->Version();
  $lastevent = "Last event: " . $hs->GetLastEvent();
  $temp = "Outside temperature: " . $hs->DeviceString("w2");
  $hits = "Website hits: " . $hs->WEBStatsPageViews();
  $carstatus = $hs->DeviceString("D2");
  if (strstr($carstatus,"road")) {
    $carstatus = "on the road";
    $carx = 226;
  } else {
    $carstatus = "parked";
    $carx = 240;
  }
  imageColorTransparent($im, $white);


  ImageTTFText($im, 12, 0, 2, 13, $black, "ariblk.ttf", "Homeseer Live Stats");

  ImageTTFText($im, 9, 0, 2, 25, $black, $font,$devices);
  ImageTTFText($im, 9, 0, 80, 25, $black, $font,$events);
  ImageTTFText($im, 9, 0, 2, 55, $black, $font,$lastevent);
  ImageTTFText($im, 9, 0, 95, 45, $black, $font,$hits);
  ImageTTFText($im, 9, 0, 2, 45, $black, $font,$version);
  ImageTTFText($im, 9, 0, 2, 35, $black, $font,$temp);
  ImageTTFText($im, 9, 0, 2, 65, $black, $font,$uptime);
  ImageTTFText($im, 9, 0, $carx, 43, $black, $font, $carstatus);


  ImagePNG($im);

  unset($hs);
?>
 
Electron, that's an excellent idea. The limitations you've mentioned were some of the things that kept me from embracing the Audrey as an interface, but your approach to overcoming them is an excellent idea!
I'm really deep into MainLobby now, so this may not be something I'd personally pursue for use on an Audrey, but I'd like to have some clickcable-generated on-the-fly images to use on my regular web pages.
I followed the signature thread over at HS (actually I think I started by asking you how you did it) rather closely, but put off pursuing it as a low priority (have to budget my time to keep WAF high).

Anyway, I'm interested to see how this progresses (gosh, I'm a leech)... :unsure:
 
I really would like the interface to look as cool as Mainlobby, if not cooler, that's for sure.
 
I'm working on a dynamic image project right now, here is what I got so far:

sig.png


It's a work in progress(obviously)...but it's coming along
 
Im a little confused. First i thought we were talking about the Audrey Interface and now i think were talking about signatures.

Anyhow ill stick with the subject....
I took your examples from another post and installed the touchpad plugin. Personally i think it looks horrible and wouldnt dare display it on any touchscreen arround the house.

If were going to make an interface then i think we need to do some recruiting from another website like a Graphics Web Fourm or something. I would say make the interface and dummy friendly as possible meaning create a PHP Admin page which can totally customize everything without typing any code. And i also think it should be Skinable. Everyone has differnt taste so if we could make it so you could download new skins(themes) then eventually users will make some great skins and then you could setup a section where you can download skins for your interface.

I dont know much about Audreys but i beleive the touchscreen is just a browser is it not?

Personally i think we need to collaborate and take our time not rush a project like this.

One thing i would like to see for starters in graphics that look fun like the MSN icons and the WindowsXP color scheme. Also i would like to see and option so that you can set the theme to change on certain dates. This way when the christmas season comes the theme will automatically display a santa or whatever theme i have picked for that day.

I think that all the Status and other information should be gathered into a mySQL database so that you can easily query it.

The interface should have a webbrowser within the webrowser. Meaning that you touch the internet icon and it apears that you are still in the same interface but now you can type in a adress with the BUILT IN KEYBOARD which i think is necessary. I could go on for years with ideas so we need to leave open the option for expandability.

Sorry if none of this makes since!
 
Check the first post, you will see why we talk about our sigs, you are talking about something else, our goal is to use a single 640x480 graphic image (such as jpg/gif) to reflect the status of all devices etc, more reasons can be found in the first post.
 
Oh i understand now. OK... Well as soon as i get apache up and running i am going to start on some of the thoughts i have above... Im not good with php but i have done some very little stuff with it. I mainly going to design the look for what i want first and then worry about the rest when i learn more about homeseer and php.

When the time comes would you give me a hand. Theproblem with php i have is not so much the php but designing an effective database. You know with the ID's and all the other fields and tables. I'v read two books on it but it really takes a talent to get it even close to perfect
 
adding a database would only cause more overhead, what do you plan to use the database for?
 
I was thinking that it would be for organization. I dont know anything about what i am trying to do so i guess i will ahve to wait until i have more experience. My thought was that if all the configuration is stored in a database then it would be easier to write a admin page which would allow for easier customization. I mean take this message board for example. Im sure you have a nice little admin page which you can use to change password settings and other user settings and that all probably gets stored in a mySQL database. You can change the color sheme and personalize it for each individual user. You can keep an access log of who enters the site.

What other ways would you do this. I wouldnt store in text files because it seams like it would take alot more programming in order to carry out a simple task. But once again im not experienced in any of this so please share you insight with me.
 
If you are planning on only storing some settings etc, then text files is fine, databases are only useful if you have a lot of data to store and process, which wouldn't be the case here. Just load the text file into an array, which allows you to search it and get results instantly, that's how all my small php scripts work.
 
Iv never used text files before. How much of a speed difference is it. Do you have to use more code to sort through all the lines of data in the text file. If i recall correctly you pretty much need to know where the data is in order to retreive it right? Where as a database you could just say Sort by whatever and get exactly what you want. Wouldnt it take alot more code to sort through the data in a text file. If not can you explain how the text stuff work.
 
Personally, I've worked with both text files and databases, text files seem easier, to read data from.


Code:
$file=file("http://192.168.1.5:61300");
foreach($file as $line) {
if (ereg(".*<Item_0>(.*)</Item_0>",$line,$regs)) {
$uptime = Trim($regs[1]);
}
}

In that code(part of my dynamic signature image), thats reading a line of text in an xml file, it reads the data between <Item_0> and </Item_0>. Then creates the variable $uptime, for use in the image later on.
 
Back
Top