In energy harvesting communications, the transmit- ters have to adapt transmission to availability of energy harvested during the course of communication. The performance of the transmission depends on the channel conditions which vary randomly due to mobility and environmental changes. In this paper, we consider the problem of power allocation taking into account the energy arrivals over time and the degree of channel state information (CSI) available at the transmitter, in order to maximize the throughput. Differently from previous work, the CSI at the transmitter is not perfect and may include estimation errors. We solve this problem with respect to the causality and energy storage constraints. We determine the optimal offline policy in the case where the channel is assumed to be perfectly known at the receiver. Also, we obtain the power policy when the transmitter has no CSI. Furthermore, we analyze the asymptotic average throughput in a system where the average recharge rate goes asymptotically to zero and when it is very high.