Skip to content

Commit

Permalink
feat: support grid<>battery flow (#53)
Browse files Browse the repository at this point in the history
* fundamentally working

* temporary card naming

* docs: update flow formula

* flip max ordering for consistancy

* reorganize to bring in line with energy distribution card

* clean up white space

* replace a temporary name with proper name

* Revert "temporary card naming"

This reverts commit 483c495.
  • Loading branch information
ulic75 authored May 18, 2022
1 parent c15a375 commit cf4b7b9
Show file tree
Hide file tree
Showing 2 changed files with 338 additions and 203 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,13 @@ entities:
This formula is based on the offical formula used by the Energy Distribution card.

```js
max - (value / total) * (max - min);
max - (value / totalLines) * (max - min);
// max = max_flow_rate
// min = min_flow_rate
// value = line value, solar to grid for example
// total = home consumption + solar to grid + solar to battery
// totalLines = gridConsumption + solarConsumption + solarToBattery +
// batteryConsumption + batteryFromGrid + batteryToGrid +
// (returnedToGrid ? returnedToGrid - batteryToGrid : 0)
```

I'm not 100% happy with this. I'd prefer to see the dots travel slower when flow is low, but faster when flow is high. For example if the only flow is Grid to Home, I'd like to see the dot move faster if the flow is 15kW, but slower if it's only 2kW. Right now the speed would be the same. If you have a formula you'd like to propose please submit a PR.
Expand Down
Loading

0 comments on commit cf4b7b9

Please sign in to comment.