chrisu/seepark.git
4 years agohtml template: refresh page every 5 minutes; and don't cache
gregor herrmann [Sat, 23 Jun 2018 11:59:29 +0000 (13:59 +0200)]
html template: refresh page every 5 minutes; and don't cache

4 years agoshow current/most recent air/water temperature on top of page
gregor herrmann [Sat, 16 Jun 2018 17:56:35 +0000 (19:56 +0200)]
show current/most recent air/water temperature on top of page

4 years agoremove debug rest
gregor herrmann [Sat, 16 Jun 2018 17:17:03 +0000 (19:17 +0200)]
remove debug rest

4 years agowe can have wind without degrees (only speed)
gregor herrmann [Fri, 15 Jun 2018 17:17:12 +0000 (19:17 +0200)]
we can have wind without degrees (only speed)

4 years agoformat x tick values (datetime) differently according to interval
gregor herrmann [Thu, 14 Jun 2018 22:12:41 +0000 (00:12 +0200)]
format x tick values (datetime) differently according to interval

format strings picked a bit randomly for now, following the temperature
charts at https://info.comodo.priv.at/webcam/

might make more sense and fun with real values …

4 years agoaesthetic sugar: set width of charts to 80% of parent
gregor herrmann [Thu, 14 Jun 2018 21:24:58 +0000 (23:24 +0200)]
aesthetic sugar: set width of charts to 80% of parent

4 years agoreplace 1 chart+buttons with 4 charts
gregor herrmann [Thu, 14 Jun 2018 21:03:41 +0000 (23:03 +0200)]
replace 1 chart+buttons with 4 charts

4 years agoowm.py: import sys
gregor herrmann [Wed, 13 Jun 2018 17:34:02 +0000 (19:34 +0200)]
owm.py: import sys

used in sys.exit() in an error case

4 years agoseepark_web.js: print temperature in y axis with 1 decimal place
gregor herrmann [Wed, 13 Jun 2018 17:14:06 +0000 (19:14 +0200)]
seepark_web.js: print temperature in y axis with 1 decimal place

otherwise we hav 21, 21.5, 22, 22.5 ...

4 years agoseepark_web.js: use our new sensors API instead of the random data
gregor herrmann [Wed, 13 Jun 2018 17:09:30 +0000 (19:09 +0200)]
seepark_web.js: use our new sensors API instead of the random data

4 years agoadd format argument to sensors API
gregor herrmann [Wed, 13 Jun 2018 16:30:56 +0000 (18:30 +0200)]
add format argument to sensors API

with "c3" option for delivering data in the format c3.js expects

4 years agofix indentation. or actually logic: mode handling after the sql query
gregor herrmann [Wed, 13 Jun 2018 15:58:56 +0000 (17:58 +0200)]
fix indentation. or actually logic: mode handling after the sql query

4 years agowrap csv filenames in os.path.expanduser()
gregor herrmann [Wed, 13 Jun 2018 14:40:20 +0000 (16:40 +0200)]
wrap csv filenames in os.path.expanduser()

to allow ~ in filenames in ini file

4 years agosensor API: rename '/api/<version>/sensor/<sensor_id>'
gregor herrmann [Tue, 12 Jun 2018 19:39:39 +0000 (21:39 +0200)]
sensor API: rename '/api/<version>/sensor/<sensor_id>'

into '/api/<version>/sensor/id/<sensor_id>' and add
'/api/<version>/sensor/type/<sensor_type>'.

factor out the actual query for both into a function.

4 years agoadd mode=<full|consolidated> request argument to sensor endpoint
gregor herrmann [Tue, 12 Jun 2018 17:44:58 +0000 (19:44 +0200)]
add mode=<full|consolidated> request argument to sensor endpoint

the idea is to calculate the resolution of the returned data, i.e. increase
the interval between measurements for creating charts for larger timespans

TODO: the actual filtering

4 years agoadd more needed python3 modules to README
gregor herrmann [Tue, 12 Jun 2018 17:43:54 +0000 (19:43 +0200)]
add more needed python3 modules to README

4 years agoUpdate .gitignore.
Philipp Spitzer [Mon, 11 Jun 2018 21:59:25 +0000 (23:59 +0200)]
Update .gitignore.

