Commit Graph

2647 Commits

Author SHA1 Message Date
vaterlangen
27f5a943f6
Fix: device profile for OpenDTU Fusion with W5500 (#1259)
* explicitly disable NRF24 when using CMT + W5500. fixes #1257.
* explicitly disable CMT when using NRF + W5500
* added missing LED mapping for W5500 profiles
2024-09-16 22:10:43 +02:00
Bernhard Kirchen
8ff94e7b94 issue template: asks for firmware variant 2024-09-16 16:10:38 +02:00
Bernhard Kirchen
95dac71cb2 bug report: allow to select non-release GitHub build 2024-09-16 16:10:38 +02:00
Bernhard Kirchen
3a33fb06b3 tailor issue templates to OpenDTU-OnBattery
these were never adapted to our fork but merely copied form the upstream
project.
2024-09-16 16:10:38 +02:00
Snoopy-HSS
3fc43098a6
Feature: Support for SBS Unipower batteries (#1199)
Allows to connect to SBS Unipower batteries using a CAN bus.
2024-09-16 15:22:15 +02:00
Andreas Böhm
a6e7007f4b
Feature: extend battery discharge limit support (#1245)
* implements UI to configure battery discharge limit
* adds support for discharge limit to MQTT battery provider
* add option to hide `issues` section from battery live view (for MQTT battery)
2024-09-13 20:52:23 +02:00
ranma
6318ab4a8b
Feature: DPL: Honor battery-provided discharge power limit (#1198)
When the BMS provides a discharge current limit, apply
this limit in the DPL to the inverter power target when running
from battery.
2024-09-13 20:36:16 +02:00
Andreas Böhm
c96762c765
Fix: don't republish MQTT powermeter data to MQTT (#1250) 2024-09-13 17:26:30 +02:00
ranma
86cab0f281
Feature: ESP heap and temperature details on MQTT and HASS (#1242)
I noticed that some useful ESP stats are missing on the MQTT broker, so this adds:

- ESP temperature
- ESP heap stats (size, free, minFree, maxAlloc)
2024-09-13 16:55:38 +02:00
Gumbagubanga
89d9a40296
Feature: Support for W5500 ethernet module (#1231)
adds support for w5500 Ethernet chip, present on
OpenDTU Fusion PoE Ethernet hat in particular.
2024-09-13 16:51:22 +02:00
Bernhard Kirchen
1fe8d3f513 disable "based on OpenDTU" badge
disabled as uploading the changed gist failed repeatedly. maybe the
token in secrets.GIST_SECRET has expired? need help from repo owner
@helgeerbe to fix this.
2024-09-11 21:59:42 +02:00
Bernhard Kirchen
f8595865ea webapp autocompile: try yarnpkg 2024-09-11 21:51:08 +02:00
Bernhard Kirchen
9067acdab7 fix: typo in german web app locale
closes #1223.
2024-09-10 14:33:39 +02:00
Bernhard Kirchen
ffb30de4d2 Revert "webapp: pylontech battery provider can also read DEYE"
This reverts commit cdd6f4cf1b.

See #1244.
2024-09-10 14:24:35 +02:00
Bernhard Kirchen
5ea8fbecf9 WebApi_dtu: remove trailing whitespace
probably added during conflict resolving. these removed whitespace are
not part of the upstream.
2024-09-09 22:28:35 +02:00
Bernhard Kirchen
cdd6f4cf1b webapp: pylontech battery provider can also read DEYE 2024-09-09 21:53:51 +02:00
ranma
f42f018f3e
Fix: sanitize battery manufacturer name string (#1235)
If the string contains control characters for some reason, the browser
will reject the json with the error `bad control character in string
literal`.

This adds a setManufacturer function that validates the string is ASCII
and will cut off the string at the first non-ascii character.

Pylontech: `PYLON` (50 59 4C 4F 4E 20 20 20)
Pytes: `PYTES` (50 59 54 45 53)
Deye: `DY001` (44 59 30 30 31 03 E8 03)

See https://github.com/helgeerbe/OpenDTU-OnBattery/discussions/1226#discussioncomment-10566898
2024-09-09 21:46:47 +02:00
spcqike
cec4003f6e
Implement webapp autocompile (#1193)
add pre-script to check if webapp was compiled or sources changed and auto compile.

---------

Co-authored-by: Bernhard Kirchen <schlimmchen@posteo.net>
2024-09-05 23:02:42 +02:00
ranma
a87f9fa2cd
Fix: Allow higher-resolution SoC in live view header (#1197)
Commit accc70dea0 added the battery SoC to
the live view header. But due to getSoC() returning an int,
the precision was limited.

This changes getSoC() to return float so when a source with higher
precision is available, the respective precision is shown.
2024-09-02 11:08:21 +02:00
Bernhard Kirchen
5ad63e6c44 Fix: DPL settings: do not reset solar_passthrough_enabled
we must not reset the configuration switch value in this context. this
leads to solar passthrough being disabled once the DPL is disabled. when
re-enabling the DPL, solar passthrough is suddenly off, even though the
user configured it to be on.

the configuration switch can stay on. the DPL will still sanity-check
whether or not solar-passthrough can be used (checks if VE.Direct is
enabled) or it is irrelevant since the DPL is disabled.
2024-09-01 22:14:33 +02:00
Bernhard Kirchen
babb24ab1f Fix: reasonable full solar-passthrough default values
value 100 is not accepted by the webapp as inputs for full
solar-passthrough start and stop volages. 66V is the documented
value to be used if one wants to disable full solar-passthrough
(while keeping (non-full) solar-passthrough).
2024-09-01 22:12:48 +02:00
Bernhard Kirchen
9ebbc58930 Fix: Pylontech/Pytes CAN driver: user interrupts at level 2
we are running out of level 1 interrupts on ESP32-S3 boards. for that
reason, until this prooves to be another sort of problem, we allocate
the TWAI's interrupt for the battery CAN implementation at level 2.
2024-08-28 20:08:47 +02:00
Bernhard Kirchen
119bd3a41e Fix: Increase Huawei CAN task stack size
the stack size was already increased by Andreas Boehm in df53f34b51 in
the context of #1144 (SPI port manager). this change aligns the stack
size to a power of two and adds comments. the commit also serves to
place this change more prominently as a fix in the changelogs.
2024-08-28 15:13:23 +02:00
Bernhard Kirchen
fff0576150 Fix: initialize HTTP(S)+JSON power meter values 2024-08-28 13:32:47 +02:00
Bernhard Kirchen
1cbf18d4a7 Feature: HttpGetter: cache digest challenge
this allows us to add a valid Authorization header to each but the first
GET request, saving us from performing two GET requests every time we
want to perform the GET request. we still need a new client nonce and we
need to increase the nonce counter, so we also need to calculate a whole
new response, as we cannot just reuse the previous Authorization header
(that would be a replay attack).
2024-08-28 13:32:47 +02:00
Bernhard Kirchen
fd3b65f4bd Feature: HttpGetter: support MD5 digest authentication
the MD5 scheme should still be widely deployed, even though it is
deprecated. it is also still the default if not specific algorithm
is requested by the server.
2024-08-28 13:32:47 +02:00
Bernhard Kirchen
63612e9276 Fix: restart TCP connection if HTTP server sends Connection:close
we previously performed a whole new GET request when doing digest
authentication. it seemed beneficial to reuse the TCP connection to
perform the second GET request, which includes the authentication
tokens. however, if the server sends "Connection: close" we must not
requse the TCP connection for another HTTP request.

this broke authentication against Shelly devices (at least those with
original firmware).

now we explicitly set "Connection: keep-alive" in our request, and reuse
the TCP connection only if te server replies with "Connection:
keep-alive" as well.
2024-08-28 13:32:47 +02:00
Bernhard Kirchen
b5785d032e print SMA HomeManager timestamp as unsigned number 2024-08-24 21:26:35 +02:00
Bernhard Kirchen
2127b0b080 Fix: SMA HomeManager PowerMeter must announce new values
the SMA power meter implementation did not announce that it received a
new datum, such that the power meter data age was never reset. this made
the power meter values outdated and hence invalid, even though new
values were received and processed.
2024-08-24 21:12:25 +02:00
Bernhard Kirchen
821bc27562 Fix: VE.Direct data is invalid if no controller has valid data
the original implementation of the isDataValid() method worked by
returning false if any of the charge controllers had invalid data. if no
charge controllers were configured, this function then also needed to
also return false.

the logic was changed in 415c767d such that if at least one charge
controller had valid data, the function would return true. this would
have required to adjust the default return statement as well, but it was
not.

if the user enabled VE.Diret and configured at least one charge
controller in the pin mapping, but this controller never delivered any
data, the function would now errorneously return true, because the
container is not empty.

however, if no controller has valid data, this now means we exit the
loop and then the return value must be false, which is also desired if
the container is empty.
2024-08-24 21:06:44 +02:00
Bernhard Kirchen
dcc8313c8c webapp "About" view: link to opendtu-onbattery.net 2024-08-23 17:16:52 +02:00
Bernhard Kirchen
190e1eb0f9 adjust update badge color: having an update available is no danger 2024-08-23 17:16:52 +02:00
Bernhard Kirchen
b115f946cd Fix: update info: compare to respective branch
official release builds are built from branch master, as the respective
tags point to commits in branch master (only). to check whether or not a
new version is available, we should check branch master for new commits.

checking against HEAD does not work as expected, at least in the
OpenDTU-OnBattery repo, since its default branch is "development", not
"master".

usually, there should be no commits on master in between releases, so we
will now only show "update available" if a new release was made. this is
not foolproof, but should work as long as we keep "master" clean.

for builds from other branches, the comparison is perfomed against the
respective branch. if a user installed a binary built by github actions
based on a development branch, the user will see "update available" if
new commits were added to the development branch since.

for other branches, also pull request builds, the test for updates will
fail as the branch name shown in the system info is not actually a
branch name, e.g., "helgeerbe/OpenDTU-OnBattery/pr1183-202408212043".
2024-08-23 17:16:52 +02:00
Andreas Böhm
65407dbdd6
fix: update mqtt subscriptions when topic changed (#1156)
* update mqtt subscriptions when topic was changed
* DPL/Huawei: manage MQTT subscriptions in map

---------

Co-authored-by: Bernhard Kirchen <schlimmchen@posteo.net>
2024-08-20 23:44:27 +02:00
Andreas Böhm
e7d454ff0b
Feature: support 'use battery at night' without VE.Direct
previously, we needed VE.Direct enabled to know the
solar charge controller output, which solely decided when
it was "nighttime". since this is now determined by the
wall clock, we can offer this feature to users without a
Victron charge controller connected using VE.Direct.
2024-08-19 20:49:37 +02:00
Andreas Böhm
df53f34b51
Feature: SPIPortManager allows simultaneous use of CMT2300 and Huawei charger
* backport SPIPortManager from @skippermeister
* adapt to support ESP32 and ESP32-S3 and ESP32-C3
* use logic to work with SPI numbering as in the official
  documentation: start with SPI0 and go up to SPI3
* increase Huawei CAN controller stack size to 2000
* increase startup delay for USB_CDC enabled builds to be able to
  catch bootlogs over USB
2024-08-19 20:44:59 +02:00
Bernhard Kirchen
51624669b0 move documentation to opendtu-onbattery.net 2024-08-17 22:16:50 +02:00
Bernhard Kirchen
2894d15477 remove obsolete #include 2024-08-16 21:38:16 +02:00
Bernhard Kirchen
5d1d071c8a
Fix: Improve DPL nighttime discharging (#1126)
* fix: DPL: start discharging at night logic error

the switch "always start discharging battery at night" would cause to
stop discharging the battery when there was solar power and the battery
was discharged below the start threshold.

this change introduces a nighttime discharging boolean variable, which
is enabled the instant we decide to start a battery discharge cycle due
to nighttime havin arrived. we reset this variable as soon as it is
daytime (solar power available). in that case, we allow discharging the
battery if the start threshold was reached. this can actually be the
case if the battery is charged with cheap electricity during the night.

removed comments as they merely spell out what the if statement already
expresses quite nicely.

* use SunPosition.isDayPeriod() to check for daytime

---------

Co-authored-by: Andreas Böhm <andreas@boehm.cx>
2024-08-15 20:10:32 +02:00
Andreas Böhm
599c5cea7d
adjustment: reduce precision of charged- and discharged energy for pytes batteries (#1165)
Precision is reduced to match the CAN protocol definition.
2024-08-13 17:51:12 +02:00
Andreas Böhm
dacf9d4be1
remove ac-charger target consumption limits (#1159) 2024-08-08 22:41:05 +02:00
Andreas Böhm
df11db1244
fix: add auth check on battery, huawei and powermeter API endpoints (#1155) 2024-08-08 20:58:12 +02:00
Bernhard Kirchen
82b28e3732 Merge upstream tag 'v24.8.5' into development 2024-08-06 21:05:21 +02:00
Thomas Basler
0cc55f3b87 webapp: update dependencies 2024-08-05 18:31:31 +02:00
Thomas Basler
0bb3fc8b94 Fixed documentation for webapp dev mode 2024-08-05 18:31:31 +02:00
Thomas Basler
e279cf5cec Added hint in issue template that HMS-xxxW inverters are not supported 2024-08-05 18:31:31 +02:00
Thomas Basler
cdaf10a92a Fix: Wifi reconnect issue introduced with #2117 and discussed in #2185 was fixed 2024-08-05 18:31:21 +02:00
Bernhard Kirchen
04513d3f22 webapp: disable OTA firmware dialog for unsupported devices
show a warning instead and cancel uploads with a HTPP 500 response.
2024-08-04 22:38:19 +02:00
Bernhard Kirchen
4334e60030 webapp: apply formatter on downstream sources 2024-08-01 20:51:59 +02:00
Bernhard Kirchen
77af085ad3 Merge upstream tag 'v24.8.1' into development 2024-08-01 20:28:11 +02:00