We study the optimal transmission policy of a sensor node in an energy-harvesting wireless sensor network. We consider a hybrid wireless sensor network in which a mobile sink is used to collect data. Taking cues from recent works on the value of information (VoI), we posit that the optimal policy maximises the VoI that can be sent for the node to the sink. We model this system as a discrete-time queueing model with two coupled queues. In particular, the sensor node under study operates energy neutral and harvests energy according to a Bernoulli process. Discretising energy into “energy chunks”, the battery is modelled as a first queue, whereas a second queue is introduced to hold the VoI at the sensor node. From the vantage point of the sensor node, this means that the sensor can only send when the sink is sufficiently close. When this is the case, the sensor decides whether to transmit its data or not depending on the amount of available energy and the value of the information. Focusing on the optimal transmission policy, we formulate the optimal control problem as a Markov Decision Process with a level-dependent block-triangular transition probability matrix. We find the optimal policy which maximises the mean VoI transmitted from the node in the long run and numerically show that it is of threshold type. Further, we assess the value function at optimal policy analytically and provide some properties. Finally, we investigate the structure of the optimal policy and the mean VoI collected from the node for different system parameters by means of some numerical experiments.