4 years agoAdd begin and end parameters to sensor endpoint.
Philipp Spitzer [Mon, 11 Jun 2018 21:57:16 +0000 (23:57 +0200)]
Add begin and end parameters to sensor endpoint.

4 years agoAdd /api/<version>/sensor/<sensor_id>.
Philipp Spitzer [Mon, 11 Jun 2018 21:12:08 +0000 (23:12 +0200)]
Add /api/<version>/sensor/<sensor_id>.

4 years agoAdd API to view sensors.
Philipp Spitzer [Mon, 11 Jun 2018 20:55:23 +0000 (22:55 +0200)]
Add API to view sensors.

4 years agoImplement writing CSV.
Philipp Spitzer [Mon, 11 Jun 2018 19:01:41 +0000 (21:01 +0200)]
Implement writing CSV.

4 years agoScript takes config file from command line now.
Philipp Spitzer [Mon, 11 Jun 2018 18:19:49 +0000 (20:19 +0200)]
Script takes config file from command line now.

4 years agoMake use of dict consistent.
Philipp Spitzer [Mon, 11 Jun 2018 18:10:57 +0000 (20:10 +0200)]
Make use of dict consistent.

4 years agoMerge branch 'web' into owm
gregor herrmann [Sun, 10 Jun 2018 00:10:23 +0000 (02:10 +0200)]
Merge branch 'web' into owm

4 years agomaybe we want different shades of blue for the water termperatures
gregor herrmann [Sun, 10 Jun 2018 00:09:52 +0000 (02:09 +0200)]
maybe we want different shades of blue for the water termperatures

4 years agoowm.py: add rain/precipitation data
gregor herrmann [Sat, 9 Jun 2018 13:06:44 +0000 (15:06 +0200)]
owm.py: add rain/precipitation data

they are only in the api response when OWM has rain data

good test station: 3688451
https://openweathermap.org/city/3688451
Buenaventura, CO

4 years agoowm.py: handle missing wind degrees/direction
gregor herrmann [Fri, 8 Jun 2018 21:58:28 +0000 (23:58 +0200)]
owm.py: handle missing wind degrees/direction

4 years agoadd an openweathermap widget to the webpage
gregor herrmann [Fri, 8 Jun 2018 21:51:18 +0000 (23:51 +0200)]
add an openweathermap widget to the webpage

more of a gimmick ...

the api key is read from the ini file passed via SEEPARKINI
(and not via flask's config mechanism as this expects a python file)

fun fact: the api key will appear in the javaescript in the page anyway

4 years agoadd owm.py: get weather data from openweathermap
gregor herrmann [Fri, 8 Jun 2018 19:04:56 +0000 (21:04 +0200)]
add owm.py: get weather data from openweathermap

this script can replace wetter.at.pl:

perl:   2018-06-08;19:00;   05:21   ;21:09   ;21   ;0 mm/h;7km/h O     ;stark bewölkt      ;93
python: 2018-06-08;20:20:00;05:20:24;21:10:53;17.13;      ;2.6km/h O   ;Überwiegend bewölkt;75

and can be extended to write to the mysql database and a csv file like
seewasser.py

(and probably parts of seewasser.py could be extracted as common functions)

owm.py needs an api key from openweathermap and some config; cf. the
comments ath the top

questions:
- is precipitation really missing from json and available in xml?
- the str() casting at the end looks ugly

4 years agotooltip: 2 decimal places are enough
gregor herrmann [Mon, 4 Jun 2018 20:20:13 +0000 (22:20 +0200)]
tooltip: 2 decimal places are enough

4 years agonext attempt with the reload-on-zoom function. not yet working, esp. one doesn't...
gregor herrmann [Mon, 4 Jun 2018 19:46:56 +0000 (21:46 +0200)]
next attempt with the reload-on-zoom function. not yet working, esp. one doesn't get "out"

4 years agoadd buttons for day/week/month/year, + css and a js function
gregor herrmann [Mon, 4 Jun 2018 19:46:16 +0000 (21:46 +0200)]
add buttons for day/week/month/year, + css and a js function

4 years agoadd prototype for data loading function in zoom change
gregor herrmann [Mon, 4 Jun 2018 17:45:15 +0000 (19:45 +0200)]
add prototype for data loading function in zoom change

4 years agotemplate: add mobile friendly meta directive
gregor herrmann [Mon, 4 Jun 2018 17:44:43 +0000 (19:44 +0200)]
template: add mobile friendly meta directive

4 years agopass timespan (in days) to our /data route via GET
gregor herrmann [Mon, 4 Jun 2018 16:43:27 +0000 (18:43 +0200)]
pass timespan (in days) to our /data route via GET

4 years agofinally use random data but change granularity in dependenc of timespan
gregor herrmann [Mon, 4 Jun 2018 16:28:02 +0000 (18:28 +0200)]
finally use random data but change granularity in dependenc of timespan

timespan should come from GET later

4 years agorename hello() to index()
gregor herrmann [Mon, 4 Jun 2018 16:13:32 +0000 (18:13 +0200)]
rename hello() to index()

4 years agogenerate random data. commented out as it kills every browser.
gregor herrmann [Sun, 3 Jun 2018 15:35:09 +0000 (17:35 +0200)]
generate random data. commented out as it kills every browser.

4 years agoupdate regions
gregor herrmann [Sun, 3 Jun 2018 14:41:30 +0000 (16:41 +0200)]
update regions

boiling starts at 100°. and don't leave "empty" areas in between.

4 years agoadd temperature regions with colour coding
gregor herrmann [Sat, 2 Jun 2018 00:59:26 +0000 (02:59 +0200)]
add temperature regions with colour coding

4 years agoshow y grid
gregor herrmann [Sat, 2 Jun 2018 00:49:33 +0000 (02:49 +0200)]
show y grid

4 years agoturn off transitions
gregor herrmann [Sat, 2 Jun 2018 00:47:20 +0000 (02:47 +0200)]
turn off transitions

and change title

4 years agoshow more ° signs (in tooltip values and y axis)
gregor herrmann [Sat, 2 Jun 2018 00:40:36 +0000 (02:40 +0200)]
show more ° signs (in tooltip values and y axis)

4 years agox-ticks: don't show seconds, and rotate labels (multiline doesn't seem to work)
gregor herrmann [Sat, 2 Jun 2018 00:34:40 +0000 (02:34 +0200)]
x-ticks: don't show seconds, and rotate labels (multiline doesn't seem to work)

4 years agox-ticks: turn off magic optimization
gregor herrmann [Sat, 2 Jun 2018 00:28:50 +0000 (02:28 +0200)]
x-ticks: turn off magic optimization

4 years agoformat tooltip texts
gregor herrmann [Sat, 2 Jun 2018 00:22:25 +0000 (02:22 +0200)]
format tooltip texts

(pretty useless but hey)

4 years agouse realistic datetime values (i.e. '%Y-%m-%d %H:%M:%S')
gregor herrmann [Sat, 2 Jun 2018 00:04:04 +0000 (02:04 +0200)]
use realistic datetime values (i.e. '%Y-%m-%d %H:%M:%S')

4 years agouse sensor_id and sensor_name from database
gregor herrmann [Fri, 1 Jun 2018 23:50:51 +0000 (01:50 +0200)]
use sensor_id and sensor_name from database

4 years agovalid HTML5 and some text changes
gregor herrmann [Wed, 30 May 2018 23:55:33 +0000 (01:55 +0200)]
valid HTML5 and some text changes

4 years agoadd minimal README
gregor herrmann [Wed, 30 May 2018 23:48:02 +0000 (01:48 +0200)]
add minimal README

4 years agoadd title to chart
gregor herrmann [Wed, 30 May 2018 22:58:41 +0000 (00:58 +0200)]
add title to chart

4 years agoIgnore .pyc files.
Philipp Spitzer [Wed, 30 May 2018 22:05:54 +0000 (00:05 +0200)]
Ignore .pyc files.

4 years agoEnable zoom.
Philipp Spitzer [Wed, 30 May 2018 22:04:53 +0000 (00:04 +0200)]
Enable zoom.

4 years agoAdd more test data.
Philipp Spitzer [Wed, 30 May 2018 22:04:28 +0000 (00:04 +0200)]
Add more test data.

4 years agoAdd y label.
Philipp Spitzer [Wed, 30 May 2018 21:45:59 +0000 (23:45 +0200)]
Add y label.

4 years agoUse user-friendly names for labels.
Philipp Spitzer [Wed, 30 May 2018 21:42:53 +0000 (23:42 +0200)]
Use user-friendly names for labels.

