smarty Super User 
          
  
  Joined: May 21 2006 Location: United States
 Online Status: Offline Posts: 729
          | 
        
         
          
           | Posted: November 24 2013 at 09:34 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
I was doing some macro clean-up/optimization when I stumbled across this...
 
 The PH command "ph_getinsteonstat()" should return a "0", "1", or "2" per the help documentation. 
 
 It appears to me that in cases were the status is unknown, the "0" is NEVER RETURNED.  In the formula below, I check for all possible states, but I can't make an "Unknown" result - even when I scramble the {Room Device ID} to gibberish. 
 
 .............................
 
 if(ph_getinsteonstat("{ROOM DEVICE ID}")=1,"Off",if(ph_getinsteonstat("{ROOM DEVICE ID}")=2,"On","Unknown"))
  __________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
         |