There are two different solutions.
In [ ]:
import os
import sys
import inspect
import tmpo
from opengrid.library import fluksoapi
from opengrid.library import houseprint
from opengrid import config
c = config.Config()
# for tmpo, only use user-speficied path if a correct path is provided
try:
if os.path.exists(c.get('tmpo', 'data')):
path_to_tmpo_data = c.get('tmpo', 'data')
except:
path_to_tmpo_data = None
Run the cell below if you want to obtain the very last houseprint information
In [ ]:
%run cache_anonymous_houseprint.py
Create a tmpo session and load the houseprint
In [ ]:
tmpos = tmpo.Session(path_to_tmpo_data)
tmpos.debug = True
hp = houseprint.load_houseprint_from_file('new_houseprint.pkl')
hp.init_tmpo(tmpos)
Make sure all known sensors of the houseprint are added to the tmpo database. Then synchronize all data up to now.
In [ ]:
hp.sync_tmpos()
In [ ]:
# path to data is stored in opengrid.cfg.
# for syncing with csv
path_to_csv_data = c.get('data', 'folder')
# This synchronization can take a while...
fluksoapi.synchronize(path_to_csv_data)
# see the other notebooks on how to import the data and start analysing.
In [ ]: