Package: hibro
HiBro: a standalone history browser for Home AssistantHiBro is a standalone history browser for Home Assistant based onPlotly Dash.
It displays graphs based on a history database and allows to specify the graphs to be shown with a YAML cofiguration file similar in format to Home Assistant configuration files.In addition to plain time series graphs, it also allows to apply basic statistical operations to the time series, like mean (or max or min) values in specified time intervals (e.g. hourly or daily). Box plots showing statistics about the value of a sensor and pie charts that can be used to monitor energy consumption, for instance, are also supported.Further graph types are straightforward to add using Dash & Plotly. Pull requests are welcome.Installationpython3 -m pip install --user hibroQuick startGenerate a file namedhibro-config.yamland fill it following the instructions below. Minimal example:db_url:"sqlite:////path/to/home-assistant_v2.db"elements:-type:lineentities:-sensor.some_entityThen runhibro(orpython3 -m hibro) and access the dashboard athttp://127.0.0.1:8456.ConfigurationA full configuration file looks like:db_url:...title:...elements:-type:...entities:-......-type:...entities:-.........Top-level keys:db_url:(string, required) A database URI. See theHome Assistant recorder docsfor details.title:(string, optional) A title overriding the default one.elements:(list, required) The list of graphs.There are currently three valid values for "type":line,box, orpie.The items in the entity lists can either be strings or mappings to specify further options:entities:-sensor.my_sensor-entity:sensor.my_sensorresample:DLike in this example, you can mix both styles in a single list.Line chartsA line chart (type: line) by default (when given a list of entities) shows a line chart of the entities' states for the past 24 hours. This can be customized by specifying the list items as mappings rather than strings with the following possible keys:duration:(optional, mapping) Specify the time interval (from now to the past) for which to display data. Defaults to 24 hours. values have to be specified by a mapping, e.g.:duration:hours:3(alsodaysorminuteswork).attribute:(optional, string) Specify a numerical attribute to plot instead of the state itself.resample:(optional, string) Specify a time interval to resample the data to. This is useful for instance when looking at finely grained data (seconds or minutes) over a long time period (days). The strings must be in the format of pandas time offset strings, seethe documentationfor details. Examples:Dfor daily,Hfor hourly.aggregate:(optional, string) When resampling data, this is the aggregate function applied to each interval. Defaults tomean, i.e. the data will be averaged over the interval. Possible other values includemedian,minormax(with obvious meanings) orptp("peak to peak", the difference between maximum and minimum).Full example:-type:lineentities:-entity:climate.living_roomattribute:current_temperatureresample:'15min'aggregate:maxduration:hours:12-sensor.outdoor_temperatureBox plotsBox plots (type: box) show the median and quartiles of numerical sensor data for the entire time period. It supports theattributeanddurationarguments just as line charts, but resampling and aggregation does not make sense.Full example:-type:boxentities:-entity:climate.living_roomattribute:current_temperatureduration:hours:12-sensor.outdoor_temperaturePie chartsPie charts (type: pie) show aggregated values of numerical sensors for the entire time period as pieces of a pie. This makes sense especially for energy sensors to display the fraction of total energy consumed by a device.
Pie charts also haveattributeanddurationoptions (but noresampleoption). Theaggregateoption in this case refers to the function applied over the entire time period. By default, this isptp(peak to peak), i.e. the difference between the minimum and maximum value. This makes sense for energy sensors where it returns the total energy consumed.Full example:-type:pieentities:-entity:sensor.some_deviceattribute:power_consumptionduration:hours:12aggregate:ptp-sensor.some_device_energy