Author |
|
nadler Super User
Joined: February 25 2006 Location: United States
Online Status: Offline Posts: 354
|
Posted: May 07 2006 at 15:53 | IP Logged
|
|
|
Okay, all you macro/function buffs - I want to report the status of a number of insteon devices so that I can announce them. For example, at 11 pm I might want TTS to say "The Garage is Open" or "The living room light is still on" after first checking the status of the particular Insteon device.
I've tried:
Set System [LOCAL1] ph_insteon ("COMPUTER LIGHT1", istatus,0)
TTS [LOCAL1]
This reports "ZERO" which means that the function was executed correctly. How do I get the function to return the actual status of the device (i.e. - On or Off or even the number 17,18, 20 etc)?
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: May 07 2006 at 17:21 | IP Logged
|
|
|
Nick,
The correct command would be ph_getinsteonstat and ph_getinsteonlevel. I would just use a single TTS line with the TTS field being:
Code:
"The Garage Door status is " + case(ph_getinsteonstat("GARAGEDOOR") when 0 then "unknown" when 1 then "closed" when 2 then "open") |
|
|
After rereading your post though, it looks like you want to check for a particular status and then announce a certain condition. The code would then look something like:
Code:
10 Jump if(ph_getinsteonstat("GARAGEDOOR") = 2,1,999)
20 TTS "The garage door is still open"
|
|
|
Let me know if this answers your question or not.
Dave.
|
Back to Top |
|
|
nadler Super User
Joined: February 25 2006 Location: United States
Online Status: Offline Posts: 354
|
Posted: May 07 2006 at 18:43 | IP Logged
|
|
|
Perfect. That's exactly what I was looking for. I'll add it to my Power-Home Tips and Tricks.
Just curious. Under what circumstances would you use "istatus" in the ph_insteon(device,istatus,0) function?
Thanks.
Noel
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: May 08 2006 at 17:19 | IP Logged
|
|
|
Noel,
(Sorry about the Nick...hard to keep track sometimes ). Glad that helps. As far as "istatus" is concerned, it's just a way to force a check of the status. It's not instantaneous however. Youre basically telling the Insteon controller to send a status command to a device. The controller sends the command and when the device gets a chance, it will respond with it's current status. PowerHome will receive this incoming response to status and will update the Device Status screen accordingly. Usually it's pretty quick, but if a lot of traffic is currently taking place (such as a link retrieval or create) then there may be a several second second delay.
Dave.
|
Back to Top |
|
|
nadler Super User
Joined: February 25 2006 Location: United States
Online Status: Offline Posts: 354
|
Posted: May 09 2006 at 10:05 | IP Logged
|
|
|
Dave,
Don't worry about it. I've been called a lot of things. Nick isn't so bad.
Thanks for the info on istatus. Another entry for my Tips and Tricks.
I'm starting another thread with a couple of other macro questions.
|
Back to Top |
|
|