Page 1 of 1

Laundry Dryer

PostPosted: Sun Jul 10, 2011 10:24 pm
by Brandt
I have found the SynchroLinc and Indigo to be the perfect Insteon device and Software combination to let me know when the dryer is done so that I can rotate the laundry loads.

One more feature that would be nice in Indigo would be to be able to program the SynchroLinc's sensitivity and delay since this can only be done in software. What happens is somebody pushes the button to start the dryer, but it does not make complete contact to start the cycle, it only rev's it up but when the person let's go it doesn't start because it wasn't pushed hard enough...unfortunately this is enough for the SynchroLinc to send an on/off


For now here is my trigger for when the dryer is done:

Trigger:
Type: Device State Changed
Device: Laundry Dryer
On/Off State
Becomes Off

Condition: Always

Actions:

1) Type: Execute Script Embedded AS:
Code: Select all
tell application "Airfoil"
    connect to every speaker
end tell


2) Type: Plugin
Plugin: iTunes Plugin
Action: Pause Playback and Speak Text
Device: iTunes Server
Action Setting: itunes: pause and say "excuse me, the dryer is done."

3) Type: Execute Script Embedded AS:

Code: Select all
property emailAddress : "1234567890@mms.att.net"

tell application "IndigoServer"
    set lastChanged to last changed of device "Laundry Dryer"
    set runTime to ((current date) - lastChanged) div minutes
    if runTime > 1 then
        set emailBody to "The dryer is done after drying since " & time string of lastChanged & " for " & runTime & " minutes!"
        send email to emailAddress with body emailBody
    end if
end tell


Re: Laundry Dryer

PostPosted: Sun Jul 10, 2011 10:55 pm
by jay (support)
Given that actions execute in parallel threads (except for embedded AppleScript actions), you may want to put a really small delay (like maybe .02) on the second action - that will help ensure that the script controlling Airfoil has a chance to finish executing before the itunes plugin pause and speak action executes. It may always work as you have it - but since AppleScripts must run on the main thread it's possible that another script could hold up the tell to Airfoil such that the iTunes plugin actually executes it's action before Airfoil sets the speakers.

Just a thought. We've got a task to look at all the existing INSTEON modules and see what (if any) extended command features we're going to add to them (extended INSTEON commands require one of the newer PowerLincs - specifically not the 2414) - adding those settings to the SynchroLinc falls into that category (I suspect).

Re: Laundry Dryer

PostPosted: Mon Jul 11, 2011 3:35 pm
by Brandt
Ah yes, I had seen somebody mention that 0.02 minute delay in another thread and I had already had that in place, just forgot to mention it. Will the upcoming Airfoil plugin be able to replace those two actions (Airfoil AS and iTunes Plugin)?

I would love to see full support for SynchroLincs, then I could monitor the Dryer, Clothes Washer, Dishwasher, and Refrigerator (maybe see how long it runs for). I don't really have much interest in the iMeter at this point (I was using a KillAWatt previously), but more for a whole house meter like the TED w/ Indigo Plugin.

Re: Laundry Dryer

PostPosted: Mon Jul 11, 2011 4:50 pm
by jay (support)
pomprocker wrote:
Will the upcoming Airfoil plugin be able to replace those two actions (Airfoil AS and iTunes Plugin)?


Well, not both of them - the Airfoil plugin will be able to replace the Airfoil script. Introducing a dependency between iTunes and Airfoil in either plugin isn't a good idea IMO and the Airfoil application itself doesn't know how to pause iTunes.

Re: Laundry Dryer

PostPosted: Mon Jul 11, 2011 7:05 pm
by ricks
jay wrote:
the Airfoil application itself doesn't know how to pause iTunes.


I thought Airfoil v4 could control audio sources, or is it just that they haven't updated the Airfoil Applescript library to add that functionality? Still on Airfoil v3, so I'm not sure what the "new" version can do.

Re: Laundry Dryer

PostPosted: Mon Jul 11, 2011 7:41 pm
by jay (support)
That's entirely possible - my server is PPC so I can't update to 4.0 either. I will be targeting 3.x, which I hope will continue to work in 4.0.

Re: Laundry Dryer

PostPosted: Thu Jul 21, 2011 9:52 pm
by Brandt
My laundry script has been acting up lately....the last changed it's picking up is that when it shut off, not when it turn on, so I am getting a run-time of 0 minutes:

Code: Select all
property emailAddress : "1234567890@mms.att.net"

tell application "IndigoServer"
   set lastChanged to last changed of device "Laundry Dryer"
   set runTime to ((current date) - lastChanged) div minutes
   -- if runTime > 1 then
   set emailBody to "The dryer is done after drying since " & time string of lastChanged & " for " & runTime & " minutes!"
   send email to emailAddress with body emailBody
   -- end if
end tell

Re: Laundry Dryer

PostPosted: Fri Jul 22, 2011 12:26 am
by Brandt
I modified it....

When the dryer starts, it uses the actions collection plugin to insert and AS style date/timestamp into a variable, it then removed any delayed action of the dryer done trigger.

The dryer done action AS looks like this now:

Code: Select all
property emailAddress : "1234567890@mms.att.net"

tell application "IndigoServer"
   set dryerStartTime to value of variable "Dryer_Start_Time"
   set startTime to string dryerStartTime as date
   set runTime to ((current date) - startTime) div minutes
   if runTime > 1 then
      set emailBody to "The dryer is done after drying since " & time string of startTime & " for " & runTime & " minutes!"
      send email to emailAddress with body emailBody
   end if
end tell