chrisu/seepark.git
3 years agosimplify onzoomend function
gregor herrmann [Mon, 3 Sep 2018 16:37:36 +0000 (18:37 +0200)]
simplify onzoomend function

but leave it commented out because we never get fully back

3 years agouse strftime js library
gregor herrmann [Mon, 3 Sep 2018 16:02:08 +0000 (18:02 +0200)]
use strftime js library

that way we get german day/month names, and with a well-known formatting

3 years agoadd strftime library
gregor herrmann [Mon, 3 Sep 2018 15:53:02 +0000 (17:53 +0200)]
add strftime library

version v0.10.0
from https://github.com/samsonjs/strftime

3 years agohtml template: use minified js/css for c3 and d3
gregor herrmann [Mon, 3 Sep 2018 15:48:22 +0000 (17:48 +0200)]
html template: use minified js/css for c3 and d3

3 years agojs: factor out width calculation into a function
gregor herrmann [Mon, 3 Sep 2018 15:36:08 +0000 (17:36 +0200)]
js: factor out width calculation into a function

3 years agojs: resize charts on window resize
gregor herrmann [Mon, 3 Sep 2018 15:03:51 +0000 (17:03 +0200)]
js: resize charts on window resize

3 years agocss: add some margin to the body
gregor herrmann [Mon, 3 Sep 2018 14:30:33 +0000 (16:30 +0200)]
css: add some margin to the body

!important because otherwise the owm-css overrides it

3 years agoeditorial change: move a def() around
gregor herrmann [Thu, 30 Aug 2018 16:49:44 +0000 (18:49 +0200)]
editorial change: move a def() around

3 years agofor datetime intervals, don't return lowest value (min()) but avg()
gregor herrmann [Thu, 30 Aug 2018 16:45:39 +0000 (18:45 +0200)]
for datetime intervals, don't return lowest value (min()) but avg()

needs a conversion to/from unix timestamp

cf. https://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html
and https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html

3 years agoadd link to source code in html template
gregor herrmann [Thu, 30 Aug 2018 16:06:45 +0000 (18:06 +0200)]
add link to source code in html template

3 years agomerge master/owm.py into web
gregor herrmann [Wed, 29 Aug 2018 12:43:37 +0000 (14:43 +0200)]
merge master/owm.py into web

3 years agojs: comment out onzoomed
gregor herrmann [Sun, 26 Aug 2018 19:45:08 +0000 (21:45 +0200)]
js: comment out onzoomed

never really worked, and now is confusing with consolidated data

3 years agoREADME: remove obsolete waitress exploration results
gregor herrmann [Sun, 26 Aug 2018 18:06:01 +0000 (20:06 +0200)]
README: remove obsolete waitress exploration results

3 years agoAdd waitress configuration to README.
Philipp Spitzer [Sun, 26 Aug 2018 18:01:09 +0000 (20:01 +0200)]
Add waitress configuration to README.

3 years agochange x tick labels for month charts, as requested by chrisu
gregor herrmann [Fri, 24 Aug 2018 22:49:17 +0000 (00:49 +0200)]
change x tick labels for month charts, as requested by chrisu

3 years agoadd notes about waitress to README
gregor herrmann [Thu, 23 Aug 2018 14:32:41 +0000 (16:32 +0200)]
add notes about waitress to README

3 years agoFix begin and end in select_openweatherdata_grouped.
Philipp Spitzer [Wed, 22 Aug 2018 21:29:59 +0000 (23:29 +0200)]
Fix begin and end in select_openweatherdata_grouped.

3 years agoImplement grouping of openweathermapdata.
Philipp Spitzer [Wed, 22 Aug 2018 21:10:58 +0000 (23:10 +0200)]
Implement grouping of openweathermapdata.

3 years agoInclude timestamp and value label so that those columns appear in the output.
Philipp Spitzer [Wed, 22 Aug 2018 20:47:44 +0000 (22:47 +0200)]
Include timestamp and value label so that those columns appear in the output.

