Commit Graph

2505 Commits

Author SHA1 Message Date
Thomas Basler
dc04a63f7c Upgrade ESP Async WebServer from 2.7.0 to 2.8.1 2024-03-15 20:04:42 +01:00
Thomas Basler
cab38d3c84 Upgrade olikraus/U8g2 from 2.35.10 to 2.35.14 2024-03-15 19:57:28 +01:00
Thomas Basler
3138e28cdf webapp: Remove not required cast to string 2024-03-15 19:54:29 +01:00
Thomas Basler
a0d0aec677 Fix: Correct detection of Hoymiles serial if it contains hex characters 2024-03-15 19:46:24 +01:00
Bernhard Kirchen
2efa1b35b0 live view: do not access undefined data
if the respective feature is disabled, there is no data. do not try to
access it.
2024-03-15 08:55:21 +01:00
Bernhard Kirchen
5c6b4a8f12 disable restarting solar-powered inverters
now that users can tell the DPL that their inverter is not powered by a
battery but powered by solar panels, we shall not restart inverters to
reset the daily yield value, if they are solar powered. these inverters
will reboot every night by themselves.
2024-03-14 21:37:47 +01:00
Bernhard Kirchen
8895791145 live data: exclude data if respective feature disabled 2024-03-14 21:37:47 +01:00
Thomas Basler
0b7258d50e Upgrade olikraus/U8g2 from 2.35.9 to 2.35.10 2024-03-14 20:12:24 +01:00
Bernhard Kirchen
cf27bd29d7 adjust (new) about texts to OpenDTU-OnBattery 2024-03-14 16:27:32 +01:00
Thomas Basler
33bf2117c6 Fix: Set all settings to default when deleting an inverters
Previously some old settings from previous inverters could have been shown in a new inverter
2024-03-13 18:47:28 +01:00
Bernhard Kirchen
56353e4f00 implement Battery::needsCharging()
currently this is only supported by the Pylontech battery provider, as
it reports a "charge battery immediately" alarm. this will also be
implemented by the JK BMS provider, and possibly also by the smart shunt
provider.

the method will be used to determine whether or not to start charging
the battery using the (Huawei) charger.
2024-03-13 17:07:05 +01:00
Thomas Basler
437f572c39 Fix: Don't throw exception if git_hash is not set 2024-03-12 22:11:19 +01:00
Thomas Basler
bd8d93bf92 Feature: Allow enabling and disabling of the version check
Fix #1787
2024-03-12 18:35:19 +01:00
Thomas Basler
9634c93a3c Fix: Show firmware update tooltip only if newer version available
Closes #1796
2024-03-12 17:27:43 +01:00
Thomas Basler
57a997baac webapp: update dependencies 2024-03-12 16:42:29 +01:00
Thomas Basler
103207cead Merge branch 'dev-herf' into dev 2024-03-12 16:34:08 +01:00
Thomas Basler
2526d3dad6 Remove deprecated extension recommendation 2024-03-12 16:33:55 +01:00
Bernhard Kirchen
784e369482 optimize DPL thresholds MQTT integration
* fix logic in HomeAssistent handler
* also publish voltage thresholds (not just SoC thresholds)
* do not publish irrelevant thresholds to MQTT. if the inverter is
  solar-powered, no thresholds are effectively in use by the DPL and it
  therefore makes no sense to publish them to the broker. similarly, if
  no battery interface is enabled or the SoC values are set to be
  ignored, the SoC thresholds are effectively not in use and will not be
  published to the broker.
* make HA auto-discovery expire. this makes auto-dicovered items
  disappear from Home Assistent if their value is no longer updated.
  changes to settings which cause other thresholds to be relevant will
  then be reflected in Home Assistent even if some thresholds are no
  longer maintaned in MQTT.
* force HA update when related settings change enabling VE.Direct shall
  trigger an update since solar passthrough thresholds become relevant.
  similarly, enabling the battery interface makes SoC thresholds become
  relevant. there are more settings in the power limiter that also
  influence the auto-discoverable items.
