Intelligent grid