Commit Graph

1879 Commits

Author SHA1 Message Date
helgeerbe
f2893220a5 fix: #438 2023-09-18 17:56:22 +02:00
helgeerbe
2f9539e4b3 print out debug messages 2023-09-15 09:57:25 +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
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
Bernhard Kirchen
88a5117007
VE.Direct: do not use debug buffer at all if verbose logging disabled (#437)
this avoids the debug buffer being overrun if verbose logging is
disabled in particular. that would happen because the buffer would
only be reset if verbose logging was enabled but filled in any case.
2023-09-13 12:13:56 +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
MalteSchm
0cb42a6424
Reworked wifiClient handling in Power Meter httpRequest and smaller update to Power Meter updateValue method (#430) 2023-09-12 19:14:55 +02:00
Bernhard Kirchen
d984912d7c
Vedirect Cleanups (#417)
* VE.Direct: remove unused #defines

* VE.Direct: remove unused mStop member variable

* VE.Direct: whitespace cleanups

remove trailing whitespace and fix mixed indentation.
2023-09-12 19:13:28 +02:00
Thomas Basler
a0f9d22395 webapp: add app.js.gz 2023-09-11 20:05:12 +02:00
Thomas Basler
555b6c6750 Fix: HASS exp_aft should be based on reachable threshold and poll interval 2023-09-11 19:53:05 +02:00
Thomas Basler
55e98bc068 webapp: Update dependencies 2023-09-11 18:24:23 +02:00
Thomas Basler
3a3adb4723 Completly ignore a disabled (polling + command) inverter.
This leads to higher update rates on still enabled inverters.
2023-09-10 11:49:41 +02:00
Thomas Basler
8023b6620a Fix: Ignore incomplete SystemConfigPara packages
Some inverters seem to transmit too less and incomplete data. These packages will be ignored now.
2023-09-07 23:10:01 +02:00
Thomas Basler
0260af9ada Hoymiles Lib: Move semaphore handing into parser base class 2023-09-07 22:08:07 +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
1acefd8b8c Fix: Do not resend fetch limit request if the last one failed
Due to side effects it is possible that the inverter receives the request but the DTU does not receive the answer. In this case the DTU would resend the request but the inverter would generate a event log entry (DTU command failed) because it received the message twice.
2023-09-05 22:09:16 +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
23dd248073 webapp: Update dependencies 2023-09-04 19:57:23 +02:00
Thomas Basler
c46f85db9c webapp: Use max field to determine whether to show a string or not 2023-09-04 19:54:07 +02:00
Thomas Basler
1df8285833 Feature: Add configured max irradiation to live data api 2023-09-04 19:53:33 +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
helgeerbe
3df47d1fee add webapp 2023-09-04 14:15:41 +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
55afa81cf1 Convert from FreeRTOS Semaphore to std::mutex 2023-09-02 16:46:23 +02:00
Thomas Basler
986d67a3d0 Fix: Better reconnect handling in Live View if invalid data where received 2023-09-02 12:22:55 +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
4f85d5286d Simplify debug output 2023-09-02 02:14:08 +02:00
Thomas Basler
9dec05def8 Fix: Check if valid data was received from websocket before assigning it
Otherwise it can lead to exceptions in inverterData method
2023-09-02 01:43:20 +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
Thomas Basler
b95236c170 Feature: webapp: Move inverter settings into different tabs 2023-09-01 00:20:56 +02:00
Thomas Basler
72e3001d43 webapp: Update dependencies 2023-09-01 00:08:56 +02:00
Thomas Basler
094fadb2ee Update espressif32 from 6.3.2 to 6.4.0 2023-09-01 00:02:47 +02:00
Thomas Basler
34b3dad252 Upgrade espMqttClient from 1.4.4 to 1.4.5 2023-08-31 23:55:48 +02:00
helgeerbe
8c36532cea add webapp 2023-08-31 16:23:06 +02:00
Bernhard Kirchen
f744629b0b
Support for Jikong JK BMS using serial connection (#319) 2023-08-31 16:21:32 +02:00
helgeerbe
2ba7ea2744 add filter for build action
- run build action only on master and development branch
- ignore v* tags from tbnobody
2023-08-30 09:54:30 +02:00
Bernhard Kirchen
929b477275
vite config: also proxy vedirect- and batterylivedata (#408) 2023-08-29 09:27:22 +02:00
helgeerbe
d4afc5940a Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2023-08-29 09:24:25 +02:00
Thomas Basler
3f1b6be857 Merge branch 'pr1271' into dev 2023-08-28 18:40:28 +02:00
Thomas Basler
8bf6935693 webapp: Update dependencies 2023-08-28 18:39:30 +02:00
Martin
88744bfa38
Fixes for HA autoconfig issues 378 379 (#394)
* fix: homeassistant autodiscovery topics

homeassistant autodiscovery topics contain not allowed characters, which
are now fixed.
Sidenote: when autodiscovery messages were retained, the badly formatted messages
must be removed from the mqtt server manually. Otherwise the error
messages in homeassistant will persist.

Closes: https://github.com/helgeerbe/OpenDTU-OnBattery/issues/378
Signed-off-by: Martin Dummer <martin.dummer@gmx.net>

* Fix: some homeassistant autoconf messages are wrong

Misc fixes for HA autoconfiguration:
* Entity sensor.panel_yield_today now uses state class "total"
* Entity sensor.panel_yield_yesterday now uses state class "total"
* Entity sensor.mppt_day_sequence_number_0364 now shows correct value
* sensor.panel_power duplicate removed

Closes: https://github.com/helgeerbe/OpenDTU-OnBattery/issues/379
Signed-off-by: Martin Dummer <martin.dummer@gmx.net>

---------

Signed-off-by: Martin Dummer <martin.dummer@gmx.net>
2023-08-28 13:21:20 +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