autoState — time of current automation deactivation.
 

Description:

u8 autoState(SUBID);

Returns information about current time of SUBID unit automation deactivation.

List of parameters:
SUBID
Device address located on device where the script is.

Return values:

· Returns value 0 if the device automation is activated.
· Returns value more than 0 – time before automation activating.
· Returns value -1 if the device automation is disactivated.

Example:

<!-- Example 1 -->
<item id="512" LAMP="512:8" name="Test for delayedCallR function" type="script">
V-ID/V-ADDR{
 
        	if(opt0()){      	
        	
                    	// Activate automation
                    	setAutoState(8, 0);
                    	u8 strForMess[150];        	
                    	// Automation status check
                    	i8 sttOfAuto = autoState(8);	
                    	// Message output to the interface
                    	if(sttOfAuto == 0) {
                               	sprintf(strForMess, "%cAutomation is activated!", 1);
                               	setStatus(@exciterId():32, &strForMess);
                    	} else if(sttOfAuto > 0){
                                sprintf(strForMess, "%cTill activating the automation is %d seconds", 4, sttOfAuto);
                               	setStatus(@exciterId():32, &strForMess);
                    	} else {
                               	setStatus(@exciterId():32, {8, "Automation is disactivated"});
                    	}       	
        	}
}
</item>
 
<!-- Example 2 -->
<item id="512" LAMP="512:8" name="Test for delayedCallR function" type="script">
V-ID/V-ADDR{
 
        	if(opt0()){      		
                    	// Disactivate automation
                    	setAutoState(8, -1);
                    	u8 strForMess[150];        	
                    	// Automation status check
                    	i8 sttOfAuto = autoState(8);
                    	// Message output to the interface
                    	if(sttOfAuto == 0) {
                               	sprintf(strForMess, "%cAutomation is activated!", 1);
                               	setStatus(@exciterId():32, &strForMess);
                    	} else if(sttOfAuto > 0){
                                sprintf(strForMess, "%cTill activating the automation is %d seconds", 4, sttOfAuto);
                                setStatus(@exciterId():32, &strForMess);
                    	} else {
                               	setStatus(@exciterId():32, {8, "Automation is disactivated"});
                    	}       	
        	}
}
</item>
 
<!-- Example 3 -->
<item id="512" LAMP="512:8" name="Test for delayedCallR function" type="script">
V-ID/V-ADDR{
 
        	if(opt0())      	      
                    	// Disactivate automation for 10 seconds
                    	setAutoState(8, 10);
                    	u8 strForMess[150];        	
                    	// Automation status check
                    	i8 sttOfAuto = autoState(8);
                    	// Message output to the interface
                    	if(sttOfAuto == 0) {
                               	sprintf(strForMess, "%cAutomation is activated!", 1);
                               	setStatus(@exciterId():32, &strForMess);
                    	} else if(sttOfAuto > 0){
                                sprintf(strForMess, "%cTill activating the automation is %d seconds", 4, sttOfAuto);
                                setStatus(@exciterId():32, &strForMess);
                    	} else {
                               	setStatus(@exciterId():32, {8, "Automation is disactivated"});
                    	}       	
        	}
}
</item>

The result of performing this example:

The result of example 1:
“Automation is activated!”

The result of example 2:
” Automation is disactivated!”

The result of example 3:
“10 seconds till automation activation!”

Note:

The function maps only the devices automation status which are located at the same unit as script.