3 years agoConvert dict key to string to prevent an error (on rigel).
Philipp Spitzer [Wed, 22 Aug 2018 20:32:23 +0000 (22:32 +0200)]
Convert dict key to string to prevent an error (on rigel).

3 years agoSplit select_sensordata and implement grouping.
Philipp Spitzer [Wed, 22 Aug 2018 20:17:17 +0000 (22:17 +0200)]
Split select_sensordata and implement grouping.

3 years agoAdd a sqlalchemy group by/having example
Philipp Spitzer [Wed, 22 Aug 2018 19:33:41 +0000 (21:33 +0200)]
Add a sqlalchemy group by/having example

3 years agoupdate caption of new sensor
gregor herrmann [Tue, 21 Aug 2018 17:11:13 +0000 (19:11 +0200)]
update caption of new sensor

3 years agoadd comment with URL of web colors
gregor herrmann [Tue, 21 Aug 2018 14:36:33 +0000 (16:36 +0200)]
add comment with URL of web colors

3 years agojs: add new sensor
gregor herrmann [Tue, 21 Aug 2018 14:34:24 +0000 (16:34 +0200)]
js: add new sensor

3 years agohtml template: more anti-caching settings
gregor herrmann [Wed, 15 Aug 2018 22:57:17 +0000 (23:57 +0100)]
html template: more anti-caching settings

in the hopes that it helps against the refreshing problem.
spoiler: it doesn't.

3 years agoREADME: add ipv6 note
gregor herrmann [Fri, 10 Aug 2018 18:04:16 +0000 (20:04 +0200)]
README: add ipv6 note

3 years agoformat datetime in tooltip headers
gregor herrmann [Thu, 9 Aug 2018 13:53:42 +0000 (15:53 +0200)]
format datetime in tooltip headers

3 years agoupdate c3 and d3
gregor herrmann [Thu, 9 Aug 2018 13:22:35 +0000 (15:22 +0200)]
update c3 and d3

c3: 0.6.7
d3: 5.5.0

3 years agoremove import of our seeparklib
gregor herrmann [Thu, 9 Aug 2018 13:09:44 +0000 (15:09 +0200)]
remove import of our seeparklib

not used anymore since we get the openweathermap data from the database

3 years agoadjust sensor name (and tooltip regexp) again
gregor herrmann [Thu, 9 Aug 2018 12:56:54 +0000 (14:56 +0200)]
adjust sensor name (and tooltip regexp) again

3 years agoseepark_web.py: move 'mainsensor' in ini to section webapp
gregor herrmann [Thu, 9 Aug 2018 01:44:27 +0000 (03:44 +0200)]
seepark_web.py: move 'mainsensor' in ini to section webapp

from section temperature which is used by seewasser.py to check all sensors,
and "mainsensor" is no a sensor name/file

3 years agojs: play with ordering. this all doesn't seem to work with timeseries charts.
gregor herrmann [Wed, 8 Aug 2018 22:58:26 +0000 (00:58 +0200)]
js: play with ordering. this all doesn't seem to work with timeseries charts.

3 years agoupdate names of sensors
gregor herrmann [Wed, 8 Aug 2018 22:02:36 +0000 (00:02 +0200)]
update names of sensors

3 years agojs: "fix" zooming
gregor herrmann [Wed, 8 Aug 2018 15:42:58 +0000 (17:42 +0200)]
js: "fix" zooming

we have sensors vs. weather now, and need mor variables

3 years agotrailing whitespace
gregor herrmann [Sun, 5 Aug 2018 18:54:53 +0000 (20:54 +0200)]
trailing whitespace

3 years agoAdd config file command line argument.
Philipp Spitzer [Mon, 11 Jun 2018 18:23:32 +0000 (20:23 +0200)]
Add config file command line argument.

3 years agomake web/README a bit more verbose
gregor herrmann [Sun, 5 Aug 2018 17:27:49 +0000 (19:27 +0200)]
make web/README a bit more verbose

3 years agoresolution in consolidated mode: use <= for time intervals
gregor herrmann [Sun, 5 Aug 2018 17:10:50 +0000 (19:10 +0200)]
resolution in consolidated mode: use <= for time intervals

