示例#1
0
	function get_CirclyNameByID($CircleId) {
	   $CircleItem       = IPS_GetName($CircleId);
		$WaterConfig      = get_WateringConfiguration();
		return $WaterConfig[$CircleItem][c_Property_Name];
	}
	 * Version 2.50.1, 11.03.2012<br/>
	 *
	 * Starten der Bewässerungs Kreise zu den vorgegebenen Zeiten
	 *
	 */

	 /** @}*/

	include_once "IPSWatering.inc.php";

   $CircleName         = IPS_GetName($_IPS['EVENT']);
   $categoryId_Circles = IPSUtil_ObjectIDByPath('Program.IPSLibrary.data.modules.IPSWatering.WaterCircles');
   $CircleId           = IPS_GetCategoryIDByName($CircleName, $categoryId_Circles);
   $ControlId          = get_ControlId(c_Control_Active, $CircleId);

	$WaterConfig = get_WateringConfiguration();

	// Wert von Bewässerungs Sensor ermitteln
	$SensorLimit = GetValue(get_ControlId(c_Control_Sensor, $CircleId));
	$SensorValue = false;
	if (array_key_exists(c_Property_Sensor, $WaterConfig[$CircleName])) {
		$SensorPath  = $WaterConfig[$CircleName][c_Property_Sensor];
		if ($SensorPath <> '') {
			$SensorId    = IPSUtil_ObjectIDByPath($SensorPath);
			if ($SensorId===false) {
			   IPSLogger_Wrn(__file__, "Specified Sensor '$SensorPath' could NOT be found");
			} else {
				$SensorValue = GetValue($SensorId);
			}
		}
	}