Commit Graph

555 Commits

Author SHA1 Message Date
Thomas Basler
8b5d406a4f Introduce several const statements 2023-12-07 15:19:04 +01:00
Thomas Basler
e9a55cf361 Remove not required onWebsocketEvent 2023-12-07 14:09:32 +01:00
Thomas Basler
9ae791edd4 Feature: Added ability to change the brightness of the LEDs
Based on the idea of @moritzlerch with several modifications like pwmTable and structure
2023-12-07 12:46:38 +01:00
Thomas Basler
f8f79c816a Split LedSingle into multiple tasks 2023-11-23 22:35:05 +01:00
Thomas Basler
134fefa30e Split InverterSettings into multiple tasks 2023-11-23 22:35:05 +01:00
Thomas Basler
80d534e045 Migrate WebApi to TaskScheduler 2023-11-23 22:35:05 +01:00
Thomas Basler
ab8679e7b9 Migrate Display_Graphic to TaskScheduler 2023-11-23 22:35:05 +01:00
Thomas Basler
ad1f1b690c Migrate MessageOutput to TaskScheduler 2023-11-23 22:35:05 +01:00
Thomas Basler
77779a1ed9 Migrate InverterSettings to TaskScheduler 2023-11-23 22:35:05 +01:00
Thomas Basler
1501411037 Migrate NetworkSettings to TaskScheduler 2023-11-23 22:35:05 +01:00
Thomas Basler
7881d955bd Migrate LedSingle to TaskScheduler 2023-11-23 22:35:05 +01:00
Thomas Basler
524483451f Migrate MqttHandleInverter to TaskScheduler 2023-11-23 22:35:05 +01:00
Thomas Basler
5c501f879f Migrate MqttHandleDtu to TaskScheduler 2023-11-23 22:35:05 +01:00
Thomas Basler
48a27fbfad Migrate MqttHandleHass to TaskScheduler 2023-11-23 22:35:05 +01:00
Thomas Basler
98c30d1042 Migrate MqttHandleInverterTotal to TaskSchedule 2023-11-23 22:35:05 +01:00
Thomas Basler
c045b5df48 Migrate Datastore to TaskScheduler 2023-11-23 22:35:05 +01:00
Thomas Basler
12031ed09e Migrate SunPosition to TaskScheduler 2023-11-23 22:35:05 +01:00
Thomas Basler
a7c9c2df1a Initialize TaskScheduler 2023-11-23 22:35:05 +01:00
Thomas Basler
1de3b48166 Feature: Implement offset cache for "YieldDay"
Thanks to @broth-itk for the idea!
Fix: #1258 #1397
2023-11-22 20:21:25 +01:00
Thomas Basler
ee4811bbe7 Feature: Allow configuration of LWT QoS 2023-11-19 16:17:10 +01:00
Thomas Basler
b85c53f476 Split config struct into different sub structs 2023-11-19 14:53:26 +01:00
Thomas Basler
6bafd734d7 Remove not required enum 2023-11-18 22:35:58 +01:00
Thomas Basler
d3f95000e2 Optimize Sun data calculation 2023-11-18 22:34:55 +01:00
helgeerbe
dd8446df0a Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-11-17 09:30:04 +01:00
Thomas Basler
6f685a4ab5 Fix: Day period is only calculated once 2023-11-16 18:03:25 +01:00
helgeerbe
0085970567 Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-11-16 09:20:08 +01:00
MalteSchm
3dceddfe49
Split Huawei setValue in private/public implementation. Prevent setting values when internal power control mode is enabled (#521) 2023-11-15 12:38:35 +01:00
Thomas Basler
89b4b8ea85 Merge branch 'pr1441' into dev 2023-10-31 19:30:56 +01:00
CommanderRedYT
7c875187a8
Implemented mDNS 2023-10-30 20:53:45 +01:00
Bernhard Kirchen
0fa2745ace
Fix: VE.Direct refactor issues from #505 (#516)
* VE.Direct: return non-nullptr as a fallback

the changed return statement was supposed to return a shared_ptr to a
new and valid MPPT data struct as a fallback. however, it did return a
new shared_ptr that was initialized to nullptr.

* VE.Direct: make liveview total use total MPPT values

this change makes the call to VictronMppt.getData() obsolete, which in
turn will therefore not cause an error message on the console if
VE.Direct (MPPT) is not enabled. this change also takes care that once
multiple VE.Direct MPPT charge controllers are supported, the sums of
the respective total values are used in the web app totals.
2023-10-23 13:23:06 +02:00
Philipp Sandhaus
8ba9048f99
Show battery temperature when sensor is present (#511) 2023-10-23 13:22:10 +02:00
Bernhard Kirchen
4d4aadf8de
Feature: AC charger: configurable CAN controller frequency (#500) 2023-10-19 16:16:01 +02:00
Bernhard Kirchen
d23b991f5c
VE.Direct: Fix design issues and prepare support for multiple instances (#505)
* introduce VictronMpptClass

this solves a design issue where the loop() method of a static instance
of VeDirectMpptController, which is part of library code, is called as
part of the main loop() implementation. that is a problem because the
call to this loop() must be handled differently from all other calls:
the lib does not know whether or not the feature is enabled at all.
also, the instance would not be initialized when enabling the feature
during normal operation. that would even lead to a nullptr exception
since the pointer to the serial implementation is still uninitialized.

this new intermediate class is implemented with the support for multiple
Victron charge controllers in mind. adding support for more charge
controllers should be more viable than ever.

fixes #481.

related to #397 #129.

* VE.Direct: move get.*AsString methods to respective structs

those structs, which hold the data to be translated into strings, know
best how to translate them. this change also simplifies access to those
translation, as no parameter must be handed to the respective methods:
they now act upon the data of the instance they are called for. adds
constness to those methods.

* VE.Direct: simplify and clean up get.*AsString methods

use a map, which is much easier to maintain and which reads much easier.
move the strings to flash memory to save RAM.

* DPL: use VictronMpptClass::getPowerOutputWatts method

remove redundant calculation of output power from DPL. consider
separation of concern: VictronMpptClass will provide the total solar
output power. the DPL shall not concern itself about how that value is
calculated and it certainly should be unaware about how many MPPT charge
controllers there actually are.

* VE.Direct: avoid shadowing struct member "P"

P was part of the base struct for both MPPT and SmartShunt controller.
however, P was also part of the SmartShunt controller data struct,
shadowing the member in the base struct.

since P has slightly different meaning in MPPT versus SmartShunt, and
since P is calculated for MPPT controllers but read from SmartShunts, P
now lives in both derived structs, but not in the base struct.

* VE.Direct: isDataValid(): avoid copying data structs

pass a const reference to the base class implementation of isDataValid()
rather than a copy of the whole struct.

* VE.Direct: unify logging of text events

* VE.Direct: stop processing text event if handled by base

in case the base class processed a text event, do not try to match it
against values that are only valid in the derived class -- none will
match.

* VE.Direct MPPT: manage data in a shared_ptr

instead of handing out a reference to a struct which is part of a class
instance that may disappear, e.g., on a config change, we now manage the
lifetime of said data structure using a shared_ptr and hand out copies
of that shared_ptr. this makes sure that users have a valid copy of the
data as long as they hold the shared_ptr.

* VE.Direct MPPT: implement getDataAgeMillis()

this works even if millis() wraps around.

* VE.Direct: process frame end event only for valid frames

save a parameters, save a level of indention, save a function call for
invalid frames.
2023-10-19 16:15:29 +02:00
Bernhard Kirchen
116da05114
DPL: (re-)send power limits periodically (#483)
avoid staleness in case the same power limit is calculated over and over
again, hence no new power limit value is calculated and hence no power
limit command is sent to the inverter. staleness occurs in this case if
the first power limit command to establish the respective limit was not
received by the inverter. one can easily simulate a situation where the
same power limit is caluclated over and over again: with a battery above
the start threshold, set a very low upper power limit for the inverter
(DPL setting). that value will be used as the limit as long as the power
meter reading is larger than that.

we could also check the limit reported by the inverter. however, that
value is in percent of the inverter's max AC output, and is often not
the same value as we requested as the limit, but slightly off. we then
would have to decide how much deviation is okay, which is unreasonably
complicated.

closes #478.
2023-10-09 09:51:40 +02:00
Stefan Oberhumer
7f99095fca Remove SUNPOS_UPDATE_INTERVAL define and introduce INVERTER_UPDATE_SETTINGS_INTERVAL. 2023-10-06 11:13:09 +02:00
Stefan Oberhumer
943dfc2dbf Compute sunrise and sunset only if necessary.
Sunrise and -set must recomputed if one of the following conditions is met:
* The date changed (based on the selected timezone)
* Location (Lat/Lon) changed
* Sunset type changed

So instead of calculating that every minute just do it on update via web interface or date change.

If a new config is uploaded, the DTU gets restarted. There is no need to initiate a recalculation in this case.
2023-10-06 10:20:36 +02:00
MalteSchm
b1164d6c69
Move Huawei CAN bus communication to separate thread (#454) 2023-10-02 11:22:10 +02:00
Philipp Sandhaus
7142921021
Integration of Victron SmartShunt via VE.Direct (#452)
* Move Mppt logic to subclass

* Added Definitions for Shunts and restructering

* First integration of SmartShunt data into Web Interface

* Code cleanup

* VE.Direct: whitespace cleanup

* VE.Direct: manage HardwareSerial in unique_ptr

* VE.Direct: _efficiency is only needed by MPPT

* VE.Direct: keep as many members private as possible

* VE.Direct: use int8_t for pins (as before)

* VictronSmartShunt: _verboseLogging is not used

* VE.Direct: OR (off reason) is MPPT specific

it also applies to Phoenix inverters and Smart BuckBoost, but since
there is no support for those, the code is moved to the MPPT controller.

* Added Shunt alarms to liveview
Changed from double to int for several readings

* Update build.yml to allow manual builds

---------

Co-authored-by: Philipp Sandhaus <philipp.sandhaus@cewe.de>
Co-authored-by: Bernhard Kirchen <schlimmchen@posteo.net>
2023-09-22 17:24:57 +02:00
helgeerbe
b081845b95 Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-09-19 12:28:00 +02:00
Thomas Basler
35da310420 Initialize variables before first usage 2023-09-18 20:23:00 +02:00
helgeerbe
ed2a189a61 Merge branch 'helgeerbe/issue438' into development 2023-09-18 17:56:58 +02:00
helgeerbe
f2893220a5 fix: #438 2023-09-18 17:56:22 +02:00
helgeerbe
9d6b459dc6 merge of v23.9.13 2023-09-18 10:46:43 +02:00
Bernhard Kirchen
954a98dbc8 JK BMS: Support for MQTT (#432)
* JK BMS: avoid trailing whitespace in debug output

* JK BMS: publish data points through MQTT

* JK BMS: updateFrom: skip data points with equal value

this changes the interpretation of the timestamp in data containers that
are merely updated from other data containers: this is the oldest
timestamp known where the value was as recorded by the data point in its
respective container.

the data container constructed from an answer will -- naturally -- have
the timetamps of its data points set to the time they were constructed.

* JK BMS: only publish changed values to MQTT broker

all values are still published once every minute if the MQTT retain flag
is NOT set. otherwise, the constant values are only published once on
startup.
2023-09-15 10:06:30 +02:00
helgeerbe
f7bd4a40d8 revert Revert "Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development"
merge of v23.9.11 broke the system. As a workaround upgrade espressif32 from 6.3.2 to 6.4.0 is skipped. See #440
2023-09-14 13:45:23 +02:00
Thomas Basler
a974e217df Fix #1335: Only the first inverter was set to zero at midnight via mqtt 2023-09-13 18:46:23 +02:00
Bernhard Kirchen
24018a1432
JK BMS: Support for MQTT (#432)
* JK BMS: avoid trailing whitespace in debug output

* JK BMS: publish data points through MQTT

* JK BMS: updateFrom: skip data points with equal value

this changes the interpretation of the timestamp in data containers that
are merely updated from other data containers: this is the oldest
timestamp known where the value was as recorded by the data point in its
respective container.

the data container constructed from an answer will -- naturally -- have
the timetamps of its data points set to the time they were constructed.

* JK BMS: only publish changed values to MQTT broker

all values are still published once every minute if the MQTT retain flag
is NOT set. otherwise, the constant values are only published once on
startup.
2023-09-13 12:14:29 +02:00
helgeerbe
2eeb5f1d19 Revert "Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development"
This reverts commit eb1c2dbd8c, reversing
changes made to 0cb42a6424.

merge of v23.9.11 broke the system
2023-09-12 20:18:10 +02:00
helgeerbe
a7ea15cde9 add missing Arduino.h 2023-09-12 19:43:30 +02:00
helgeerbe
eb1c2dbd8c Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-09-12 19:27:32 +02:00
Thomas Basler
9ac6dd6e8d Feature: First very basic support to read the grid profile
The parser is still missing and requires community support to collect data.
2023-09-07 22:08:07 +02:00
Thomas Basler
ec9af886d5 Feature: Added option to set daily yield to zero at midnight 2023-09-05 20:27:52 +02:00
Thomas Basler
7d90937d0f Publish mqtt string stats values periodically if they are set to zero if unreachable 2023-09-04 18:20:51 +02:00
Bernhard Kirchen
68783b450f
Messages: thread-safety and dynamic memory (#418)
* thread-safety and dynamic memory for MessageOutput

* use dynamic memory to allow handling of arbitrary message lenghts.
* keep a message buffer for every task so no task ever mangles the
  message of another task.
* every complete line is written to the serial console and moved to
  a line buffer for sending them through the websocket.
* the websocket is always fed complete lines.
* make sure to feed only as many lines as possible to the websocket
  handler, so that no lines are dropped.
* lock all MessageOutput state against concurrent access.

* MessageOutput: respect HardwareSerial buffer size

the MessageOutput class buffers whole lines of output printed by any
task in order to avoid mangling of text. that means we hand over full
lines to the HardwareSerial instance, which might be too much in one
call to write(buffer, size). we now check the return value of
write(buffer, size) and call the function again with the part of the
message that could not yet be written by HardwareSerial.
2023-09-04 14:08:30 +02:00
Bernhard Kirchen
ba303da742
VE.Direct: Reset state machine on timeout, fix and extend logging (#416)
* VE.Direct: reset state machine on timeout

there will never be a large gap between two bytes of the same frame.
if such a large gap is observed, reset the state machine so it tries
to decode a new frame once more data arrives.

this is helpful in case of corrupted data that prevents the state
machine of transitioning to the final state even though the VE.Direct
data producer is done sending bytes that belong to the same frame.

* VE.Direct: print problems to MessageOutput

this includes the web console in particular, where many users have
access to while the serial console is not attached or monitored.

* VE.Direct: collect serial input into buffer and print

should help debug issues for users.

* VE.Direct: implement and use verbose logging switch
2023-09-04 14:07:48 +02:00
Martin
a7a38e74a1
Feature: add nice Icons for HA autoconfiguration (#413)
* add Icons for Battery and Victron device sensors in Home Assistant
  overriding the boring default icon for many sensors

Signed-off-by: Martin Dummer <martin.dummer@gmx.net>
2023-09-04 14:07:24 +02:00
Thomas Basler
abf95634db Replace platform dependent variable types by platform independent 2023-09-03 23:27:53 +02:00
Thomas Basler
6127fbe940 Feature: Added option to set runtime values to zero when inverter becames unreachable 2023-09-02 12:22:22 +02:00
Thomas Basler
b34b22c658 Fix: Workaround: Don't allow memory intensive web functions in parallel
Somehow the API has to be adjusted to reduce memory consumption. For now lets just prevent both methods to allocate memory at the same time.
2023-09-02 01:41:53 +02:00
Thomas Basler
2c41be106e Feature: Allow setting of the Reachable Threshold per inverter 2023-09-01 19:17:12 +02:00
Thomas Basler
c5f9f460cd Feature: Added config option to change MQTT CleanSession Flag 2023-09-01 18:03:30 +02:00
Bernhard Kirchen
f744629b0b
Support for Jikong JK BMS using serial connection (#319) 2023-08-31 16:21:32 +02:00
helgeerbe
d4afc5940a Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-08-29 09:24:25 +02:00
Bernhard Kirchen
96ee78156d
Fix DPL Mode 2 MQTT Status (#402)
* DPL MQTT handler: modernize

* there is no need to tokenize and check the topic of a received MQTT
  message if we only subscribe to a single topic. all messages will be
  for that topic. avoid testing the topic in the callback alltogether.
* use std::string and std::stoi over allocating and deleting a buffer
  and copying charactes around.
* use a switch statement to process the actual payload.
* break a long line.

* DPL: fix getMode() return value

getMode() returned a bool. probably its return type was not adjusted
when the third mode was introduced. this lead to mode 2 being cast to
true implicitly, which in turn was used to construct a String, such that
"1" was published as the DPL mode when in fact it was 2.

make the mode an enum class to avoid such problems in the future.

inline getMode() and setMode().

fix indention.
2023-08-28 13:20:56 +02:00
helgeerbe
ca308d0895 Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-08-28 13:12:07 +02:00
Thomas Basler
701c490654 Feature: Turn off Display before reboot
Thanks for the idea to @StefanOberhumer
This prevents always on Display if the device profile does not contain Display pins anymore after the reboot
2023-08-25 16:57:24 +02:00
Thomas Basler
c91bd42a77 Feature: Turn off LEDs before reboot
Thanks for the idea to @StefanOberhumer
This prevents always on LEDs if the device profile does not contain LEDs pins anymore after the reboot
2023-08-25 13:15:55 +02:00
Thomas Basler
77a90095d9 Move different restart calls into one method 2023-08-25 12:58:53 +02:00
Thomas Basler
6429d64062 Prometheus Endpoint: Simplify code by looping over fields instead of duplicated code 2023-08-22 13:00:52 +02:00
Bernhard Kirchen
7c7a15e016
VE.Direct: websocket and status API response size (#371)
the size allocated for the HTTP request response was too little, while
the size for the buffer of the websocket output was increased already.

add a new member variable and use it in both context, such that
increasing the buffer size to accomodate more space (for the JSON data
in particular) will benefit both contexts in the future.
2023-08-10 13:40:09 +02:00
helgeerbe
21bbed9b8e Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-08-09 12:37:33 +02:00
Bernhard Kirchen
e6eaa001e7
DPL: use testThreshold() in useFullSolarPassthrough() (#357) 2023-08-06 17:00:27 +02:00
Thomas Basler
9179b672f5 Use lock_guard to simplify code 2023-08-05 01:25:53 +02:00
Bernhard Kirchen
aff7924411
Inhibit solar passthrough while battery below stop threshold (#354)
* DPL: improve verbose logging

* shorten DPL log prefix
* canUseDirectSolarPower() was printed two times
* _batteryDischargeEnabled was printed two times
* convert boolean values to human-readable strings
* add units where possible
* split messages into block "before calculating new limit" and "after
  calculating new limit", as the latter cannot rely on _inverter being
  available.
* order messages such that variables whose value is derived from other
  variables are printed later than their dependencies.
* merge output into blocks (one instance near "Printout some stats")
* remove more redundant info (produced in functions outside loop())
* print target grid consumption

* DPL: inhibit solar passthrough while stop threshold reached

* DPL: implement and use isBelowStopThreshold()

we only want to inhibit solar passthrough if the SoC is *below* the stop
threshold, not if it is equal to the stop threshold. otherwise, when
discharging, we would discharge until the battery reached the stop
threshold, then we would also inhibit solar passthrough, until the
battery is charged to the SoC stop threshold plus one percent.
2023-08-04 12:35:37 +02:00
helgeerbe
5335ec1bde Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-08-04 12:21:16 +02:00
Thomas Basler
43cba67531 Fix: Virtual console scrambled output when the output came from different contexts 2023-08-03 22:16:29 +02:00
Thomas Basler
0bdee6ec99 Fix: Prevent access to nullptr object when reconnecting to mqtt
It could occour when saving the settings via the web ui
2023-08-03 18:46:28 +02:00
Bernhard Kirchen
81864b3420
execute MQTT client synchronously in main loop() (#350)
processing a published valued on a subscribed topic is currently running
in a task that is not the task executing the main loop(). that's because
the espMqttClient(Secure) was constructed without arguments, which
selects the constructor with two arguments priority and core, both of
which have default values. that constructor selects
espMqttClientTypes::UseInternalTask::YES, causing a task to be created
in which context the MQTT client loop is executed.

MQTT subscribers assume they are running in the same context as the main
loop(). most code assumes exactly that. as the scheduler is preemptive
and very little (none at all?) code is interlocked, we have to make sure
to meet the programmer's expectations.

this changeset calls the MQTT client loop in the context of the main
loop() and enforces the use of espMqttClientTypes::UseInternalTask::NO.
2023-08-01 09:20:04 +02:00
Bernhard Kirchen
6b425d96b0
PowerMeter fixes (#342)
* PowerMeter: gracefully handle non-float MQTT values

* PowerMeter: update _lastPowerMeterUpdate conservatively

update the timestampt only if the topic actually matched any
subscription and if the value could be parsed as a float.

* PowerMeter: unsubscribe before subscribing

* PowerMeter: organize subscriptions in a map

this allows for a slightly more elegant code and reduced amount of code
overall.

* PowerMeter: clean up header

* move private methods to private section of class declaration.
* remove unused member variable.
2023-07-31 14:16:06 +02:00
helgeerbe
43e836ac41 resolve merge conflict with upstream/master 2023-07-24 13:23:50 +02:00
helgeerbe
2440028d38 Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-07-24 13:16:15 +02:00
Martin Dummer
8bfa7e530c Feature: Admin AccessPoint Timeout now configurable
Make the administrative accesspoint timeout configurable. The default
value is 3 minutes, values from 0-99999 are possible, where 0 means
infinite (no timeout).

Signed-off-by: Martin Dummer <martin.dummer@gmx.net>
2023-07-22 18:14:07 +02:00
Thomas Basler
658a42db80 Apply code formatter without functional changes 2023-07-22 18:00:41 +02:00
Thomas Basler
a06a56a490 Harden config parser by defining right unsigned data type 2023-07-22 17:41:56 +02:00
Thomas Basler
736220c80d Reorder config struct components 2023-07-22 17:28:58 +02:00
Bernhard Kirchen
f0def2ae89
Selective verbosity (#318)
* DPL: implement verbose logging switch

* MQTT: implement verbose logging switch

* power meter: implement verbose logging switch

* Hoymiles lib: implement verbose logging switch

* cpp linting: "final" makes "virtual" and "override" redundant

... however, using only "final" is not as verbose.
2023-07-18 09:57:03 +02:00
Martin
c393e52185
Feature: add Home Assistant MQTT discovery for Pylontech battery (#314)
When OpenDTU has a Pylontech CAN Bus Battery connected and enabled, this
patch adds the discovery routine for Home Assistant

Signed-off-by: Martin Dummer <martin.dummer@gmx.net>
2023-07-17 09:50:58 +02:00
Bernhard Kirchen
cbc99d715f
DPL: increase backoff while inverter is kept shut down (#310)
if the new calculated power limit is below the minimum power limit
setting, the inverter is shut down. the shutdown() function is called
every time this condition is detected, which is also true if the
inverter is kept shut down for longer. that happens while the battery
is charging in particular (solar passthrough off). there are other
cases.

in such cases we still want to get into the DPL status "stable". to be
able to determine this stable state, we must know if the call to
shutdown did actually initiate a shutdown or if the inverter is already
shut down.

we then can forward this "changed" or "not changed" info up the call
chain, where the loop() will know that the system is actually stable.
2023-07-17 09:40:18 +02:00
helgeerbe
633ef88296 Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-07-12 13:45:19 +02:00
Bernhard Kirchen
f3297930b5
DPL: account for solar passthrough losses (#307)
* fix another fixable "passtrough" typo

the typo in the config's identifier is not changed to preserve
compatibility while not spending the effort to migrate the setting.

* webapp language: prefer SoC over SOC

* DPL: implement solar passthrough loss factor

in (full) solar passthrough mode, the inverter output power is coupled
to the charge controler output power. the inverter efficiency is already
accounted for. however, the battery might still be slowly discharged for
two reasons: (1) line losses are not accounted for and (2) the inverter
outputs a little bit more than permitted by the power limit.

this is undesirable since the battery is significantly drained if solar
passthrough is active for a longer period of time. also, when using full
solar passthrough and a battery communication interface, the SoC will
slowly degrade to a value below the threshold value for full solar
passthrough. this makes the system switch from charging the battery
(potentially rapidly) to discharging the battery slowly. this switch
might happen in rather fast succession. that's effectively
trickle-charging the battery.

instead, this new factor helps to account for line losses between the
solar charge controller and the inverter, such that the battery is
actually not involved in solar passthrough. the value can be increased
until it is observed that the battery is not discharging when solar
passthrough is active.
2023-07-12 13:20:37 +02:00
Thomas Basler
fe3d6588bc Feature: Turn off LED 1 if no inverters are enabled for polling
This means that e.g. at night, when polling at night is disabled, LED 1 will be turned off now.
2023-07-10 18:31:04 +02:00
Martin
cdf5c85510
fix: Home Assistant MQTT-Auto-Discovery with VE.Direct (#297)
In Home Assistant, when Home Assistant MQTT-Auto-Discovery is active,
almost all Sensors of the auto-discovered Victron device in Home
Assistant become "unavailable" after a short time - except those
Sensors with frequent changes like battery voltage or panel voltage.

This patch introduces regular mqtt updates for all VE.Direct sensors
when MQTT-Auto-Discovery is enabled.

Signed-off-by: Martin Dummer <martin.dummer@gmx.net>
2023-07-09 17:08:50 +02:00
Bernhard Kirchen
107182f948
DPL: check more requirements and fix backoff initialization (#290)
* DPL: wait for valid time information

we know that the Hoymiles library refuses to send any message to any
inverter until the system has valid time information. until then we can
do nothing, not even shutdown the inverter.

* DPL: wait for device info to be ready

a calculated power limit will always be limited to the reported
device's max power. that upper limit is only known after the first
DevInfoSimpleCommand succeeded. wait for that information to be
available.

* DPL: fix initial calculcation backoff

if the calculation backoff is initialized to zero, the backoff will be
doubled to zero until a new, different power limit was calculated for
the first time. this lead to the DPL recalculating a power limit
hundreds of times without a backoff after startup.
2023-07-04 12:05:10 +02:00
Bernhard Kirchen
e457ab73f9
Fix vedirect polling (#291)
* VE.Direct: remove polling interval

the polling interval was meant to limit the amount of MQTT updates.
however, that is already controlled by the global MQTT publish interval.
the removed interval was instead used to limit polling of the VE.Direct
UART for incoming data.

the Victron device sends data unsolicited. the VeDirectFrameHandler does
not implement any polling mechanism. no data is ever sent to the Victron
device.

what the removed polling interval did was cause a buffer overrun of the
HardwareSerial class, since the incoming data was not processed in time.
so every five seconds, we read a whole valid VE.Direct frame, plus some
old data, which was not a whole frame, leading to VE.Direct error
messages to pop up.

with the polling interval removed, no framing errors are reported, and
instead we gain new data from the charge controller approximately ever
two seconds -- for free.

* VE.Direct: change texts to correct VE.Direct capital letters

* VE.Direct: improve "UpdatesOnly" switch labels

especially since the publish interval setting is gone, the label makes
it hard to comprehend what the switch does. update the texts to better
explain what the switch is used for.

use the same text on the VE.Direct info view.

* VE.Direct: use StatusBadge on info view

there were custom badges to indicate the VE.Direct settings. replace
those by the common StatusBadge to make then look the same as the other
badged on the info views.
2023-07-04 12:04:38 +02:00
helgeerbe
006f63ed02 feature: add digest auth on power meter
Power Meter -> HTTP(S) + Jason configuration allows now basic and digest authentication (all Shelly Gen2 devices)
2023-07-04 11:54:46 +02:00
helgeerbe
1f39ed7b9b Merge branch 'pr/MalteSchm/288' into development 2023-07-02 14:28:51 +02:00
MalteSchm
e279ce08c4 Dynamic power control and more power control modes on the Huawei PSU 2023-07-01 12:37:55 +02:00
Bernhard Kirchen
9aeb1583b5 DPL: consider the system stable when reusing the old limit
a new status is needed to communicate that no update was sent to the
inverter because its power limit is still valid. in this case,
calculating a new power limit is delayed by an exponentially increasing
backoff. the maximum backoff time is ~1s, which is still plenty fast.

the backoff is actually necessary for another reason: at least
currently, a lot of debug messages are printed to the console. printing
all that information in every DPL loop() is too much.
2023-06-30 21:00:51 +02:00
Bernhard Kirchen
9bab740c43 DPL: replace _plState enum with a simple boolean switch 2023-06-30 21:00:51 +02:00
Bernhard Kirchen
b2d58af5e8 DPL: separate unconditional solar passthrough mode
the unconditional solar passthrough mode, configured using MQTT, works
differently than the normal mode of operation. it is also independent
from the power meter reading. if this mode is active, a shortcut is
taken to a function that implements the actions for this mode. this is
convenient since we don't have to consider special cases in the code
that handles normal mode of operation.
2023-06-30 21:00:51 +02:00
Bernhard Kirchen
71079fa0cc DPL: work on internal copy of pointer to inverter
the DPL already took care to shut down the inverter if anything fishy
was going on, mainly to make sure that the battery is not drained.
however, some cases were missed:

* if the configuration changed such that another inverter is now
  targeted, the one the DPL controlled previously was not shut down.
* if the configuration changed such that another inverter (different
  serial number) was configured at the same index, the previous one
  was not shut down.

this change corrects these problems by making the DPL keep a copy of the
shared_ptr to the inverter. the shared_ptr is only released once the DPL
shut the respective inverter down.
2023-06-30 20:04:39 +02:00
Bernhard Kirchen
2970e84193 DPL requirement: disabled inverter commands
if the inverter is not configured to be sent commands to, the DPL is
unable to control it, so the loop is aborted.
2023-06-30 20:04:39 +02:00
Bernhard Kirchen
18b1076660 DPL: improve responsiveness
this implementation checks all requirements for a new power limit to be
calculated, one after the other. if any requirement is not met, a
respective status is announced.

status messages are communicated on the (serial) console. these can also
be displayed easily on the web app in the future. the status texts
explain clearly what the DPL is currently doing, which aids
understanding how the DPL works. the status is only announced if it
changes, or after a fixed interval.

as each requirement is checked individually, the code readability is
improved as well. previously, all the respective conditions had to be
checked as well, but the statements were more complex.

the DPL loop is now executed with high frequency, i.e., it does not wait
for a fixed timespan to pass before checking requirements. it always
aborts on the first unmet requirement. this should improve responsiveness,
as the DPL checks all requirements more often.

the DPL now waits for all power commands and power limit updates to
complete. when that is the case, a settling time elapses. after the
settling phase, the DPL waits for a new update from the inverter and
from the power meter. now it can be assumed that the values are in sync.
it then makes sense to calculate a new power limit immediately, which
the DPL then does.
2023-06-30 20:04:39 +02:00
Bernhard Kirchen
0b0bcf1dfb fix typo: getLastRequestedPowe*w*rLimit() 2023-06-30 20:04:39 +02:00
Bernhard Kirchen
fd208cf6bb DPL: remove unused member variables 2023-06-30 20:03:21 +02:00
helgeerbe
6ffb5bb897 fix: undefined pin is shown as -1 instead of 255
change pin type for onBattery pins from uint8_t to int8_t.  Negativ pin values means not defined
2023-06-29 13:02:38 +02:00
Bernhard Kirchen
07bb0b03f7
DPL hysteresis fix and refactor of setNewPowerLimit() (#264) 2023-06-26 11:52:33 +02:00
Bernhard Kirchen
4d05035661
fix DPL not reading full solar passthrough voltage thresholds (#265)
the defaults for solar passthrough voltage thresholds shall be floats,
so the user can store float values to the config. otherwise, float
values can and will be stored, but when reading them, the defaults will
be applied as the defaults are of an incompatible type.
2023-06-22 21:33:38 +02:00
Bernhard Kirchen
016e30ec00
DPL: fix efficiency calculation (#270)
there is no need to assume and hardcode a fixed efficiency for the
Victron solar charger. the charger reports the voltage and current at
its battery terminal, which can be used to calculate the charger's
actual power output.

the fallback to 100% for the efficiency of the Hoymiles inverter, in
case it is not producing power, is too optimistic. this commit proposes
to use 96.7% as the efficiency for that case, which is the peak
efficiency for many (all?) Hoymiles inverters as per datasheet. that
value should be closer to the real efficiency that will be achieved once
the inverter is turned on.
2023-06-22 21:30:33 +02:00
helgeerbe
fd58ad2003 feat(add ability to do a polite power meter read): 2023-06-14 16:21:58 +02:00
helgeerbe
86ee7e1a64 perf(PowerMeter): query PowerMeter on demand
In addition to the cyclic query of the power meters, they will be queried on demand when total power is requested and last update is older than 1 second.
2023-06-14 11:25:54 +02:00
MalteSchm
e0a8da84d7 full solar passthrough 2023-06-09 13:09:58 +02:00
helgeerbe
8298a0c36f
Merge pull request #255 from madmartin:inverter_restart
Feature: add daily restart for the inverter
2023-06-05 10:10:14 +02:00
Martin Dummer
c727e21a49
Feature: add daily restart for the inverter
Add a configurable restart option for the inverter to set the "YieldDay"
values to zero.

Signed-off-by: Martin Dummer <martin.dummer@gmx.net>
2023-06-04 09:14:42 +02:00
MalteSchm
e7c8a89bd3 inital version of full solar passthrough
Webinterface change to set full solar passthrough values

Adding webapi and config changes to enable full solar passthrough over certain battery Soc

inital version of full solar passthrough in power limiter

Passthrough mode can be enabled via MQTT

translations

re-enable comment

remove unused variable
2023-06-02 12:49:24 +02:00
Thomas Basler
5a37948ca9 Fix: If no sunset/sunrise calculation is possible a wrong value is shown
This is catched now and a proper message is shown in the web UI. Also the mode is set to day.
2023-06-01 18:39:50 +02:00
Thomas Basler
24f063dd7b Fix: Prevent partly calculated total data in web ui and display
Leads to zeros where no zeros should be.
2023-05-30 22:10:27 +02:00
Thomas Basler
1c8bd8091b Feature: Allow reordering of the inverters in the live view
Reordering can be done in the inverter settings via drag&drop.
2023-05-29 20:17:07 +02:00
Thomas Basler
e7198073af Feature: Allow configuration of sunset type 2023-05-24 19:21:44 +02:00
Martin
52af52eb3a
Pylontech enhancement (#239) 2023-05-24 09:17:38 +02:00
helgeerbe
a3e7439181 fix(action): sort tags in chronological order 2023-05-24 09:13:04 +02:00
Thomas Basler
752362d2df Feature: Added localization setting to display
Its possible to change the language of the display
2023-05-23 18:25:12 +02:00
helgeerbe
47f81f2579 breaking change: Reduce maximum number of invertes to 5 to keep livedata working
livedata json is now calculated as 4096 * MaxInvertes
2023-05-23 10:15:37 +02:00
helgeerbe
b7ac70b1ca Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-05-23 09:19:57 +02:00
Thomas Basler
cd98941c5d Implement global data store to handle all invert total values
Use the new values in the LED, MQTT and Web interface.
2023-05-21 22:37:33 +02:00
MalteSchm
065c169b20
Set initial PL state in init() to avoid inverter shutdown on reboot... (#224) 2023-05-08 13:25:02 +02:00
MalteSchm
70060559da
Bring back the sun indicator (#195)
* Adding states to display in UI

* Adding states to display in UI
2023-04-27 19:10:12 +02:00
MalteSchm
6b437b5ea1
Inverter toggle fix (#196)
* updating the interface to calcPowerLimit to include both energy sources

* Fixing definition
2023-04-27 19:09:48 +02:00
helgeerbe
c337df605c Merge branch 'pr/MalteSchm/172' into development 2023-04-26 12:37:31 +02:00
helgeerbe
e91935ab38 Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-04-26 11:47:19 +02:00
helgeerbe
37b5edb010 Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-04-25 18:51:18 +02:00
Thomas Basler
98da2b64e2 Rename FLD_PRA to FLD_Q 2023-04-24 22:29:59 +02:00
Thomas Basler
26cbc496a7 Feature: Implemented MQTT publishing of total values
If one or more inverter is not reachable the flag is_valid changes to zero. Disabled inverters are ignored.
2023-04-24 18:51:30 +02:00
helgeerbe
40cee1f9ca Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-04-17 11:08:55 +02:00
Thomas Basler
371e405eed Added configuration of CMT modules frequency to webapp 2023-04-15 10:55:48 +02:00
Thomas Basler
996404ceed Introduce gpio2 for the CMT2300A module
This implements the sending interrupt instead of polling. On the other hand, gpio3 is made optional.
2023-04-15 10:55:48 +02:00
Thomas Basler
854fcdaeae Allow configuration of the TX PA Level of the CMT2300A module 2023-04-15 10:55:48 +02:00
Thomas Basler
dc91929d6e First rough implementation of HMT inverters 2023-04-15 10:55:47 +02:00
Thomas Basler
45882543b6 Allow dynamic pin mapping for CMT module 2023-04-15 10:55:47 +02:00
helgeerbe
1dc73f91ee Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-04-13 10:18:49 +02:00
MalteSchm
be7a43fbfb Removing un-necessary timestamp, commenting code and cleanups 2023-04-13 09:47:12 +02:00
MalteSchm
ee376827fd merging functionality from PL refactor 2023-04-13 09:47:07 +02:00
MalteSchm
9999fa28e8 refactor state machine
merging
2023-04-13 09:46:35 +02:00
MalteSchm
ee82c8c9b8 adding option to disable power limiter via mqtt
adding option to disable power limiter via mqtt - adding missing file
2023-04-13 09:44:48 +02:00
Martin Dummer
bea0a738c1
include/Configuration.h: rename MQTT_MAX_ROOT_CA_CERT_STRLEN
rename const MQTT_MAX_ROOT_CA_CERT_STRLEN to more generic name MQTT_MAX_CERT_STRLEN

Signed-off-by: Martin Dummer <martin.dummer@gmx.net>
2023-04-12 11:58:27 +02:00
Martin Dummer
d920726a76
src/WebApi_mqtt.cpp: rename function getRootCaCertInfo
rename function WebApiMqttClass::getRootCaCertInfo to more generic
name WebApiMqttClass::getTlsCertInfo

Signed-off-by: Martin Dummer <martin.dummer@gmx.net>
2023-04-12 08:47:24 +02:00
Martin Dummer
971ae6d1be
Feature: MQTT add TLS authentication
User asked for TLS client certificate based login from DTU to MQTT
server. This PR implements storage and use of x509 client certificate
and private key.

Signed-off-by: Martin Dummer <martin.dummer@gmx.net>
2023-04-12 08:33:10 +02:00
MalteSchm
f6d0b0997f typo 2023-04-11 18:57:57 +02:00
qubeck
00def1d8d1
Generic SML based power meters support (#146)
* add support for energy & power readings on SML based power meters, taking OBIS 16.7.1 for power (using mod. SML Parser lib. by olliiiver)

* switched SML read to use software serial

* made total power meter response controled by meter source to obtain either the sum of phase powers or explicit total power provided by meter

* made mqtt subscriptions to power meter topics meter source dependend

* simplified SML read loop and OBIS handler registration, + minor refactoring

* minor cleanup/style changes and optim. PowerMeter

* fixed build, add SOURCE_SML == 4

* removed optional usage of HW serial for SML power meter

* switched to usage of _powerMeter1Power for SML power reading to allign better with existing code

---------

Co-authored-by: helgeerbe <helge@erbehome.de>
2023-04-07 20:20:00 +02:00
berni2288
09fb0618b4
Merge branch 'MalteSchm-webinterface_summary_updates' into development 2023-04-05 22:27:17 +02:00
Thomas Basler
ede572f6e3 Status LED's: Implemented
They can be activated using device profiles.
2023-04-05 11:56:59 +02:00
Bernhard Kaszt
8ca664a8fe
Use AC power for limit calculation (= Support directly connected PV panels with Power Limiter) (#154)
* Power limiter: Use the actual AC power for limit calculation

instead of the last set limit.

In order support setups without battery connected (sources that don't exhaust the limit)
2023-04-05 10:30:03 +02:00
MalteSchm
459f9ffc2c merging branches 2023-04-04 21:43:24 +02:00
MalteSchm
abffc38c11 fixing typos 2023-04-04 21:30:53 +02:00
Thomas Basler
ae323cd26f Status LED's: Implemented
They can be activated using device profiles.
2023-04-04 18:53:23 +02:00
Bernhard Kaszt
e35254c8f2
New Power meter support: HTTP(S) + JSON (Shelly 3EM, Tasmota, Volkszähler etc.) (#153)
* Implement HTTP(s) + JSON type Power Meter support

---------

Co-authored-by: Bernhard Kaszt <berni@bcserv.eu>
2023-04-03 21:36:20 +02:00
MalteSchm
20bb7fc372
Show (Pylontech) battery infos in Live View
* adding data age to battery data

* Add battery enabled flag

* Webapi and websocket api for Battery

* Webinterface for battery

* fixed bug due to naming inconsistencies

* cleaned up rounding

* dist update

* change typename to uppercase

* reverting to original file
2023-04-02 20:58:28 +02:00
MalteSchm
6b85b8d4a2 Merge remote-tracking branch 'upstream/development' into battery_webinterface 2023-04-02 14:28:37 +02:00
MalteSchm
59c84bcb85 Webapi and websocket api for Battery 2023-04-02 13:00:46 +02:00
Bernhard Kaszt
4de043f3d4 Fix crash when AC charger is enabled but initialization fails 2023-04-02 10:46:07 +02:00
Bernhard Kaszt
c86c5133f0 Fix code style in Huawei files 2023-04-02 10:42:36 +02:00
MalteSchm
e514ef744b adding data age to battery data 2023-04-01 15:34:32 +02:00
MalteSchm
ece131995a linting errors 2023-03-29 19:04:41 +02:00
helgeerbe
b3c17c8ee8 Merge branch 'pr/MalteSchm/144' into development 2023-03-27 22:16:53 +02:00
MalteSchm
2aad13dc72 Changing SPI interface 2023-03-27 20:47:35 +02:00
MalteSchm
a4767827b4 merging master 2023-03-26 11:25:08 +02:00
MalteSchm
0b5c47cd2e Adding enable/disable option and pin to control a switch/relais to power the Huawei PSU 2023-03-26 11:00:37 +02:00
MalteSchm
8576034b77 Adding Huawei CAN interface, web-api, websocket and Mqtt extensions to access the data 2023-03-24 10:03:22 +01:00
helgeerbe
0832ef86e4 reboot after power meter settings 2023-03-23 19:10:29 +01:00
helgeerbe
5d5124dd5b fix last power meter update time 2023-03-22 14:53:36 +01:00
helgeerbe
41da6d489d add missing webapi init for powermeter 2023-03-22 11:34:55 +01:00
Adminius
05a5b2367b PowerMeter Class + SDM PowerMeter support 2023-03-21 23:46:54 +01:00
helgeerbe
06370baa0e Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-03-18 22:42:05 +01:00
helgeerbe
46ce6ad50f Implement battery drain strategies:
- empty when full
- empty at night
2023-03-16 17:48:22 +01:00
helgeerbe
32a96bbd06 change all watt related vars to
int32_t to avoid cast problems with negativ values.
2023-03-16 12:34:14 +01:00
helgeerbe
04c7e4fa01 fix cast error with unsigned int
which results in wrong power limit settings if values become < 0 due
 to power export to the grid.
2023-03-16 12:17:14 +01:00
Thomas Basler
2e33f5cd51 Display: Implement rotation setting and removed icons 2023-03-15 20:20:14 +01:00
Thomas Basler
c0b5049a74 Auto format: Reorder includes 2023-03-14 18:45:39 +01:00
helgeerbe
9214897245 for watt use uint32_t as std type to
avoid cast problems to uint16_t
2023-03-13 11:38:26 +01:00
MalteSchm
63c956af15 swap can library to better support newer ESPs 2023-03-12 17:27:41 +01:00
helgeerbe
01a2ffaed5 [Request] Show actual power limiter state in live view helgeerbe/OpenDTU-OnBattery#134 2023-03-10 16:29:00 +01:00
helgeerbe
43dc10b868 Merge branch 'inverter-settings' into development 2023-03-09 12:43:03 +01:00
helgeerbe
8df2c16cce ensure STATE_DISCOVER if PowerLimter is enabled 2023-03-09 10:22:08 +01:00
Markus Dobel
9eff5f228b feat: export panel settings (name, max power, offset) as prometheus metrics 2023-03-08 09:11:25 +01:00
helgeerbe
716fc867a1 powerLimiter with state machine 2023-03-07 21:04:19 +01:00
Bernhard Kaszt
06fbdf1f12 Add Pylontech battery to device pin manager 2023-03-05 19:55:56 +01:00
helgeerbe
4a51ae5038 victron charge power is integer 2023-03-01 10:23:37 +01:00
helgeerbe
26a8809121 stop inverter, if exporting power to grid 2023-02-28 13:09:10 +01:00
helgeerbe
4feaa1db98 Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-02-27 20:11:06 +01:00
Thomas Basler
f36a31723a Fix #636: Allow full SSID length of 32 characters 2023-02-27 14:32:55 +01:00
helgeerbe
3b62d5708a Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-02-27 07:42:46 +01:00
Thomas Basler
c67b3e3cbd Prometheus API: Set correct metrics type 2023-02-24 19:10:35 +01:00
helgeerbe
28b24d01ad implement UI for target power consumption 2023-02-24 16:13:32 +01:00
helgeerbe
56151b0d12 make inverter and channel selectable 2023-02-23 21:46:59 +01:00
Thomas Basler
759f8b7208 Log errors if too less memory for webapi is available 2023-02-23 21:10:00 +01:00
helgeerbe
a2473645a5 Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-02-23 12:01:34 +01:00
helgeerbe
9e1df83a87 remove map.h include 2023-02-21 22:12:15 +01:00
helgeerbe
1e7f6b8f0f first version 2023-02-21 22:06:47 +01:00
helgeerbe
f560f25302 initial merge of power_limiter * missing is inverter and channel setting in gui
* due to bug _webApiPrometheus.init is commented out
2023-02-20 15:56:02 +01:00
Thomas Basler
dc66a82695 Fix typo in configuration. Relates to #603
Also increase buffer size to read whole config
2023-02-19 22:33:35 +01:00
Thomas Basler
cd99ab8e42 Added settings to pause polling/sending commands in general and at night 2023-02-18 19:44:16 +01:00
Thomas Basler
b319c78dc1 Added methods to calculate and show sunrise and sunset times 2023-02-18 18:15:48 +01:00
Thomas Basler
19a1c0aa54 Added config parameters to set longitude and latitude 2023-02-18 16:53:28 +01:00
helgeerbe
6e0ae6d152 Extent JSON_BUFFER_SIZE 7000 2023-02-17 15:06:43 +01:00
helgeerbe
27f20a76f0 Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-02-16 12:35:18 +01:00
helgeerbe
a529c91254 Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-02-14 10:10:10 +01:00
Thomas Basler
8cbae76797 Implement offsets for YieldTotal (#549)
This allows to enter a offset in kWh in the inverter properties which will be applied to the read Yield Total value of the inverter. Using this can set your total production to zero if you e.g. are using a used device.
2023-02-13 20:25:00 +01:00
helgeerbe
997023e52f Add Hass sensors Battery voltage and Current 2023-02-07 16:51:30 +01:00
Thomas Basler
d4c838a16e BREAKING CHANGE: Prometheus API!
Added additional field to the prometheus api which identifies a channel by it's type. That means that e.g. channel 0  exists for type AC and DC.

This commit also introduces a additional field in the statistics byte assignment table. This field identifies whether a channel is on the AC or DC side. MQTT and WebAPI is still compatible with the previous design.
2023-02-06 19:51:10 +01:00
helgeerbe
37d3bb0eb0 vedirect hass autodiscovery:
load output state as binary sensor
2023-02-06 17:35:01 +01:00
helgeerbe
1c01e927f9 Add victron pins to device manager 2023-02-02 23:01:22 +01:00
helgeerbe
bec6c20531 Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2023-01-26 10:30:55 +01:00
Thomas Basler
2288a193e7 Extend pin mapping name to 63 characters 2023-01-20 18:28:35 +01:00
Thomas Basler
e89fd64439 Added WebAPI to setup display settings. Also reboot only if device profile was changed. 2023-01-20 18:28:34 +01:00
Thomas Basler
f7fb9a2bd6 Display: Add property to enable or disable the screensaver 2023-01-20 18:28:34 +01:00
Thomas Basler
d1483468c6 Rename Display properties and apply power safe immediatly 2023-01-20 18:28:33 +01:00
Thomas Basler
b96d87b933 Read display pinmapping from json file 2023-01-20 18:28:33 +01:00
Thomas Basler
bb3e12814d Move display pin assignment to main function 2023-01-20 18:28:32 +01:00
Thomas Basler
592dd73fca Implement _dispX as function local variable 2023-01-20 18:28:23 +01:00
helgeerbe
9a7a0d293e Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2023-01-20 14:54:04 +01:00
Thomas Basler
1d07574f8a Rename _lastPublish to _lastDisplayUpdate 2023-01-18 23:22:36 +01:00
Thomas Basler
e572e711a4 Code Style Changes
* Add License Identifier
* Move non public required includes to cpp
* Add curly brackets
2023-01-18 23:22:36 +01:00
dAjaY85
7074dd5757 Display init zum Zweiten
chango to full Buffer Mode, remove picture loop,
because it's not worked.
look: https://github.com/olikraus/u8glib/wiki/tpictureloop

snprintf + public vars
- dispPowerSafe => true: PowerSafe Mode on
- dispLogo => true: showing Logo upper right corner
- dispContrast => possible to adjust the Display Contrast

change in date time, buffer deleted

Display-Constructor changed, reset goes to front

Arrow and Logo only shown, when production is on

Refactor OLEDDisplayClass to DisplayGraphicClass
2023-01-18 23:22:36 +01:00
Thomas Basler
a4858b4598 Fix #520: Allow larger certificates 2023-01-17 19:05:02 +01:00
Thomas Basler
3d3feb3517 Allow Ethernet Pin Settings via json config 2023-01-16 22:26:35 +01:00
Thomas Basler
5f699f4927 Added Device Profiles
Allows the pin assignment during runtime.
Pin settings will be read from a json file called "pin_mapping.json"
2023-01-16 21:09:24 +01:00
Thomas Basler
20ae646561 webapp: Allow download of individual config files 2023-01-05 01:44:38 +01:00
helgeerbe
e49bbe0faf Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2022-12-27 14:17:24 +01:00
Thomas Basler
5bc264f4d2 Introduce numeric error codes in power webapi 2022-12-24 00:01:55 +01:00
Thomas Basler
03ed626da6 Introduce numeric error codes in security webapi 2022-12-24 00:01:55 +01:00
Thomas Basler
6ad7e971b4 Introduce numeric error codes in ntp webapi 2022-12-24 00:01:55 +01:00
Thomas Basler
3e8c7a4c10 Introduce numeric error codes in network webapi 2022-12-24 00:01:54 +01:00
Thomas Basler
8e9680f394 Introduce numeric error codes in mqtt webapi 2022-12-24 00:01:54 +01:00
Thomas Basler
af93e5d77e Introduce numeric error codes in maintenance webapi 2022-12-24 00:01:54 +01:00
Thomas Basler
9fd044f74f Introduce numeric error codes in limit webapi 2022-12-24 00:01:54 +01:00
Thomas Basler
4dc50777ef Introduce numeric error codes in inverter webapi 2022-12-24 00:01:54 +01:00
Thomas Basler
98b0a23ea0 Introduce numeric error codes in config webapi 2022-12-24 00:01:54 +01:00
Thomas Basler
3b5ff1691e Introduce numeric error codes in dtu webapi 2022-12-24 00:01:54 +01:00
Thomas Basler
8f5d394f3a Added websocket for debug output 2022-12-19 21:38:39 +01:00
Thomas Basler
cd5d5edd5f Implemented class to send debug output to uart as well as to websocket 2022-12-19 21:38:39 +01:00
Thomas Basler
5feefed14e Added missing copyright information 2022-12-14 22:37:37 +01:00
Thomas Basler
54d94af487 Cleanup includes 2022-12-14 22:13:03 +01:00
Thomas Basler
91f79fea19 Move publishHass method to MqttHandleHassClass 2022-12-14 21:08:35 +01:00
Thomas Basler
113caf510f Introduce generic mqtt publish method
Allows publish of mqtt topics from other modules
2022-12-14 20:58:57 +01:00
Thomas Basler
5dd4d5b452 Introduce MqttSubscribeParser and moved inverter specific subscribes to MqttHandleInverterClass
This allows individual callback functions for each subscribed topic. Allows easier implementation of further mqtt functions
2022-12-14 20:42:23 +01:00
Thomas Basler
aab72fd0d8 Move mqtt dtu topic publishing to separate class 2022-12-14 19:32:24 +01:00
Thomas Basler
723a2c6dbe Rename MqttPublishing to MqttHandleInverter 2022-12-14 19:13:34 +01:00
Thomas Basler
5dde17c56b Renamed MqttHassPublishing to MqttHandleHass 2022-12-14 19:07:11 +01:00
helgeerbe
2109520bde Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2022-11-26 16:31:16 +01:00
Thomas Basler
510f0c59f9 Implement readonly security for API endpoints 2022-11-22 23:40:19 +01:00