Commence asynchronous laughter

I’ve been working on Roomie all day, fixing up things here and there. Here’s another silly demo. It uses the WebHook.SendScript and Computer.Speak commands to simulate a conversation between my laptop and my TV.

Silly.  Here’s a screenshot of the Roomie web interface displaying the script.  I did a lot of refactoring today, and I am so close to being able to un-XMLify RoomieScript and make it look like a real programming language.

Roomie Send Script demo

Happy days! The new Roomie website is usable!

Available at http://roomiebot.com, the new Roomie website works!  I use the website to turn lights and things on and off from my desktop computer, laptop, smartphone, and and old still-has-a-browser iPod touch. 

I spend most of my time on the Devices page, which lists all of the devices in all home automation networks on my account.  (Right now I only have a single Z-Wave network, but in theory I could have a potpourri of different networks that include other existing home automation frameworks, IR transceivers, and—I dunno—USB missile launchers?)

Anyway, the UI all works, and dynamically updates when a devices state changes.  Cool!

roomie_devices

Use C#’s regular expression library to Convert TimeSpan and DateTime to and from strings. (Named capturing groups!)

Well that title is a mouthful.  Long story short, as an exercise in regular expressions I wrote a utility class to convert strings to TimeSpans and DateTimes in C#.  This made great usage of named capturing groups.  (The download to the source code is at the bottom of this post.)

Here is the DateTime regular expression.  Note that when I new the regular expression object, I set whitespace and casing ignoring.
image

Named capturing groups allows code like this:
image

In the end, the utility class allows code like this:
image

fun!  Download all of the code here.

Have any suggestions about the code?  Any neat C# features I should have used?  Comment below!

Another novel (and silly) use for Roomie

I’ve been working (rather obsessively) on Roomie for the past week.  In specific, I have rewritten the XML-based protocol that allows the desktop client to communicate with the web service.  (Say “hi” to it here.)  The new library (which I call WebCommunicator) is sooo much easier to use than my old one, but still has all the nifty (and important) encryption and anti-hacking features.  I will eventually publish the protocol as an independent library.  (Give me a bit to use it more and work out all the kinks.)

But enough technical talk.  Lets get to serious business.  Here I have a little RoomieScript that I wrote, just as a proof of concept.

<RoomieScript>
  <ZWave.PowerOff DeviceName="Coffee Pot" />
  <Core.Loop>
    <ZWave.WaitForChange DeviceName="Coffee Pot" PollInterval="5 Seconds" />
    <ZWave.PowerOff DeviceName="Coffee Pot" />
    <RoomieBot.TextDavid Text="No coffee!" />
  </Core.Loop>
</RoomieScript>

Continue reading

Roomie gets some CSS schooling

This week I have been furiously re-writing a few key elements of the Roomie website.  Specifically, I scrapped the old device button controls, which you can see here. They were ok, but they were very rigid in use, offering only two different pictures to back the buttons.  Zooming on mobile devices didn’t work so great either, since the images were PNGs, raster graphics.  Now I have created a button framework entirely in CSS, HTML, and ASP.NET controls.  Because of this, I can easily create new kinds of controls completely in code, and they even zoom cleanly as well.  My original vision for this was to enable the user to create “virtual device controls”, which would display next to the regular device controls.

Roomie home automation main site on an iPad

Continue reading