Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Reporting Status of Insteon Device Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
nadler
Super User
Super User


Joined: February 25 2006
Location: United States
Online Status: Offline
Posts: 354
Posted: May 07 2006 at 15:53 | IP Logged Quote nadler

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 View nadler's Profile Search for other posts by nadler
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: May 07 2006 at 17:21 | IP Logged Quote dhoward

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 View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
nadler
Super User
Super User


Joined: February 25 2006
Location: United States
Online Status: Offline
Posts: 354
Posted: May 07 2006 at 18:43 | IP Logged Quote nadler

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 View nadler's Profile Search for other posts by nadler
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: May 08 2006 at 17:19 | IP Logged Quote dhoward

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 View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
nadler
Super User
Super User


Joined: February 25 2006
Location: United States
Online Status: Offline
Posts: 354
Posted: May 09 2006 at 10:05 | IP Logged Quote nadler

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 View nadler's Profile Search for other posts by nadler
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum