Less attribute data and better water metering data
Release Notes
Note: This release is backwards breaking
The attributes were taking up a lot of space in the Developer tools->States screen, making it slow to load, perhaps especially on RPi-based systems. This is now reduced a lot (87.5% less) by filtering attributes to only the relevant attribute and date for each sensor. The sensor attributes now has "date", "value" instead of "Date", "kWh-Exp" and so on. You need to update all Apex-charts with something like:
series:
- entity: sensor.eforsyning_water_end
type: area
data_generator: |
return entity.attributes.data.map((start, index) => {
return [new Date(start["date"]).getTime(), entity.attributes.data[index]["value"]];
});
The up-side of this is that all charts using attributes now can use this exact same data_generator, while only changing the sensor entity.
The triggering of this change came from #30, thanks for the report.
If you used the pre-release v0.12.0 (adding billing data)
Also "should-be-fixed" is the water metering data showing strange values. It turned out water meters also registers hours, so this is now taken care of. I don't have access to water metering data, so the coding here is a little in the dark.
Additionally billing data crashing the plugin on water metering settings, should be fixed too.
The triggering of these changes came from #29 and #28
The future
Please note this release likely to be followed up by another breaking change as I may have found a way to sort-of update data in the past from this community post: import-old-energy-readings-for-use-in-energy-dashboard. If this turns out to be usable it could be possible to drop the use of attributes entirely, and simply use the normal sensor history functionality.
If I try out this method it will be in a v2.x branch. I'll try and fix issues on the 1.x branch for a while too. Just report the bugs so I know.
I don't like all these changes!
I am sorry. If you don't like change, just stick to v0.11.3. That should keep working just fine.
v0.12.0 works just fine for regional heating only so if you don't have water metering through eForsyning, and want billing data, this should be fine too.
Full Changelog: v0.12.0...v1.0.0