* break very long lines
2024-03-10 22:10:02 +01:00
LukasK13
fba5c02346 Feature: Set powerlimiter thresholds via MQTT
publish DPL thresholds to MQTT, add support for setting powerlimiter
thresholds via MQTT, and make these auto-discoverable for Home
Assistent.
2024-03-10 22:10:02 +01:00
Bernhard Kirchen
803b30ca11 fix: wrong unit in battery HomeAssistent exp_aft
the exp_aft value is in seconds.
2024-03-10 21:20:56 +01:00
Bernhard Kirchen
19859ed601
Merge pull request #733 from helgeerbe/dpl-make-shutdown-partially-optional
DPL: Explicit Support for solar-powered inverters
2024-03-10 17:25:30 +01:00
Bernhard Kirchen
c46980d6af fix: more memory for onBattery live data
the allocated memory to create the JSON with onBattery-specific totals
for the live view was too little to contain all values, which are sent
regularly.
2024-03-10 15:57:50 +01:00
Bernhard Kirchen
80edbec769 Feature: DPL: keep inverter running if solar powered
avoid shutting down the inverter at all if the calculated power limit
falls below the lower power limit or if the power meter value is
outdated. do this only if the inverter is setup to be solar powered.
2024-03-09 15:42:09 +01:00
Bernhard Kirchen
91f8f61e63 Feature: DPL: explicit support for solar powered inverters
by default and until this change, we assumed that the inverter
controlled by the DPL is powered by a battery. not all users have a
battery in their system. they still use the DPL to achieve net-zero
export. those users can now tell the DPL that their inverter is powered
by solar modules rather than a battery and the DPL will behave
accordingly.
2024-03-09 15:40:13 +01:00
Bernhard Kirchen
be15050aed DPL: refactor code determining battery charge cycle state 2024-03-09 15:40:13 +01:00
Bernhard Kirchen
c6f81806d6 DPL: make "IsInverterSolarPowered" configurable through web app 2024-03-09 15:40:13 +01:00
Bernhard Kirchen
b11b1dbcba DPL: define IsInverterSolarPowered config switch 2024-03-08 22:53:34 +01:00
Bernhard Kirchen
c42d68812c DPL limit scaling: prevent division by zero
this check was removed on error when moving the scaling code into its
own function.
2024-03-07 21:18:11 +01:00
Bernhard Kirchen
b0795a2131 DPL limit scaling: only for supported models 2024-03-07 21:18:09 +01:00
Bernhard Kirchen
64ad4bded1 fix: DPL: limit scaling sanity checks
do not scale limit if inverter is not producing, as DC channel power is
expected to be close to zero anyways.

do not scale limit if current inverter limit is small, such that
channels might produce very little power exactly because the limit is so
low.

move the calculation out of setNewPowerLimit and into a new function, so
that we can make use of return statements there.
2024-03-07 20:54:16 +01:00
Thomas Basler
f995287a6e Feature: Add support for HERF inverters 2024-03-06 21:57:18 +01:00
Bernhard Kirchen
50635ee2ce Feature: live view: update with respective frequency
the update frequency of Victron MPPT charger data, the battery Soc, the
huawei charger power, and the power meter differ from one another, and
differ in particular from the inverter update frequency.

the OnBattery-specific data is now handled in a new method, outside the
upstream code, which merely call the new function(s). the new function
will update the websocket independently from inverter updates. also, it
adds the respective data if it actually changed since it was last
updated through the websocket.

for the webapp to be able to recover in case of errors, all values are
also written to the websocket with a fixed interval of 10 seconds.
2024-03-05 11:31:44 +01:00
Bernhard Kirchen
e432f0eca3 make BateryStats::updateAvailable wrap-around-safe 2024-03-05 11:31:44 +01:00
Bernhard Kirchen
fe7e622e2d pull requests: use a meaningful branch when building
This change makes the build runner switch to a meaningful branch name, which will then appear as the "Firmware Branch" in the System Info of the web application. This helps users testing pull-request builds identify that they are actually using the changes from the respective pull request.
2024-03-05 11:26:38 +01:00
helgeerbe
78e70cc6c5
Merge pull request #708 from schlimmchen/dpl-manage-inverter-state
Fix: DPL: ensure inverter reaches requested state
2024-03-05 10:21:16 +01:00
Thomas Basler
10cd2e4201 webapp: update dependencies 2024-03-04 21:07:01 +01:00
Thomas Basler
b8c1168687 Fix: Exclude hardware part number 124097 from valid part numbers.
This triggers a  re-fetch of the hardware information. Especially 124097 seems to be a wrong read-out.
2024-03-03 16:35:34 +01:00
Bernhard Kirchen
8b6e57cda7 Fix: DPL: ensure inverter reaches requested state
we previously only called commitPowerLimit() if the desired limit
changed such that the change was bigger than the hysteresis. we found
that if the limit update was not received and the desired limit would
not change much, the limit of the inverter was wrong for a long time.

