<jupyter_start><jupyter_text>Home assistantThis is an example how to load data from an existing home assistant database.<jupyter_code>import sys
sys.path.append("../..")
import pandas as pd
path_to_db = '/home/chris/code/adlml/datasets/tuebingen_2019/home-assistant_v2.db'
db_url = 'sqlite:////' + path_to_db
# Devices to include
device_list = [
    'binary_sensor.ping_chris_laptop',
    'binary_sensor.ping_chris_pc',
    'binary_sensor.ping_chris_smartphone',
    'binary_sensor.pir_motion_floor',
    'binary_sensor.pir_motion_mirror',
    'binary_sensor.pir_motion_monitor_left',
    'binary_sensor.pir_motion_monitor_right',
    'binary_sensor.us_distance_floor',
    'binary_sensor.us_distance_mirror',
    'binary_sensor.us_distance_monitor_left',
    'binary_sensor.us_distance_monitor_right',
    'switch.chris_computer',
    'light.storu_shelf_front',
    'light.storu_desk',
    'light.storu_coffee',
    'light.wall',
    'light.storu_mirror', 
    'switch.senseo_one_cup',
    'switch.printer',
    'switch.fan',
    'switch.storu_mirror_light',
    'light.mirror',
]
from pyadlml.dataset import load_homeassistant, load_homeassistant_devices
load_homeassistant(db_url)
# Example for loading a homeassistant database with devices filtered and in the right representation
load_homeassistant_devices(db_url, device_list)
# Example for loading a homeassistant database with devices filtered from a specific time until now
load_homeassistant_devices(db_url, device_list, start_time='2019-07-23 07:21:15.000000')
tmp =  pd.Timestamp('2019-07-23 07:21:15.367036')
load_homeassistant_devices(db_url, device_list, start_time='2019-07-23 07:21:15.000000', end_time='2019-07-23 07:21:47.404236')
from pyadlml.dataset import ACTIVITY
ACTIVITY<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10647887323943662, 'fraction_numerical': 0.04788732394366197, 'mean_word_length': 5.7018867924528305, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '281899', 'license': 'MIT', 'n_tokens_mistral': 696, 'n_tokens_neox': 628, 'n_words': 107, 'path': 'notebooks/datasets/homeassistant.ipynb', 'repo_name': 'tcsvn/pyadlml', 'size': '1775'}