4 years agoIgnore vim .swp files.
Philipp Spitzer [Wed, 30 May 2018 21:40:28 +0000 (23:40 +0200)]
Ignore vim .swp files.

4 years agoThe chart now shows the test data.
Philipp Spitzer [Wed, 30 May 2018 21:39:28 +0000 (23:39 +0200)]
The chart now shows the test data.

4 years agoThe flask app now provides test data.
Philipp Spitzer [Wed, 30 May 2018 21:39:13 +0000 (23:39 +0200)]
The flask app now provides test data.

4 years agoSwitch to D3 version 5.4.0.
Philipp Spitzer [Wed, 30 May 2018 21:38:40 +0000 (23:38 +0200)]
Switch to D3 version 5.4.0.

4 years agoUse example .js code from http://c3js.org.
Philipp Spitzer [Wed, 30 May 2018 19:26:33 +0000 (21:26 +0200)]
Use example .js code from http://c3js.org.

4 years agoHello world flask project.
Philipp Spitzer [Wed, 30 May 2018 19:10:43 +0000 (21:10 +0200)]
Hello world flask project.

Start development server with
FLASK_APP=seepark_web.py FLASK_DEBUG=1 flask run

4 years agoCopied .js und .css files from C3 project (https://github.com/c3js/c3) version 0...
Philipp Spitzer [Wed, 30 May 2018 19:08:45 +0000 (21:08 +0200)]
Copied .js und .css files from C3 project (https://github.com/c3js/c3) version 0.6.1.

4 years agoD3 library version 4.12.0 downloaded from github.com.
Philipp Spitzer [Wed, 30 May 2018 19:03:12 +0000 (21:03 +0200)]
D3 library version 4.12.0 downloaded from github.com.

4 years agoLeserlicher Name in die csv geschrieben
Chrisu Jähnl [Thu, 10 May 2018 21:25:31 +0000 (21:25 +0000)]
Leserlicher Name in die csv geschrieben

4 years agoAnpassungen für mysql Datenbankfelder
Chrisu Jähnl [Thu, 10 May 2018 21:12:56 +0000 (21:12 +0000)]
Anpassungen für mysql Datenbankfelder

4 years agoSchreiben in die Datenbank, Anpassung der Werte. Auf gut Deutsch ;-)
Chrisu Jähnl [Thu, 10 May 2018 20:46:26 +0000 (20:46 +0000)]
Schreiben in die Datenbank, Anpassung der Werte. Auf gut Deutsch ;-)

4 years agoguard (debug) output with if 0/1
gregor herrmann [Thu, 10 May 2018 19:10:31 +0000 (21:10 +0200)]
guard (debug) output with if 0/1

4 years agohandle encoding. maybe.
gregor herrmann [Thu, 10 May 2018 19:10:24 +0000 (21:10 +0200)]
handle encoding. maybe.

4 years agoadd wetter.at.pl
gregor herrmann [Thu, 10 May 2018 18:56:51 +0000 (20:56 +0200)]
add wetter.at.pl

perl script to scrape weather data for obsteig from wetter.at

4 years agoadd .gitignore
Chrisu Jähnl [Thu, 10 May 2018 17:18:39 +0000 (17:18 +0000)]
add .gitignore

5 years agoAlle 5 Sensoren
Chrisu Jähnl [Sat, 27 May 2017 22:01:15 +0000 (00:01 +0200)]
Alle 5 Sensoren

5 years agoFunktion geschaffen
Chrisu Jähnl [Sat, 27 May 2017 21:45:09 +0000 (23:45 +0200)]
Funktion geschaffen

5 years agoAusgabe in csv datei
Chrisu Jähnl [Sat, 27 May 2017 21:32:42 +0000 (23:32 +0200)]
Ausgabe in csv datei

5 years agoAbfrage yesno
Chrisu Jähnl [Sat, 27 May 2017 21:17:12 +0000 (23:17 +0200)]
Abfrage yesno

5 years agoParsen mit Regex: YES|NO und Temperatur
Chrisu Jähnl [Sat, 27 May 2017 21:13:25 +0000 (23:13 +0200)]
Parsen mit Regex: YES|NO und Temperatur

5 years ago1. Proof of concept
Chrisu Jähnl [Sat, 27 May 2017 20:50:22 +0000 (22:50 +0200)]
1. Proof of concept