Commit Graph

2367 Commits

Author SHA1 Message Date
Bernhard Kirchen
f634f58788 Fix: DPL: use correct channel type to get inverter efficiency 2024-04-11 08:28:49 +02:00
Bernhard Kirchen
a9c3e05f05 PowerMeter admin: URL examples to the top and hidden if disabled 2024-04-10 20:44:46 +02:00
PhilJaro
165a9bc168
adjust VE.Direct MPPT yield resulotion (#859) 2024-04-09 20:31:05 +02:00
eu-gh
0ed09aeb4c Feature: Huawei: add SoC stop threshold and verbose logging switch 2024-04-07 17:16:50 +02:00
SW-Nico
b9ad1e3054 VE.Direct: process more values and refactor variable names
* process "IL", "AR" and "MON"
* discard "BMV" and (unsolicited) History Data
* simplify isDataValid()
* veMpptStruct, veStruct: new, verbose variable names, including units,
  and replace floats (save values with original integer precision)
* comment on rollover situation in isDataValid()
2024-04-07 17:13:07 +02:00
Bernhard Kirchen
3934906001
Merge pull request #836 from helgeerbe/merge-v24.3.31
Merges v24.3.31 from upstream
2024-04-03 20:08:09 +02:00
Bernhard Kirchen
21cdc69625 Feature: use VE.Direct "network total DC power"
1. makes the DPL use the power generated by all connected charge
   controllers for calculations based on solar passthrough.
2. makes the network total DC power appear as "MPPT Total Power" in the
   live view at the top.
3. shows the network total DC power in the VE.Direct live data card.
2024-04-03 16:33:15 +02:00
Bernhard Kirchen
6b8c93d2e6 polish VE.Direct HEX support
* show charge controller temperature in live view
* send hex requests right after decoding a frame. this seems to have the
  best chance of getting an answer to all requests.
* deem 0xFFFFFFFF value of network total DC power as invalid indicator.
  neither network state, nor network info, nor network mode seem to
  indicate that the charge controller is part of a VE.Smart network. for
  that reason, we revert to always querying the network total DC power
  value, but testing it for max(uin32_t) value, which seems to indicate
  that the charge controller is not part of a VE.Smart network.
* improve (verbose) logging, e.g., use _logId, and print names of
  response codes and known registers, always print error messages,
  add additional tests to prevent overly verbose messages.
* move hex protocol definitions to VeDirectData.h header
  and use enum classes
* define register addresses in enum class
* move values retrieved through hex protocol into main MPPT data struct
* do not send HEX requests if the serial interface cannot send data
* detect whether smart battery sense temperature is available
* web app: make all VE.Direct sub-cards iterable. this makes addind more
  values much simpler and saves a bunch of code in the web app.
* make VeDirectFrameHandler state a type-safe enum class
* unindent MPPT controller loop()
* whitespace cleanup
2024-04-03 16:33:15 +02:00
SW-Nico
aadd7303ac Feature: add support for VE.Direct hex messages 2024-04-03 16:33:15 +02:00
helgeerbe
ff44267e73 Merge remote-tracking branch 'tbnobody/OpenDTU/master' into merge-v24.3.31 2024-04-03 11:53:03 +02:00
Bernhard Kirchen
8c6e925ca4 VE.Direct: make state machine timeout robust against overflow 2024-04-02 21:05:59 +02:00
Bernhard Kirchen
43f553d2d4 VE.Direct MQTT: simplify code
the use of a #define is warranted here since it saves a lot of code
duplication and improves code readability.
2024-04-02 21:05:59 +02:00
Bernhard Kirchen
92a7f27919 VE.Direct: use float rather than double
double precision floating point numbers are not needed to handle
VE.Direct values. handling double is implemented in software and hence
*much* more resource intensive.
2024-04-02 21:05:59 +02:00
Bernhard Kirchen
b299b9dc6c VE.Direct: simplify access to data
hand out const& to the data structs. this is possible now that this
struct is "stable", i.e., not reset regularly.
2024-04-02 21:05:59 +02:00
Bernhard Kirchen
ad125ea804 Fix: properly handle fragmented VE.Direct messages
queue every text event until the frame was checked by it checksum. then
process the data directly into the buffer struct. do not clear the
buffer struct, so it will always include the most recent value of a
particular data point.
2024-04-02 21:05:59 +02:00
Bernhard Kirchen
187f197e32 Feature: add unique prefix to VE.Direct messages 2024-04-02 21:05:59 +02:00
MalteSchm
8abf614047 Feature: BMS initiated emergency charging
This change logically connects the AC-Charger with the BMS to add BMS
initiated emergency charging and respecting BMS current limits.
2024-04-02 21:05:00 +02:00
PhilJaro
da96273085
Fix typo in German locale (#831) 2024-04-02 12:05:45 +02:00
Thomas Basler
12588655df webapp: add app.js.gz 2024-03-31 23:07:08 +02:00
Thomas Basler
bdff1e1ac3 Added github workflow to do some repository cleanup 2024-03-31 22:39:59 +02:00
Thomas Basler
f0a8cabc2c webapp: update dependencies 2024-03-31 14:31:57 +02:00
Thomas Basler
1888054627 Fix: Re-Request grid profile parameters if received data are invalid / to short
Fixes #1874
2024-03-31 12:42:00 +02:00
Thomas Basler
6f3b8fb8e1 Fix: Change default NTP server
Fixes #1877
2024-03-31 12:27:27 +02:00
Bernhard Kirchen
91a0992964 fix: VE.Direct MPPT data not always updated in websocket
set the "last published" timestampt after handling *all* MPPTs.
2024-03-26 20:48:39 +01:00
Rene
eff8d52014 better alignment inverter, issue 360 2024-03-25 22:42:22 +01:00
David von Oheimb
811b64adb5 PowerLimiter.cpp: simplification and minor correction of logic table comments 2024-03-25 10:55:00 +01:00
Bernhard Kirchen
06f39f8396 Merge remote-tracking branch 'tbnobody/master' into development 2024-03-23 22:58:21 +01:00
Bernhard Kirchen
12f7caf998 fix: HTTP power meter: retrieve multiple JSON paths
if only a single request was made (switch "Individual HTTP requests per
phase" is off), the user could still enable phase 2 and phase 3 config
and configure a respective JSON path. however, the value was never
extracted from the successful HTTP request for phase 1.

closes #637.
2024-03-23 22:13:59 +01:00
Bernhard Kirchen
b8d0998a49 HTTP power meter: refactor tryGetFloatValueForPhase
unindent code, prepare this method for re-use on the same HTTP response
but with a different JSON path.
2024-03-23 22:13:59 +01:00
Bernhard Kirchen
c41d6f5138 HTTP power meter: remove trailing whitespace
this commit is empty when inspecting it with --ignore-all-space.
2024-03-23 22:13:59 +01:00
Bernhard Kirchen
054a677575 DPL settings in web app: split metadata from config
users are manipulating the DPL using HTTP POST requests. often they are
requesting the current settings using HTTP GET on the respective route,
then change a particular settings, and send all the data back using HTTP
POST. if they failed to remove the metadata node from the JSON,
OpenDTU-OnBattery would not be able to process the JSON due to its size.
the web app does not submit the metadata.

to avoid problems, the metadata is now split from the configuration
data.
2024-03-23 22:13:50 +01:00
Bernhard Kirchen
8bfb5c6523 implement and use Utils::checkJsonOverflow()
this method calls the overflowed() method on the respective
DynamicJsonDocument and prints a respective message if not all
data could be added to the DynamicJsonDocument.
2024-03-23 17:57:13 +01:00
Bernhard Kirchen
1fb2d4262e do not publish live data for broken MPPT controllers
in case the user defines the respective pins, an MPPT controller will be
setup and the websocket would previously publish its invalid data even
if no data at all was received. this lead to using an invalid index and
to publish a useless card. instead, skip those controllers.

if the connection to a controller breaks, it will always present as a
card in the live view with the respective serial number and the last
known data.
2024-03-23 17:56:51 +01:00
Bernhard Kirchen
0154da91ab fix VE.Direct live data response size
PLLIMIT would not (always) be part of the JSON string transmitted to the
web application and trip it. with the help of the ArduinoJson assistant,
new values to use in the response size calculation were introduced.
also, importantly, a constant offset was added for the DPL status and
the JSON structure sourrounding the MPPTs.
2024-03-23 17:56:51 +01:00
Bernhard Kirchen
1c51c2de40 fix and harden BatteryStats update timestamp handling
* updating the SoC or value shall also update the general timestamp, as
  the latter is defined as "any value changed", which includes SoC and
  voltage, of course.
* if the last update is not a valid timestamp at all, the
  updateAvailable method must always return false, obviously.
2024-03-23 17:56:46 +01:00
Bernhard Kirchen
d935283d1f avoid sending null through live data websockets
on the "main" live data websocket this can happen if no
OnBattery-specific data is available to sent but the empty
JSON document is still sent, which trips the web application.

publishing null in the battery live data websocket also trips the web
application, which rightfully assumes a valid object if data is received
through the websocket.
2024-03-23 17:54:45 +01:00
Bernhard Kirchen
13e42051b6 DPL: improve verbose logging (more variables logged) 2024-03-22 21:50:42 +01:00
Thomas Basler
3b05f447d5 webapp: add app.js.gz 2024-03-22 20:46:22 +01:00
Thomas Basler
326cb15a76 Upgrade olikraus/U8g2 from 2.35.14 to 2.35.15 2024-03-22 20:42:14 +01:00
Thomas Basler
bf4d128e49 webapp: update dependencies 2024-03-22 20:39:12 +01:00
helgeerbe
03435f66ee Feature: Set max number of supported Inverters to 10 (upstream default)
Due to the latest live view api changes, I revert the maximum number of supported inverters to the upstream default (10).
2024-03-22 13:50:16 +01:00
Snoopy-HSS
bbaed260f5
SMA Homemanager: fix power value calculation
when consuming from the grid, the power meter value shall be positive, and it shall be negative when exporting power.
2024-03-22 10:20:53 +01:00
Thomas Basler
3125f16d99 Fix: Previously check for HwPartNumber 124097 was implemented wrong
Fix: #1846
2024-03-21 20:00:34 +01:00
Thomas Basler
ed326763b7 webapp: update dependencies 2024-03-21 19:59:13 +01:00
Bernhard Kirchen
b449dd1196 replace VICTRON_MAX_COUNT
determine the amount of controllers actually in use dynamically,
especially to avoid indices which are invalid, causing an error
to be printed, even though the user did not do anything wrong.
2024-03-20 22:11:11 +01:00
Bernhard Kirchen
8e5e8d169d fix: VE.Direct live data after supporting second MPPT
an error was made when determining whether or not to push a VE.Direct
MPPT's state through the websocket based on its data's age.
2024-03-20 22:11:10 +01:00
Bernhard Kirchen
cffc5b1d26
Merge pull request #778 from helgeerbe/upstream-v24.3.15
merges upstream v24.3.15
2024-03-20 21:00:04 +01:00
helgeerbe
5259fc172a Merge remote-tracking branch 'tbnobody/OpenDTU/master' into v24.3.15 2024-03-20 09:42:35 +01:00
Bernhard Kirchen
cd339a3a14 Feature: implement PowerMeter pin config for serial interfaces
in your pin_mapping.json, add a powermeter object like this:

[
    {
        "name": "My Board",
        ...
        "powermeter": {
            "rx": <num>,
            "tx": <num>,
            "dere": <num>
        },
        ...
    }
]

the SML power meter requires the rx pin to be set. the SDM power meter
requires the rx and tx pins are set. the "dere" pin pin is optional and
if set, this pin controls the driver enable and receiver enable pins of
the RS485 transceiver. the SDM library handles this pin.

closes #771.
2024-03-19 21:27:25 +01:00
Bernhard Kirchen
7d4a30dde4
hardware_flash.md: move some info to wiki
closes #628
2024-03-19 20:01:25 +01:00