{% extends "base.html" %} {% block title %}Dashboard - THU Home Alert{% endblock %} {% block content %}

Dashboard

{% if latest %}
Water
{% if latest.water_rmb is not none %} {{ latest.water_rmb }} RMB {% else %} N/A {% endif %}
Electricity
{% if latest.electr_kwh is not none %} {{ latest.electr_kwh }} kWh {% else %} N/A {% endif %}
Last Updated
{{ latest.time }}
{% else %}

No balance history yet. Run the monitor to populate data.

{% endif %} {% if account %}

Thresholds

Water: {{ account.water_threshold if account.water_threshold is not none else 'disabled' }} {% if account.water_threshold is not none %}RMB{% endif %} | Electricity: {{ account.electr_threshold if account.electr_threshold is not none else 'disabled' }} {% if account.electr_threshold is not none %}kWh{% endif %}

{% endif %}
{% if history %}

Balance History

{% if history|length >= 2 %}

Click on a point to set the regression start date for ETA estimation.

{% endif %}
{% endif %} {% if eta %}

Estimated Threshold Arrival

Auto (last peak)
Water
{% if eta.water.status == 'ok' %}
{{ eta.water.eta }}
~{{ "%.1f"|format(eta.water.rate|abs) }} RMB/day
{% if eta.water.start_date %}
From {{ eta.water.start_date }}
{% endif %} {% elif eta.water.status == 'below' %}
Already below!
{% elif eta.water.status == 'safe' %}
Recharging
Balance trending up
{% elif eta.water.status == 'unknown' %}
Need more data
{% else %}
Disabled
{% endif %}
Electricity
{% if eta.electricity.status == 'ok' %}
{{ eta.electricity.eta }}
~{{ "%.1f"|format(eta.electricity.rate|abs) }} kWh/day
{% if eta.electricity.start_date %}
From {{ eta.electricity.start_date }}
{% endif %} {% elif eta.electricity.status == 'below' %}
Already below!
{% elif eta.electricity.status == 'safe' %}
Recharging
Balance trending up
{% elif eta.electricity.status == 'unknown' %}
Need more data
{% else %}
Disabled
{% endif %}
{% endif %} {% endblock %}