Compare commits

..

No commits in common. "52e456f13d5c117a9b98b90f81542e731c6daa8a" and "91cb6e7f7df3311482af03f209c708250599d815" have entirely different histories.

2 changed files with 12 additions and 14 deletions

View File

@ -1,13 +1,12 @@
# EPClock
ESP8226 Arduino based ePaper clock, using NTP and showing the weather.
Using a Waveshare 4.3" UART module and an ESP8226 R1 Mini from Jaycar Australia, which is a D1 R1 in the Arduino program.
Using a Waveshare 4.3" UART module and an ESP8226 R1 Mini from Jaycar Australia, which is a D1 Mini in the Arduino program.
The ESP8266 doesn't really have enough RAM to be able to parse the XML available from the Autralian Bureau of Meteorology, so the bom_xml.py script does that and spits out some simplified json I've put that json on my home web server, and set the script to run hourly.
The ESP8266 doesn't really have enough RAM to be able to parse the XML available from the Autralian Bureau of Meteorology, so the bom_xml.py script does that and spits out some simplified json I've put that json on my home web server, and set the script to run hourly.
I've also put in bom_rrd2.py which uses the 'weather-au' library from pip and also pulls some current temperatures from some MQTT sensors I have around the house.
## Required Arduino Libraries
## Required Libraries
Timezone: [https://github.com/JChristensen/Timezone]()
@ -30,4 +29,4 @@ Use Images/create_images.py edit for font choice! The current images are in Fre
## Weather Icons
I have derived some from the Australian Bureau of Meteorology, Feel free to use those, or make some better ones!
I have derived some from the Australian Bureau of Meteorology, Feel free to use those, or make some better ones!

View File

@ -28,11 +28,11 @@ bedroom_temp = 0
lounge = rrdtool.fetch("/media/media/mqtt/ESP_4c7682/temp.rrd", "AVERAGE")
rows = lounge[2][::-1]
try:
lounge_temp = int(rows[1][0])
except TypeError:
lounge_temp = int(rows[2][0])
for data in rows:
if data[0] is not None:
lounge_temp = int(data[0])
break
bom_icons = {
'sunny': 'SUNNY.JPG',
'clear': 'CLEAR.JPG',
@ -85,8 +85,8 @@ if night:
new[day]['icon'] = bom_icons[weather['today']['icon_descriptor']]
else:
new[day]['day'] = datetime.datetime.strptime(weather[day]['date'], "%Y-%m-%dT%H:%M:%S%z").strftime("%A")
new[day]['icon'] = bom_icons[weather[day]['icon_descriptor']]
new[day]['max'] = weather[day]['temp_max']
new[day]['icon'] = bom_icons[weather['today']['icon_descriptor']]
new[day]['max'] = weather['today']['temp_max']
else:
@ -103,7 +103,6 @@ new['current']['outside'] = outside_temp
new['current']['bedroom'] = bedroom_temp
new['current']['lounge'] = lounge_temp
with open('/var/www/darksky/bom.json', 'w') as output:
with open('bom.json', 'w') as output:
output.write(json.dumps(new))
output.close()