to mitigate this, we introduced re-sending the limit update every 60
seconds, regardless of what the limit reported by the inverter was at
that time.

if the power-up command was not received, we also would repeat it only
once every 60 seconds.

this leads to a new kind of staleness and the actual inverter state was
still not matching the desired state.

this new approach effectively adds an additional control loop at the
start of the DPL loop(). that new function compares the requested
inverter state to the actual reported state. it sends updates (limit
update or power on state) until the desired inverter state is reached,
or until a (hard-coded) timeout occurs.

this approach also allows us to send power-up, power-down, and limit
update commands independent from one another and in a particular order.

this should make sure that the inverter is in the desired state even if
conditions change slowly and commands were not received as expected.
2024-03-02 23:39:43 +01:00
Thomas Basler
3c2b35016a webapp: update dependencies 2024-03-01 19:36:18 +01:00
Thomas Basler
021d9b5f44 Feature: Added description for alarm id 152
Fixes: #1798
2024-03-01 19:31:47 +01:00
Thomas Basler
50abcd1061 Fix: Prevent hiding text on display if it's too long
Fixes: #1797
2024-03-01 19:30:24 +01:00
Bernhard Kirchen
c560d1d90e
fix: copy OnBattery-specific data from live view websocket (#696)
closes #685.
closes #682.
2024-02-29 17:09:18 +01:00
Thomas Basler
9b7df71da0 webapp: Fix typo
Fixes #1780
2024-02-25 11:23:49 +01:00
helgeerbe
c72ae561c7 Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2024-02-19 16:03:56 +01:00
Thomas Basler
f80d03210b webapp: update dependencies 2024-02-19 15:47:59 +01:00
helgeerbe
4e7dfba85c add webapp 2024-02-19 13:51:59 +01:00
helgeerbe
1eb75c322d
Merge pull request #679 from schlimmchen/dpl-voltage-features
DPL Voltage Features
2024-02-19 13:48:12 +01:00
Bernhard Kirchen
9240663552
Feature: show power grid usage on display (#658)
* make efficient use of available display area

fix calculation of the text baselines, using getAscent() in favor of
getMaxCharHeight(), which includes ascent and descent. this moves the
first text up and allows to insert margin between the lines until the
display area is fully utilized.

on large displays, if the small diagram is selected, keep the first line
rather low to avoid collision with the diagram y-axis label. in this mode,
there is still more space between the text lines as before, allowing for
improved readability.

* Feature: show power grid usage on display

if the power meter is enabled, the display will use two of three out
of every three-second time slot to show the grid consumption.

closes #620.
2024-02-19 13:38:57 +01:00
Bernhard Kirchen
c930018764 Feature: DPL: use best available voltage value
the DPL is interested in the battery's voltage to make decisions about
draining the battery or letting it charge (if the user opts to use
voltage thresholds rather than SoC thresholds). using the DC input
voltage reported by the inverter under control has disadvantages:

* the data might be quite old due to the communication protocol
  implementation. more inverters being polled means even more lag. the
  connection being wireless makes this even worse, due to the need
  to retry the occasional lost packet, etc.
* the data is not very accurate, since the DC input of the inverter is
  actually some cabling and a couple of junctions away from the actual
  battery. this voltage drop can mostly only be estimated and is worse
  with higher load. the load correction factor is there to mitigate
  this, but it has its own problems and is cumbersome to calibrate.

instead, this change aims to use more accurate battery voltage readings,
if possible. the DPL now prefers the voltage as reported by the BMS,
since it is for sure the closest to the battery of all measuring points
and measures its voltage accurately regardless of the load (the voltage
reading will still drop with higher loads, but this will be only due to
the battery's internal resistance, not that of cabling or junctions). if
no BMS voltage reading is available, the DPL will instead use the charge
controller's voltage reading, as it is available with much higher
frequency and is assumed to be more accurate as it offers a resolution
of 10mV. only if none of these two sources can be used, the inverter DC
input voltage is assumed as the battery voltage.

closes #655.
2024-02-18 22:17:15 +01:00
Bernhard Kirchen
6df358242c Feature: know and use SoC precision
the Victron SmartShunt communicates the SoC value in permille. this
should be displayed in the web UI accordingly. this is a good excuse to
fully move ownership of the SoC value to the BatteryStats base class and
add a precision indicator variable. this is required to be set each time
a derived class (a battery provider) wants to update the SoC value. the
precision is then used when populating the JSON data for the web UI
(live view).

related to #573.
2024-02-18 22:17:15 +01:00