3 years agofinally drop old "API" with random data
gregor herrmann [Sun, 5 Aug 2018 17:08:30 +0000 (19:08 +0200)]
finally drop old "API" with random data

3 years agochange water (sensor) colours
gregor herrmann [Sun, 5 Aug 2018 16:54:23 +0000 (18:54 +0200)]
change water (sensor) colours

3 years agoupdate regexp for extrating label names
gregor herrmann [Sun, 5 Aug 2018 16:43:01 +0000 (18:43 +0200)]
update regexp for extrating label names

3 years agoupdate sensorids and names
gregor herrmann [Sun, 5 Aug 2018 16:41:26 +0000 (18:41 +0200)]
update sensorids and names

3 years agojs: make points on line chart smaller
gregor herrmann [Fri, 3 Aug 2018 23:09:08 +0000 (01:09 +0200)]
js: make points on line chart smaller

3 years agoxtick format: fix year labels (month year)
gregor herrmann [Thu, 2 Aug 2018 11:27:27 +0000 (13:27 +0200)]
xtick format: fix year labels (month year)

still doesn't make a lot of sense with not enough data

3 years agoformat tooltip names depending on water/air
gregor herrmann [Thu, 2 Aug 2018 11:23:40 +0000 (13:23 +0200)]
format tooltip names depending on water/air

3 years agodo some horribly wrong timezone magic
gregor herrmann [Thu, 2 Aug 2018 11:11:43 +0000 (13:11 +0200)]
do some horribly wrong timezone magic

3 years agowe have air temperature charts!
gregor herrmann [Thu, 2 Aug 2018 11:11:24 +0000 (13:11 +0200)]
we have air temperature charts!

3 years agogeneralize convert_to_c3: sensors and weather have different fields
gregor herrmann [Thu, 2 Aug 2018 10:10:28 +0000 (12:10 +0200)]
generalize convert_to_c3: sensors and weather have different fields

3 years agooops, looks like we made a logic error when refactoring
gregor herrmann [Thu, 2 Aug 2018 09:41:54 +0000 (11:41 +0200)]
oops, looks like we made a logic error when refactoring

3 years agohtml+js: rename stuff to prepare for weather
gregor herrmann [Thu, 2 Aug 2018 09:32:07 +0000 (11:32 +0200)]
html+js: rename stuff to prepare for weather

3 years agoThe air temperature is taken from the database now.
Philipp Spitzer [Wed, 1 Aug 2018 21:12:00 +0000 (23:12 +0200)]
The air temperature is taken from the database now.

3 years agoImplement handling of ill-formatted datetime values in URL.
Philipp Spitzer [Wed, 1 Aug 2018 21:07:03 +0000 (23:07 +0200)]
Implement handling of ill-formatted datetime values in URL.

3 years agoCreate API for openweathermap data.
Philipp Spitzer [Wed, 1 Aug 2018 19:54:39 +0000 (21:54 +0200)]
Create API for openweathermap data.

3 years agoAdd a working SQL example to group measurements into time slots.
Philipp Spitzer [Wed, 1 Aug 2018 19:30:34 +0000 (21:30 +0200)]
Add a working SQL example to group measurements into time slots.

3 years agoIgnore warning about duplicate key when inserting openweathermap data.
Philipp Spitzer [Wed, 1 Aug 2018 19:27:17 +0000 (21:27 +0200)]
Ignore warning about duplicate key when inserting openweathermap data.

3 years agoremove debug print
gregor herrmann [Fri, 27 Jul 2018 22:03:31 +0000 (00:03 +0200)]
remove debug print

3 years agoImplement writing openweathermap data to database.
Philipp Spitzer [Wed, 25 Jul 2018 21:09:52 +0000 (23:09 +0200)]
Implement writing openweathermap data to database.

3 years agoMake script ready for missing visibility information in JSON.
Philipp Spitzer [Wed, 25 Jul 2018 20:03:18 +0000 (22:03 +0200)]
Make script ready for missing visibility information in JSON.

