|Fat man in the greenhouse.|
In the end, I got fed up with the temperate readings being messed up by the Sense HAT being inside the case, and no cooling fan being able to keep its sensors cool enough. I dispensed with the Sense HAT, which I will find some other use for, and put a cheap temperature and humidity sensor on wires lead out of the case.
Having arranged a shade to keep direct sunlight off the sensor, I now get sensible readings. I missed being able to look at the greenhouse and see the temperature scroll past, so I had the computer report temperature and humidity to another Pi indoors.
textA = ["<!doctype html>\n","<html lang=\"en\">\n","<head>\n","<meta charset=\"utf-8\">\n",
"<title>Greenhouse</title>","<link rel=\"stylesheet\" href=\"mystyle.css\">",
"<meta http-equiv=\"refresh\" content=\"150\" >",
textZ = ["</body>\n","</html>\n"]
global previous_time, greenhouse_temp_file_modified
greenhouse_temp_file_modified = os.stat('/home/pi/ftp/files/gth.txt').st_mtime
if greenhouse_temp_file_modified == previous_time:
textM = "No greenhouse data received.\nCheck greenhouse computer!"
fp = open('/home/pi/ftp/files/gth.txt', 'r')
textM = fp.read()
fp = open('/var/www/html/greenhouse.html', 'w')
for line in textA:
for line in textZ:
previous_time = greenhouse_temp_file_modified