Lately, data-driven algorithms have been proposed to design local controls for Distributed Generators (DGs) that can emulate the optimal behaviour without any need for communication or centralised control. The design is based on historical data, advanced off-line optimization techniques and machine learning methods, and has shown great potential when the operating conditions are similar to the training data. However, safety issues arise when the real-time conditions start to drift away from the training set, leading to the need for online self-adapting algorithms and experimental verification of data-driven controllers. In this paper, we propose an online self-adapting algorithm that adjusts the DG controls to tackle local power quality issues. Furthermore, we provide experimental verification of the data-driven controllers through power Hardware-in-the-Loop experiments using an industrial inverter. The results presented for a low-voltage distribution network show that data-driven schemes can emulate the optimal behaviour and the online modification scheme can mitigate local power quality issues.