Venue 9 - lots of Lascar loggers#

Venue 9 was able to deploy a bunch of Lascars at once - commercial USB-stick loggers that also record temperature, and relative humidity if you pay enough. We can’t always support this, but it can be useful for understanding balance and circulation problems and thinking about which rooms are really struggling with heat loss.

You can get a line to disappear by clicking on it in the legend. Room 1 is one of our own sensors. There’s a big difference in the temperature of different rooms (5C at at times even without thermostats appearing to operate) and it’s unlikely to all be down to differences in the sensors.

Hide code cell source
# Using plotly.express

# import ipywidgets as widgets
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go   
#from IPython.display import display

# leave out sc_boiler, appears to be 7:30-23:00
rooms_with_rh = ["counsellors","office"]
rooms_without_rh = ["garden_room","room_2","room_3","room_4","room_6","room_7","waiting_area"]

list_of_traces = []
list_of_rh_traces = []

for x in rooms_with_rh:
    df = pd.read_csv("./venue-9/" + x + ".csv",encoding='latin-1',usecols=[1,2,3], header=0, names= ['time', 'temperature', 'RH'])
    df["timestamp"] = pd.to_datetime(df['time'])
    
    trace = go.Scatter(customdata=df, 
                        y=df['temperature'], 
                        x = df['timestamp'], 
                        mode='lines', 
                        hoverinfo='all', 
                        name=x,
                        )
    list_of_traces.append(trace)
    rh_trace = go.Scatter(customdata=df, 
                        y=df['RH'], 
                        x = df['timestamp'], 
                        mode='lines', 
                        hoverinfo='all', 
                        name=x,
                        )
    list_of_rh_traces.append(rh_trace)

for x in rooms_without_rh:
    df = pd.read_csv("./venue-9/" + x + ".csv",encoding='latin-1',usecols=[1,2], header=0, names= ['time', 'temperature'])
    df["timestamp"] = pd.to_datetime(df['time'])
    
    
    trace = go.Scatter(customdata=df, 
                        y=df['temperature'], 
                        x = df['timestamp'], 
                        mode='lines', 
                        hoverinfo='all', 
                        name=x,
                        )
    list_of_traces.append(trace)

for x in ['room_1']: # special, the only one of our loggers (has RH)
    df = pd.read_csv("./venue-9/" + x + ".csv",encoding='latin-1',usecols=[0,2,3], header=0, names= ['time', 'temperature','RH'])
    df["timestamp"] = pd.to_datetime(df['time'])
    
    
    trace = go.Scatter(customdata=df, 
                        y=df['temperature'], 
                        x = df['timestamp'], 
                        mode='lines', 
                        hoverinfo='all', 
                        name=x,
                        )
    list_of_traces.append(trace)
    rh_trace = go.Scatter(customdata=df, 
                        y=df['RH'], 
                        x = df['timestamp'], 
                        mode='lines', 
                        hoverinfo='all', 
                        name=x,
                        )
    list_of_rh_traces.append(rh_trace)


g = go.FigureWidget(data=list_of_traces,
                    layout = go.Layout(
                        yaxis=dict(range=[10,30])
                    ))

# example syntax for two plots on same x-axis - I'd like to show the boiler temperature in
# parallel - but havne't had time to sort the syntax.
#fig = make_subplots(rows=2, cols=1, shared_xaxes=True)

# for i, col in enumerate(cols, start=1):
#     fig.add_trace(go.Scatter(x=df[col].index, y=df[col].values), row=i, col=1)

fig = go.Figure(g)
fig.update_layout(showlegend=True, 
              autosize = True, 
              width=1000, 
              height=500,
)




fig.update_layout(
    hovermode='x unified',
   # range=[range_min, range_max],
    hoverlabel=dict(
        bgcolor="white",
        # font_size=16,
        font_family="Rockwell"
    )
)

#Add range slider
fig.update_layout(
    xaxis=dict(
        rangeselector=dict(
            buttons=list([
                dict(
                     label="All",
                     step="all"
                     ),
                                dict(count=1,
                     label="Hour",
                     step="hour",
                     stepmode="todate"),
                dict(count=1,
                     label="Day",
                     step="day",
                     stepmode="backward"),
                dict(count=7,
                     label="Week",
                     step="day",
                     stepmode="backward"),
                dict(count=1,
                     label="Year",
                     step="year",
                     stepmode="backward")
            ])
        ),
        rangeslider=dict(
            visible=True,
        ),
        type="date"
    )
)


#fig.add_hline(y=16, annotation_text='16C - usual minimum for children', annotation_font_color="blue", line_color='red', layer='above', line_dash='dash')
# fig.update_yaxes(range = [-5, dfCollatedDataSet['temperature'].max()+5])
fig.show()

g_rh = go.FigureWidget(data=list_of_rh_traces,
                    layout = go.Layout(
                        yaxis=dict(range=[0,100])
                    ))

# example syntax for two plots on same x-axis - I'd like to show the boiler temperature in
# parallel - but havne't had time to sort the syntax.
#fig = make_subplots(rows=2, cols=1, shared_xaxes=True)

# for i, col in enumerate(cols, start=1):
#     fig.add_trace(go.Scatter(x=df[col].index, y=df[col].values), row=i, col=1)

fig_rh = go.Figure(g_rh)
fig_rh.update_layout(showlegend=True, 
              autosize = True, 
              width=1000, 
              height=500,
)




fig_rh.update_layout(
    hovermode='x unified',
   # range=[range_min, range_max],
    hoverlabel=dict(
        bgcolor="white",
        # font_size=16,
        font_family="Rockwell"
    )
)

#Add range slider
fig_rh.update_layout(
    xaxis=dict(
        rangeselector=dict(
            buttons=list([
                dict(
                     label="All",
                     step="all"
                     ),
                                dict(count=1,
                     label="Hour",
                     step="hour",
                     stepmode="todate"),
                dict(count=1,
                     label="Day",
                     step="day",
                     stepmode="backward"),
                dict(count=7,
                     label="Week",
                     step="day",
                     stepmode="backward"),
                dict(count=1,
                     label="Year",
                     step="year",
                     stepmode="backward")
            ])
        ),
        rangeslider=dict(
            visible=True,
        ),
        type="date"
    )
)


#fig_rh.add_hline(y=16, annotation_text='16C - usual minimum for children', annotation_font_color="blue", line_color='red', layer='above', line_dash='dash')
# fig_rh.update_yaxes(range = [-5, dfCollatedDataSet['temperature'].max()+5])
fig_rh.show()