Is there a way to check if sensors and actors are still alive in the installation, in this case for Eaton Xcomfort? I’m looking for a script that checks if a sensor is still alive by checking the update time of the signal quality. That one is send every hour, so ideal to see if there is still communication.
Last week I noticed that some sensors are not working anymore because of a low battery. I have a script for that one, but that is not checking if the sensor is working normally. It’s only checking the last value.
I hope someone can help me, I searched on “alive” but could not find a solution.
You have to do this yourself in a own script, which need to be defined in each check of the module. The module gives you „$_IPS[‚VALUE‘]“ in your target script. Where a value of TRUE is ALARM and FALSE is NO ALARM.
So you can easily do something like this:
if ($_IPS['VALUE'] == true)
{
echo "ALARM"
SMTP_SendMail(12345, "Alarm!", "Alarm description!");
} else {
echo "NO ALARM"
SMTP_SendMail(12345, "No Alarm!", "Alarm is gone description!");
}
For this example you need a SMTP-Instanz in your IPS. Or you can send a push message oder prowl or what ever you want
Here is another example. No module is needed! Only this small script.
<?
$CheckVar_ID = 12345; // ID of variable you want to monitor
$CheckVar = IPS_GetVariable($CheckVar_ID);
$CheckVar_LastUpdatedTime = $CheckVar['VariableUpdated']; // Options >> 'VariableChanged' OR 'VariableUpdated'
$TimeNow = time();
$TimeDiff = $TimeNow - $CheckVar_LastUpdatedTime;
//echo $TimeDiff;
if ($TimeDiff > 10) { // if differenz between actual time and last update of variable is higher then 10 seconds > ALARM
echo "ALARM - LAST UPDATE IS $TimeDiff SECONDS AGO"
SMTP_SendMail(12345, "Alarm!", "Alarm description!");
}
else {
echo "ALL IS OK - LAST UPDATE IS $TimeDiff SECONDS AGO"
SMTP_SendMail(12345, "ALL IS OK!", "All is OK description!");
}
?>