23rd August 2008 - There was an issue with our name caching server at around 08:00AM GMT. It has been fixed.

Kitchen Timer Alarm -Run HA Macro :idea:

HA... VIA Powerhome

Kitchen Timer Alarm -Run HA Macro :idea:

Postby Mannyman on Sat Jan 05, 2008 5:14 am

:idea:
I used the Kitchen Timer and liked the little beep beep it made, but it would be kewl if the alarm flashed all the lights in the house on and off so that I can really notice it. This of course could be be whatever Macro you have set up in PowerHome like sending me a txt message to my cell phone telling me not to burn the kitchen down. :!:
User avatar
Mannyman
 
Posts: 118
Joined: Fri Aug 18, 2006 5:46 am

Postby deckhardt on Wed Jan 09, 2008 2:51 pm

I like it 8)
deckhardt
 
Posts: 96
Joined: Mon Jun 18, 2007 2:06 pm
Location: Wisconsin, USA

Postby jbbtex on Wed Jan 09, 2008 3:32 pm

It's already in there.

Towards the end of the ehomeclient.vbs file there is a function called KITCHEN_TIMER_SHOW_ALARM.

I cut and pasted this
Code: Select all
Dim sRet
sRet = g_oGbl.EH_PH_MACRO("ph_macro(" & Chr(34) & "TEST" & Chr(34) & ")")
'if sRet = "" then msgbox "Fail"

into the function from the beginning of the same .vbs file. Changed macro name and voila... TTS on the WHA when the timer hit zero.
jbbtex
 
Posts: 67
Joined: Fri Nov 16, 2007 6:22 am
Location: Texas

Postby Mannyman on Wed Jan 09, 2008 4:20 pm

Thanks.8)
Maybe this can be done via GUI kinda like the HA screen designer?
Grandma (nor I) have no idea what "Dim sRet" is.:oops:
But I'll do as you suggest in the meantime. Thanks again.

signed,
Manny
Non-code-jockey
User avatar
Mannyman
 
Posts: 118
Joined: Fri Aug 18, 2006 5:46 am

Postby jbbtex on Wed Jan 09, 2008 4:36 pm

Manny,

I don't know VBS code at all. But I figured what the heck, I'll try it.

BTW, I commented out the IF ... THEN msgbox "Fail" statement because mine ran the macro correctly but still displayed the msgbox "Fail."

Here is how the function looks in my ehomeclient.vbs file

Code: Select all
Function KITCHEN_TIMER_SHOW_ALARM(TimerNumber)
  '--- called when kitchen timer fires
  'msgbox "KITCHEN_TIMER_SHOW_ALARM " & TimerNumber

  if TimerNumber = 1 then
     '--- 1st timer fires
    Dim sRet
    sRet = g_oGbl.EH_PH_MACRO("ph_macro(" & Chr(34) & "TEST" & Chr(34) & ")")
    'if sRet = "" then msgbox "Fail"
  Else
     '--- 2st timer fires
                 Dim sRet
    sRet = g_oGbl.EH_PH_MACRO("ph_macro(" & Chr(34) & "TEST" & Chr(34) & ")")
    'if sRet = "" then msgbox "Fail"
  End If

  '--- if False is returned then eHome will NOT
  '--- beep or show anything on the screen
  KITCHEN_TIMER_SHOW_ALARM = True


End Function


The ehomeclient.vbs resides on my client machine in the kitchen.
jbbtex
 
Posts: 67
Joined: Fri Nov 16, 2007 6:22 am
Location: Texas

Postby jbbtex on Wed Jan 09, 2008 4:56 pm

After playing around with this function a little, this works if you just want notification that a time has alarmed, but don't need to know which one.

Code: Select all
Function KITCHEN_TIMER_SHOW_ALARM(TimerNumber)
  '--- called when kitchen timer fires
  'msgbox "KITCHEN_TIMER_SHOW_ALARM " & TimerNumber

    Dim sRet
    sRet = g_oGbl.EH_PH_MACRO("ph_macro(" & Chr(34) & "TEST" & Chr(34) & ")")
    'if sRet = "" then msgbox "Fail"

  '--- if False is returned then eHome will NOT
  '--- beep or show anything on the screen
  KITCHEN_TIMER_SHOW_ALARM = True


End Function
jbbtex
 
Posts: 67
Joined: Fri Nov 16, 2007 6:22 am
Location: Texas

Postby JakeBullet on Thu Jan 10, 2008 7:32 am

Pretty good jbbtex.

For the function EH_PH_MACRO - sRet always is nothing.

There is another function EH_PH_MACRO_RETVAR
This waits for PH to send back anything.
JakeBullet
Site Admin
 
Posts: 1102
Joined: Thu Mar 23, 2006 8:13 am


Return to HA Stuff - Powerhome

Who is online

Users browsing this forum: No registered users and 1 guest



FREE FORUM Hosting by AtFreeForum. Create your Free WEB FORUM Hosting now!
GROUP DISCUSSION Features - Free FORUM HOSTING Directory Listing - DISCUSSION FORUM Terms of Service - FREE PHPBB Hosting Privacy
- FASHION ACCESSORIES
cron