WARNING
This is a pre-release, some functionality might be changed in the final "normal" release (like a name of an option, behaviour of a feature).
Please test, report bugs, provide observations.
What's Changed
features:
- feat: Refactor state_map by @ildar170975 in #1487
- feat: Add displaying of "overall" value by @ildar170975 in #1505
- feat: "Overall" value - add individual aggregation method by @ildar170975 in #1508
- feat: Add "group_by: 12h" variant by @ildar170975 in #1520
- feat: Gaps for missing data by @ildar170975 in #1526
- feat: Add cubic bezier smoothing by @ildar170975 in #1539
fixes:
- fix: checkYAxisLabels() - minor improvements & tests by @ildar170975 in #1486
- fix: checkOption module minor fixes by @ildar170975 in #1488
- fix: Minor fixes for "checkXXX" functions & tests by @ildar170975 in #1489
- fix: migrateYaxisConfig() - minor fix, added tests by @ildar170975 in #1490
- fix: checkColorThresholds() - minor fixes, refactored tests by @ildar170975 in #1491
- fix: Update version to v.0.14.0-dev.4 by @ildar170975 in #1492
- fix: _getMinMaxLineWidth() - add tests by @ildar170975 in #1497
- fix: isNumericEntity() - add tests by @ildar170975 in #1498
- fix: _getDefaultSmoothing() - use isNumericEntity(), add tests by @ildar170975 in #1499
- fix: _getDefaultSmoothing() - process "hass is not ready" case by @ildar170975 in #1501
- fix: use getLog10() helper by @ildar170975 in #1504
- fix: Tests rearrange by @ildar170975 in #1506
- fix: Resolve entity icons via ha-state-icon by @SeoFood in #1495
- fix: Make aggregate functions external & add tests by @ildar170975 in #1507
- fix: Minor fixes in tests by @ildar170975 in #1510
- fix: getEntityState() - fix for "last" variant by @ildar170975 in #1512
- fix: Allow to calculate "overall" value even when graph is hidden by @ildar170975 in #1511
- fix: Using a cache: copy a cached history instead of sharing it by @ildar170975 in #1513
- fix: make getObjectAttr() & isObjectAttr() external functions + add tests by @ildar170975 in #1515
- fix: Make convertStateByMap() an external function by @ildar170975 in #1516
- fix: convertStateByMap() - add clarifications into JSDocs description by @ildar170975 in #1517
- fix: Properly show a "date" for a selected point/bar when group_by = date/12h by @ildar170975 in #1521
- fix: Default "smoothing" for binary_sensor by @ildar170975 in #1522
- fix: convertStateByMap() - fix "mapping contains a number" case by @ildar170975 in #1524
- fix: isNumeric() helper - add tests for undefined & null by @ildar170975 in #1525
- fix: updateEntity() - fix a comparing of last & current values by @ildar170975 in #1518
- fix: Handle "line_width = null" case by @ildar170975 in #1528
- fix: Safe "Graph" constructor by @ildar170975 in #1529
- fix: getBoundaries() - corrected formula for weights by @ildar170975 in #1530
- fix: getBoundaries(): move a code for "min_bound_range" to an external function + add tests for the new function by @ildar170975 in #1531
- fix: getBoundaries() - add tests by @ildar170975 in #1532
- fix: add tests for constructor of Graph class by @ildar170975 in #1534
- fix: Graph class: do not call calcY() several times by @ildar170975 in #1535
- fix: "Graph" constructor tests - added tests, fixed name of "_coords" property by @ildar170975 in #1536
- fix: calcOverall() - calculate for a "floating window" period by @ildar170975 in #1537
- fix: Add more tests by @ildar170975 in #1538
- fix: Minor fixes in tests + Add bat files for enabling/disabling tests by @ildar170975 in #1540
docs:
- docs: Add "Table of content" by @ildar170975 in #1493
- docs: Add "Validation" chapter by @ildar170975 in #1494
- docs: Fix table of content by @ildar170975 in #1496
- docs: Add a warning about a time sync by @ildar170975 in #1500
- docs: Add separators between chapters by @ildar170975 in #1502
- docs: Add a recommendation to clear a browser cache after update by @ildar170975 in #1514
- docs: HACS -> Marketplace by @ildar170975 in #1523
- docs: Minor improvements by @ildar170975 in #1503
- docs: Card's description - about dependencies by @ildar170975 in #1533
New Contributors
Full Changelog: v0.14.0-dev.3...v0.14.0-dev.4
More detailed about new features
"Overall" value - show an aggregated value for a whole time period; either the same aggregation method is used which is defined for a card or per-entity, or another method (for instance, it is possible to use a "last" aggregation method for a graph and a "sum" method for the "overall" value; any aggregation method may be selected for the "overall" value).
"group_by: 12h" variant is supported to group data by half-days (00:00 - 11:59, 12:00 - 23:59).
So, currently these methods are supported: interval, week, date, 12h, hour, 30min, 15min.
Refactored state_map; check a very brief description below:
state_mapoption can be set not only globally, but also per-entity. This allows to implement the following use-case: one entity is numeric on a primary Y-axis, another entity is binary (on/off) on a secondary Y-axis with a per-entitystate_mapdefined.state_mapoption can be set per-axis. This allows to implement the following use-case: one entity is numeric on a primary Y-axis, another few entities are binary (on/off) on a secondary Y-axis with a common per-axisstate_mapdefined.- New method of defining
state_map- defining in "relaxed mode" (in addition to the currently present legacy "strict mode"): original values are NOT replaced in a history array (which is used to build a graph), a mapping is only used to replace a displayed label (1000->Danger). - Different ways of "relaxed" mapping:
a) Use an exact equality – only an exact1000value will be mapped:
- value: 1000
label: Danger
b) Define a tolerance – all values in [950, 1050] range will be mapped (both bounds are "included"):
- value: 1000
tolerance: 50
label: Danger
c) Define a range – all values in [950, 1001) range will be mapped. Note that the right bound is open (not closed/included), that is why the 1001 value is used instead of 1000, then values less than 1001 will be mapped:
- min: 950
max: 1001
label: Danger
Using the “range” way, it is possible to cover all possible values like:
map:
- min: 0
max: 500.99
label: Normal
- min: 501
max: 800.99
label: Warning
- min: 801
max: 1001
label: Danger
- It is possible to define a templated structure of a
labeloption: instead of defining a simpleDangervalue, set alabel: Danger [${min} .. ${max})template which will generate aDanger [801 .. 1001)text (hereraw,value,tolerance,min&maxcan be used as tokens;rawstands for a matched value & is presented as any other "normal" value, i.e. properly formatted & applied with a possible "value_factor"). Might be easier than repeating same text when defining a label. Note that in the "strict mode", onlyvaluetoken can be used. - It is possible to define a common
labelfor all mappings – and using the new templated structure is a way to simplify a code: define a globallabel: ${raw} [${min} .. ${max}), then a particular label will be calculated in the same way for each mapping in a runtime (when it is needed to show a state value):
state_map:
map: ... array of mappings
keep_values: true
label: ${raw} [${min} .. ${max})
- To clean up a presentation, it is possible to hide a unit for a converted value to prevent cases like
Danger %. Thehide_unitoption can be defined both for a particular mapping or for all mappings (like it is shown for thelabeloption in pt. 8 above).
Gaps for missing data - show periods where an entity’s state was unavailable (for attributes – where an attribute does not exist, "disappears") as gaps:
Also, when a "strict" state_map config is defined & no mapping is found for a particular value – then this case is also treated as an "invalid value" causing displaying a gap.
New cubic bezier smoothing - gives a more accurate "smoothed" representation where extremums are located on real points.
Compare the smoothing: false, smoothing: true & the new smoothing: cubic variant:
