Skip to content

Commit ac14ce5

Browse files
authored
Prepare Release 2025.01.23
Merges branch development into master.
2 parents 137b6d7 + 587f8ca commit ac14ce5

File tree

115 files changed

+3256
-2378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+3256
-2378
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ko_fi: tbnobody
1+
ko_fi: schlimmchen

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ body:
1010
- type: markdown
1111
attributes:
1212
value: |
13-
#### Have a question? 👉 [Start a new discussion](https://github.com/helgeerbe/OpenDTU-OnBattery/discussions/new/choose) or [ask in chat](https://discord.gg/WzhxEY62mB).
13+
#### Have a question? 👉 [Start a new discussion](https://github.com/hoylabs/OpenDTU-OnBattery/discussions/new/choose) or [ask in chat](https://discord.gg/WzhxEY62mB).
1414
1515
#### Before opening an issue, please double check:
1616
1717
- [Documentation](https://opendtu-onbattery.net)
1818
- [The FAQs](https://opendtu-onbattery.net/firmware/faq/)
19-
- [Existing issues and discussions](https://github.com/helgeerbe/OpenDTU-OnBattery/search?q=&type=issues)
19+
- [Existing issues and discussions](https://github.com/hoylabs/OpenDTU-OnBattery/search?q=&type=issues)
2020
- type: textarea
2121
id: what-happened
2222
attributes:

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ contact_links:
44
url: https://discord.gg/WzhxEY62mB
55
about: Discuss with us on Discord
66
- name: 🤔 Have questions or need support?
7-
url: https://github.com/helgeerbe/OpenDTU-OnBattery/discussions
8-
about: Use the GitHub Discussions feature
7+
url: https://github.com/hoylabs/OpenDTU-OnBattery/discussions
8+
about: Use the GitHub Discussions feature

.github/workflows/build.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -141,25 +141,22 @@ jobs:
141141
- name: Checkout
142142
uses: actions/checkout@v4
143143

144-
- name: Get tags
145-
run: git fetch --force --tags origin
144+
- name: Get openDTU core tags
145+
run: git fetch --force --tags https://github.com/tbnobody/OpenDTU.git
146146

147147
- name: Get openDTU core release
148148
run: |
149149
echo "OPEN_DTU_CORE_RELEASE=$(git for-each-ref --sort=creatordate --format '%(refname) %(creatordate)' refs/tags | grep 'refs/tags/v' | tail -1 | sed 's#.*/##' | sed 's/ .*//')" >> $GITHUB_ENV
150150
151-
# disabled as uploading the changed gist failed repeatedly.
152-
# maybe the token in secrets.GIST_SECRET has expired?
153-
# need help from repo owner @helgeerbe to fix this.
154-
# - name: Create openDTU-core-release-Badge
155-
# uses: schneegans/dynamic-badges-action@v1.6.0
156-
# with:
157-
# auth: ${{ secrets.GIST_SECRET }}
158-
# gistID: 68b47cc8c8994d04ab3a4fa9d8aee5e6
159-
# filename: openDTUcoreRelease.json
160-
# label: based on original OpenDTU
161-
# message: ${{ env.OPEN_DTU_CORE_RELEASE }}
162-
# color: lightblue
151+
- name: Create openDTU-core-release-Badge
152+
uses: schneegans/dynamic-badges-action@e9a478b16159b4d31420099ba146cdc50f134483 # version 1.7.0
153+
with:
154+
auth: ${{ secrets.GIST_SECRET }}
155+
gistID: 856dda48c1cadac6ea495213340c612b
156+
filename: openDTUcoreRelease.json
157+
label: based on upstream OpenDTU
158+
message: ${{ env.OPEN_DTU_CORE_RELEASE }}
159+
color: lightblue
163160

164161
- name: Build Changelog
165162
id: github_release

.github/workflows/config/release-notes-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
}
3737
],
3838
"template": "${{CHANGELOG}}",
39-
"pr_template": "- [${{TITLE}}](https://github.com/helgeerbe/OpenDTU-OnBattery/commit/${{MERGE_SHA}})",
39+
"pr_template": "- [${{TITLE}}](https://github.com/hoylabs/OpenDTU-OnBattery/commit/${{MERGE_SHA}})",
4040
"empty_template": "- no changes",
4141
"label_extractor": [
4242
{

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
[![OpenDTU-OnBattery Build](https://github.com/hoylabs/OpenDTU-OnBattery/actions/workflows/build.yml/badge.svg)](https://github.com/hoylabs/OpenDTU-OnBattery/actions/workflows/build.yml)
22
[![cpplint](https://github.com/hoylabs/OpenDTU-OnBattery/actions/workflows/cpplint.yml/badge.svg)](https://github.com/hoylabs/OpenDTU-OnBattery/actions/workflows/cpplint.yml)
33
[![Yarn Linting](https://github.com/hoylabs/OpenDTU-OnBattery/actions/workflows/yarnlint.yml/badge.svg)](https://github.com/hoylabs/OpenDTU-OnBattery/actions/workflows/yarnlint.yml)
4-
<!---
5-
disabled while "create release badge" action is broken, see .github/build.yml
6-
![GitHub tag (latest SemVer)](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/helgeerbe/68b47cc8c8994d04ab3a4fa9d8aee5e6/raw/openDTUcoreRelease.json)
7-
--->
4+
![GitHub tag (latest SemVer)](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/AndreasBoehm/856dda48c1cadac6ea495213340c612b/raw/openDTUcoreRelease.json)
85

96
- [OpenDTU-OnBattery](#opendtu-onbattery)
107
- [Getting Started](#getting-started)

include/BatteryStats.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,5 @@ class MqttBatteryStats : public BatteryStats {
348348
// we do NOT publish the same data under a different topic.
349349
void mqttPublish() const final { }
350350

351-
void getLiveViewData(JsonVariant& root) const final;
352-
353351
bool supportsAlarmsAndWarnings() const final { return false; }
354352
};

include/Configuration.h

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#define MQTT_MAX_TOPIC_STRLEN 256
3030
#define MQTT_MAX_LWTVALUE_STRLEN 20
3131
#define MQTT_MAX_CERT_STRLEN 2560
32+
#define MQTT_MAX_JSON_PATH_STRLEN 256
3233

3334
#define INV_MAX_NAME_STRLEN 31
3435
#define INV_MAX_COUNT 10
@@ -47,8 +48,6 @@
4748

4849
#define POWERMETER_MQTT_MAX_VALUES 3
4950
#define POWERMETER_HTTP_JSON_MAX_VALUES 3
50-
#define POWERMETER_HTTP_JSON_MAX_PATH_STRLEN 256
51-
#define BATTERY_JSON_MAX_PATH_STRLEN 128
5251

5352
struct CHANNEL_CONFIG_T {
5453
uint16_t MaxChannelPower;
@@ -88,7 +87,7 @@ using HttpRequestConfig = struct HTTP_REQUEST_CONFIG_T;
8887

8988
struct POWERMETER_MQTT_VALUE_T {
9089
char Topic[MQTT_MAX_TOPIC_STRLEN + 1];
91-
char JsonPath[POWERMETER_HTTP_JSON_MAX_PATH_STRLEN + 1];
90+
char JsonPath[MQTT_MAX_JSON_PATH_STRLEN + 1];
9291

9392
enum Unit { Watts = 0, MilliWatts = 1, KiloWatts = 2 };
9493
Unit PowerUnit;
@@ -111,7 +110,7 @@ using PowerMeterSerialSdmConfig = struct POWERMETER_SERIAL_SDM_CONFIG_T;
111110
struct POWERMETER_HTTP_JSON_VALUE_T {
112111
HttpRequestConfig HttpRequest;
113112
bool Enabled;
114-
char JsonPath[POWERMETER_HTTP_JSON_MAX_PATH_STRLEN + 1];
113+
char JsonPath[MQTT_MAX_JSON_PATH_STRLEN + 1];
115114

116115
enum Unit { Watts = 0, MilliWatts = 1, KiloWatts = 2 };
117116
Unit PowerUnit;
@@ -182,17 +181,17 @@ struct BATTERY_CONFIG_T {
182181
uint8_t JkBmsInterface;
183182
uint8_t JkBmsPollingInterval;
184183
char MqttSocTopic[MQTT_MAX_TOPIC_STRLEN + 1];
185-
char MqttSocJsonPath[BATTERY_JSON_MAX_PATH_STRLEN + 1];
184+
char MqttSocJsonPath[MQTT_MAX_JSON_PATH_STRLEN + 1];
186185
char MqttVoltageTopic[MQTT_MAX_TOPIC_STRLEN + 1];
187-
char MqttVoltageJsonPath[BATTERY_JSON_MAX_PATH_STRLEN + 1];
186+
char MqttVoltageJsonPath[MQTT_MAX_JSON_PATH_STRLEN + 1];
188187
BatteryVoltageUnit MqttVoltageUnit;
189188
bool EnableDischargeCurrentLimit;
190189
float DischargeCurrentLimit;
191190
float DischargeCurrentLimitBelowSoc;
192191
float DischargeCurrentLimitBelowVoltage;
193192
bool UseBatteryReportedDischargeCurrentLimit;
194193
char MqttDischargeCurrentTopic[MQTT_MAX_TOPIC_STRLEN + 1];
195-
char MqttDischargeCurrentJsonPath[BATTERY_JSON_MAX_PATH_STRLEN + 1];
194+
char MqttDischargeCurrentJsonPath[MQTT_MAX_JSON_PATH_STRLEN + 1];
196195
BatteryAmperageUnit MqttAmperageUnit;
197196
};
198197
using BatteryConfig = struct BATTERY_CONFIG_T;
@@ -216,13 +215,34 @@ struct GRID_CHARGER_CONFIG_T {
216215
};
217216
using GridChargerConfig = struct GRID_CHARGER_CONFIG_T;
218217

219-
enum SolarChargerProviderType { VEDIRECT = 0 };
218+
enum SolarChargerProviderType { VEDIRECT = 0, MQTT = 1 };
219+
220+
struct SOLARCHARGER_MQTT_CONFIG_T {
221+
bool CalculateOutputPower;
222+
223+
enum WattageUnit { KiloWatts = 0, Watts = 1, MilliWatts = 2 };
224+
char PowerTopic[MQTT_MAX_TOPIC_STRLEN + 1];
225+
char PowerJsonPath[MQTT_MAX_JSON_PATH_STRLEN + 1];
226+
WattageUnit PowerUnit;
227+
228+
enum VoltageUnit { Volts = 0, DeciVolts = 1, CentiVolts = 2, MilliVolts = 3 };
229+
char VoltageTopic[MQTT_MAX_TOPIC_STRLEN + 1];
230+
char VoltageJsonPath[MQTT_MAX_JSON_PATH_STRLEN + 1];
231+
VoltageUnit VoltageTopicUnit;
232+
233+
enum AmperageUnit { Amps = 0, MilliAmps = 1 };
234+
char CurrentTopic[MQTT_MAX_TOPIC_STRLEN + 1];
235+
char CurrentJsonPath[MQTT_MAX_JSON_PATH_STRLEN + 1];
236+
AmperageUnit CurrentUnit;
237+
};
238+
using SolarChargerMqttConfig = struct SOLARCHARGER_MQTT_CONFIG_T;
220239

221240
struct SOLAR_CHARGER_CONFIG_T {
222241
bool Enabled;
223242
bool VerboseLogging;
224-
SolarChargerProviderType Provider;
225243
bool PublishUpdatesOnly;
244+
SolarChargerProviderType Provider;
245+
SolarChargerMqttConfig Mqtt;
226246
};
227247
using SolarChargerConfig = struct SOLAR_CHARGER_CONFIG_T;
228248

@@ -386,6 +406,7 @@ class ConfigurationClass {
386406

387407
static void serializeHttpRequestConfig(HttpRequestConfig const& source, JsonObject& target);
388408
static void serializeSolarChargerConfig(SolarChargerConfig const& source, JsonObject& target);
409+
static void serializeSolarChargerMqttConfig(SolarChargerMqttConfig const& source, JsonObject& target);
389410
static void serializePowerMeterMqttConfig(PowerMeterMqttConfig const& source, JsonObject& target);
390411
static void serializePowerMeterSerialSdmConfig(PowerMeterSerialSdmConfig const& source, JsonObject& target);
391412
static void serializePowerMeterHttpJsonConfig(PowerMeterHttpJsonConfig const& source, JsonObject& target);
@@ -396,6 +417,7 @@ class ConfigurationClass {
396417

397418
static void deserializeHttpRequestConfig(JsonObject const& source_http_config, HttpRequestConfig& target);
398419
static void deserializeSolarChargerConfig(JsonObject const& source, SolarChargerConfig& target);
420+
static void deserializeSolarChargerMqttConfig(JsonObject const& source, SolarChargerMqttConfig& target);
399421
static void deserializePowerMeterMqttConfig(JsonObject const& source, PowerMeterMqttConfig& target);
400422
static void deserializePowerMeterSerialSdmConfig(JsonObject const& source, PowerMeterSerialSdmConfig& target);
401423
static void deserializePowerMeterHttpJsonConfig(JsonObject const& source, PowerMeterHttpJsonConfig& target);

include/MqttHandleVedirect.h

Lines changed: 0 additions & 32 deletions
This file was deleted.

include/MqttSettings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class MqttSettingsClass {
2121
void unsubscribe(const String& topic);
2222

2323
String getPrefix() const;
24-
String getClientId();
24+
String getClientId() const;
2525

2626
private:
2727
void NetworkEvent(network_event event);

include/PowerLimiter.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,11 @@ class PowerLimiterClass {
7474
std::pair<bool, uint32_t> _nextInverterRestart = { false, 0 };
7575
bool _fullSolarPassThroughEnabled = false;
7676
bool _verboseLogging = true;
77+
bool _shutdownComplete = false;
7778

7879
frozen::string const& getStatusText(Status status);
7980
void announceStatus(Status status);
80-
bool shutdown(Status status);
81+
bool isDisabled();
8182
void reloadConfig();
8283
std::pair<float, char const*> getInverterDcVoltage();
8384
float getBatteryVoltage(bool log = false);

include/SolarCharger.h

Lines changed: 0 additions & 48 deletions
This file was deleted.

include/SolarChargerProvider.h

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)