February 4, 2010

UNIX time with AppleScript in Seconds

The current time in seconds since the UNIX epoch is easy to obtain in AppleScript. Calculate the difference since the UNIX epoch of January 1, 1970 and adjust for the local GMT offset. The 1970 date format will have to be adjusted for the local machines format.

(current date) - (date ("1/1/1970")) - (time to GMT)

Here is a kludge to convert the real result to an integer string

set nowSeconds to ((current date) - (date ("1/1/1970")) - (time to GMT)) as miles as string

The miles class can be most anything like gallons, feet, etc

January 14, 2010

INSTEON PowerLinc 2413U FTDI Driver Details

Currently using version 2.2.14 of the FTDI driver for the INSTEON PowerLinc 2413U with Perceptive Automation's Indigo on Mac OS X. It was released 21-Oct-2009. It is located in /System/Library/Extensions/FTDIUSBSerialDriver.kext/. It is available from FTDI Chip. Also available is an Installation Guide.

January 4, 2010

Positioning Network Camera via Indigo Home Control

Panasonic Network cameras like the BL-C10A can be positioned to presets via http URLs. Currently cron is used to move them out of the sun on fixed times. Using Indigo would make the moves more flexible based on conditions such as sunrise and outside temperature. The old cameras tend to get stuck when its cold. Below is a test script that is embedded in the action pane of an Indigo Trigger.

property position : 5
property camURL : "webcam4.homecontrol.net.:8684"
try
do shell script "curl -s http://" & camURL & "/mobile?A=P" & position & "> /dev/null"
end try

November 25, 2009

Oregon Scientific WMR100, WMR200 and RMS300 USB Protocol

Finally someone has published a detailed explanation of the Oregon Scientific USB weather station protocol used by the WMR-100, WMR-200, RMS-300 and others. Oregon Scientific does not share the information and is has been reverse engineered by a couple of people. Here are the definitions in German. Much easier to follow in English is the work of this guy. He also describes the WMR100N and WMRS200 driver for Mac OS X he is working on. The USB interface is a HID (device).

Prior to finding these links, the only option available was to run Windows XP software in a VMware instance and move the data into Mac OS X. Now there is hope for a native application to capture the data from the Oregon Scientific RMS-300.

November 23, 2009

Clothes Dryer Status Indicator via INSTEON

Remote clothes dryer status was implemented by interfacing the clothes dryer to an INSTEON SwitchLinc Relay with sense. Perceptive Automation's Indigo home control software is used to control a lamp indicating the dryer status and is used to send an email to the family when the dryer stops. Additional indication is a voice statement from an iMac computer near the home theater system.

Several methods were considered and then it was realized no relays or other interface components would be required if the new V5 INSTEON SwitchLinc Relay with sense was used. This method requires modification to the 110VAC circuits in the 240VAC dryer and should not be attempted by unqualified people. The dryer is a new model with full 5-wire power source. The complete dryer schematic was stored inside the control housing so it was easy to understand the circuit. Hot, neutral and ground were connected to the SwitchLinc. The sense wire was connected to the drum motor supply. An INSTEON "on" is sent when the drum motor starts and an "off" is sent when the drum motor stops.

Click the picture for more photos.