Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: [TEMPx] values Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
markr
Newbie
Newbie


Joined: December 29 2009
Location: United States
Online Status: Offline
Posts: 4
Posted: January 01 2010 at 11:05 | IP Logged Quote markr

Does anyone know what format the values for [TEMP1], [TEMP5], [TEMP7] and [TEMP10] are returned in. I'm trying to use these values in a case statement and keep getting a syntax error. I tried storing the values as global variables so I could check what was actually being returned, but I can't get this to work either.
I've tried using this statement - ph_setglobal_a('GTEMP7', [TEMP7]) and several variations embedding the "string" command with the TEMP variable but nothing seems to work.

THanks for any help.
Back to Top View markr's Profile Search for other posts by markr
 
grif091
Super User
Super User


Joined: March 26 2008
Location: United States
Online Status: Offline
Posts: 1357
Posted: January 01 2010 at 11:19 | IP Logged Quote grif091

This is a Macro User Message Formula that I use to retrieve all the tempx values. I think the values are stored as strings and you specify the format of the returned data with ph_getvar_x.


temp1= " + ph_getvar_s(2,1) + "temp2= " + ph_getvar_s(2,2) + "temp3= " + ph_getvar_s(2,3) + "temp4= " + ph_getvar_s(2,4) + "temp5= " + ph_getvar_s(2,5) + "temp6= " + ph_getvar_s(2,6) + "temp7= " + ph_getvar_s(2,7) + "temp8= " + ph_getvar_s(2,8) + "temp9= " + ph_getvar_s(2,9) + "temp10= " + ph_getvar_s(2,10)

EDIT: example of a Case statement

case (ph_getvar_n(1,1) when 8,9,10,11,12,13,14,15 then "Input 4 ON" ELSE "INPUT 4 OFF")

Edited by grif091 - January 01 2010 at 11:25


__________________
Lee G
Back to Top View grif091's Profile Search for other posts by grif091
 
markr
Newbie
Newbie


Joined: December 29 2009
Location: United States
Online Status: Offline
Posts: 4
Posted: January 01 2010 at 12:32 | IP Logged Quote markr

Lee, thanks for the response, I used the "ph_getvar_s" function and got the information I was looking for. Unfortunately, the responses I got raised some additional questions.
The list of definitions I found on this forum for the contents of the variables doesn't match what I'm getting returned.
TEMP2 gets a 0 when the plc issues a command but gets various numbers if a remote linc issues the command.
TEMP4 - The chart I saw says this is the "Type of trigger" , however it seems to contain the group id when the remote linc is used, when the PLC is used it returns a number that doesn't match anything I can figure out (e.g. a direct command to turn a device off results in a 15 being returned)
TEMP6 - The chart shows 20 for direct and 21 for broadcast. I get 16 or 19.
TEMP7 - The chart shows this is the receiving device but when the remote linc issues a command the remote linc's id is in this variable.

Sorry to have so many questions, but after 36 years of working with computers it bugs me that I can't write a program to tell if a light bulb is on.
Back to Top View markr's Profile Search for other posts by markr
 
grif091
Super User
Super User


Joined: March 26 2008
Location: United States
Online Status: Offline
Posts: 1357
Posted: January 01 2010 at 12:41 | IP Logged Quote grif091

I'm no expert on which tempx variables contain what data. I would expect it will depend on whether you are looking at the temps when in a trigger versus in a macro, etc.

There is a ph_insteonwithret that if used with a Query command will return the status of the device, no temp variables involved.

Perhaps if you detail what you are trying to accomplish someone will be able to offer a solution.


__________________
Lee G
Back to Top View grif091's Profile Search for other posts by grif091
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: January 01 2010 at 13:11 | IP Logged Quote BeachBum

Well darn, that makes 3 of us. Welcome to the “ole timers group”. The TEMPs depend what you are trapping at the time. Dave in the past has posted a lot of information addressing this but I find as more things are added the TEMPs sometimes change. What we use most of the time is to test all the variables when an event occurs and then refine what we want.

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
markr
Newbie
Newbie


Joined: December 29 2009
Location: United States
Online Status: Offline
Posts: 4
Posted: January 01 2010 at 15:38 | IP Logged Quote markr

I'm trying to create a Control Center that will display the status of every insteon device defined in Power Home. I want the status to update no matter what turns the device on or off. Some things work if the command is issued from the PLC, others work when the command comes from the remoteLinc. I can get it to work if I check every device every time anything changes, but my membership in the "ole timers group", as Pete put it, makes this look sloppy to me. I thought I could trigger off the commands and only deal with the device or group being changed.
Back to Top View markr's Profile Search for other posts by markr
 

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