This work deals with the luminescence properties of Al0.5Ga0.5N/GaN quantum dots grown by molecular beam epitaxy on c-plane sapphire. The low temperature PL bands are shifted below the GaN gap by the Stark effect. An approximate model, based on dot heights distributions estimated by transmission electron microscopy, allows to account for the luminescence lineshape and for the screening of the Stark effect by injected carriers. The effect of capping the dots with varying (Al,Ga)N thicknesses was also studied, showing that uncapped dots are sensitive to their atmospheres. The electroluminescence spectra of diodes having such dots as active region are discussed. Finally, ways of getting emission deeper in the UV are presented.