3 years agoPrepare consolidation of data.
Philipp Spitzer [Wed, 18 Jul 2018 21:26:47 +0000 (23:26 +0200)]
Prepare consolidation of data.

3 years agoSplit function select_sensordata().
Philipp Spitzer [Wed, 18 Jul 2018 20:56:00 +0000 (22:56 +0200)]
Split function select_sensordata().

3 years agoMove to_dict to JSONEncoder.
Philipp Spitzer [Wed, 18 Jul 2018 20:24:06 +0000 (22:24 +0200)]
Move to_dict to JSONEncoder.

3 years agobrown paper bag commit: always test after changing variable names
gregor herrmann [Thu, 5 Jul 2018 18:38:02 +0000 (20:38 +0200)]
brown paper bag commit: always test after changing variable names

(and rebase/fixup commits)

3 years agofirst rather simple implementation of to_dict() for our Sensors object
gregor herrmann [Thu, 5 Jul 2018 18:19:20 +0000 (20:19 +0200)]
first rather simple implementation of to_dict() for our Sensors object

3 years agoread main(water)sensor from ini file
gregor herrmann [Thu, 5 Jul 2018 17:37:59 +0000 (19:37 +0200)]
read main(water)sensor from ini file

[temperature]
mainsensor=0316a21383ff

3 years agotry to be a bit more clever in finding our libraries
gregor herrmann [Thu, 5 Jul 2018 17:28:21 +0000 (19:28 +0200)]
try to be a bit more clever in finding our libraries

appending '..' to sys.path only works when seepark_web.py is started from
its directory, otherwise we get:

flask.cli.NoAppException: While importing "seepark_web", an ImportError was raised:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/flask/cli.py", line 235, in locate_app
    __import__(module_name)
  File "/home/gregoa/src/toastfreeware/seepark/web/seepark_web.py", line 14, in <module>
    from seeparklib.openweathermap import openweathermap_json, OpenWeatherMapError
ModuleNotFoundError: No module named 'seeparklib'

3 years agoREADME: add python3-flask-sqlalchemy
gregor herrmann [Thu, 5 Jul 2018 17:19:57 +0000 (19:19 +0200)]
README: add python3-flask-sqlalchemy

(which depends on python3-flask and python3-sqlalchemy)

3 years agoStart to use sqlalchemy (not all API calls work).
Philipp Spitzer [Wed, 4 Jul 2018 22:04:06 +0000 (00:04 +0200)]
Start to use sqlalchemy (not all API calls work).

3 years agoUse defaultdict to simplify code.
Philipp Spitzer [Wed, 4 Jul 2018 19:18:11 +0000 (21:18 +0200)]
Use defaultdict to simplify code.

3 years agoMove formatting water temperature/time to template.
Philipp Spitzer [Wed, 4 Jul 2018 19:09:13 +0000 (21:09 +0200)]
Move formatting water temperature/time to template.

3 years agoFormat air temperature and time values in template.
Philipp Spitzer [Wed, 4 Jul 2018 19:06:26 +0000 (21:06 +0200)]
Format air temperature and time values in template.

3 years agoAdd command lin eparameter --debug.
Philipp Spitzer [Wed, 4 Jul 2018 18:41:36 +0000 (20:41 +0200)]
Add command lin eparameter --debug.

3 years agoUse seeparklib.openweathermap.
Philipp Spitzer [Wed, 4 Jul 2018 18:38:09 +0000 (20:38 +0200)]
Use seeparklib.openweathermap.

3 years agoUse openweathermap module in web app.
Philipp Spitzer [Wed, 4 Jul 2018 18:33:27 +0000 (20:33 +0200)]
Use openweathermap module in web app.

3 years agoCreate dedicated package seeparklib and add openweathermap module.
Philipp Spitzer [Wed, 4 Jul 2018 18:33:09 +0000 (20:33 +0200)]
Create dedicated package seeparklib and add openweathermap module.

3 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

3 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

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

3 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)

3 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 …

3 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

3 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

3 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

3 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 ...

3 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

3 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

3 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

3 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

3 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.

3 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

3 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

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

3 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.

3 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>.

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

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

3 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.

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

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

3 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