Amira l’goy we are sometimes matir l’tzrachei rabbim, for example turning on the lights in a shul. If davening in the shul starts at 8 am and someone got there much earlier and wants to learn before the people start to arrive, can he get the goy then to come turn on the lights or does he have to wait until it gets closer to the time that people will be coming to tell the goy to turn on the lights?
It is not by any means simple that one can ask a non-Jew to switch on the lights in a shul.
Based on a number of authorities, who discuss the question of amira le-akum for a mitzvah of the rabbim (the congregation); there are those who permit this by means of a remez (a hint). This is based on the Ittur, the Rashbash, and others (see Tosafos, Rosh Hashanah 24b, s.v. Shaani), and this is ruled by Zichron Yosef (no. 79) and by Rabbi Moshe Aryeh Freind (cited in Alei Temarim, Vol. 6, p. 243).
However, there are sources that indicate the contrary, such as with regard to the mitzvah of Shofar, for which the Shulchan Aruch Harav does not permit amira le-akum (see 586:24). Mateh Efraim (584:1) writes explicitly that one should not daven early on Rosh Hashanah that falls on Shabbos, for fear that a non-Jew will be used for lighting the candles.
Even according to those who permit amira le-akum for the purpose of the congregation, some say that this applies specifically at night, when the congregation can’t manage without the lights, but not in the day for extra comfort (this ruling is given by Rav Ovadyah Yosef, and others).
Yet, even assuming that it is permitted to ask a non-Jew to switch the lights on for the congregation, it would apparently not be permitted to do so at four in the morning, for one’s personal convenience. Turning on the lights at this time is only for the yachid, and not for the rabbim, and the rabbinic prohibition concerning asking a non-Jew will apply.
A possible consideration is if the lights are fluorescent, and possibly no de’oraisah is involved, in which case it can be considered a shvus de-shvus for a mitzvah.