Commit Graph

582 Commits

Author SHA1 Message Date
Thomas Basler
d5a24906fa Merge branch 'pr1920' into dev 2024-05-02 20:59:26 +02:00
Thomas Basler
f8cc171e4a Fix: Return 404 (and nothing else) if file not found 2024-04-24 22:15:25 +02:00
Stefan Oberhumer
97800434c4 Prevent compiling the whole project on each commit.
Putting the git information into a generated sourcefile prevents
recompiling the whole project after each commit.
2024-04-18 09:02:57 +02:00
Thomas Basler
bf49410f6d Merge branch 'pr1909' into dev 2024-04-12 17:05:51 +02:00
Bernhard Kirchen
153293e1c7 remove remaining usage of F() macro 2024-04-12 15:28:26 +02:00
Thomas Basler
ea28903761 Move parsing of serial from web request to separate method 2024-04-05 19:14:56 +02:00
Thomas Basler
980e847ccb Feature: Check for out of memory situations when sending json responses
Also shows a nice message in the frontend if an internal error occours
2024-04-05 19:14:56 +02:00
Thomas Basler
2e3125fe8d Feature: Migrated ArduinoJson 6 to 7 2024-04-05 19:14:56 +02:00
Thomas Basler
b55ca53d1d Fix: Setting DTU options was only possible once without reboot
Fix #1884
2024-04-03 18:35:27 +02:00
Thomas Basler
8add226a7c Save flash: Move WebApi json parsing to separate method to prevent a lot of redundant code 2024-04-01 13:52:09 +02:00
Thomas Basler
6f3b8fb8e1 Fix: Change default NTP server
Fixes #1877
2024-03-31 12:27:27 +02:00
Thomas Basler
33bf2117c6 Fix: Set all settings to default when deleting an inverters
Previously some old settings from previous inverters could have been shown in a new inverter
2024-03-13 18:47:28 +01:00
Thomas Basler
f995287a6e Feature: Add support for HERF inverters 2024-03-06 21:57:18 +01:00
Thomas Basler
50abcd1061 Fix: Prevent hiding text on display if it's too long
Fixes: #1797
2024-03-01 19:30:24 +01:00
Thomas Basler
d26333dd76 Apply automatic code formatting 2024-02-10 23:37:44 +01:00
Thomas Basler
1d2055cc89 Merge branch 'pr1732' into dev 2024-02-10 23:37:09 +01:00
Thomas Basler
1973cb986c Merge branch 'pr1731' into dev 2024-02-10 23:37:03 +01:00
Thomas Basler
d635a9babd Merge branch 'pr1729' into dev 2024-02-10 23:36:47 +01:00
Bernhard Kirchen
6036d8efea implement oscillating screensaver
this implementation avoids the display content jumping the full
screensaver offset from right to left when the modulo operator
wraps. this change makes the display content walk from right to
left as it did walk from left to right.
2024-02-10 18:41:47 +01:00
Bernhard Kirchen
5f51c80022 Fix: make text of total production fit displays
in case the total production is larger than 1 MWh, i.e., 1000 kWh, the
text on the respective line becomes too large such that it reaches out
of the display when the screensaver is enabled.

this happens on the small and large displays.

this change switches the number format to a float without decimal places
if the total production is larger or equal to 1000 kWh. this saves a dot
and a digit, making the text short enough to fit the display even when
the screensaver moved the display contents as far to the right as it
does.
2024-02-10 17:38:32 +01:00
Bernhard Kirchen
25a66a1722 make efficient use of available display area
fix calculation of the text baselines, using getAscent() in favor of
getMaxCharHeight(), which includes ascent and descent. this moves the
first text up and allows to insert margin between the lines until the
display area is fully utilized.

on large displays, if the small diagram is selected, keep the first line
rather low to avoid collision with the diagram y-axis label. in this mode,
there is still more space between the text lines as before, allowing for
improved readability.
2024-02-10 13:33:51 +01:00
Thomas Basler
7e2064e264 Feature: Added support for boards with 16MB flash and PSRAM 2024-02-02 20:33:42 +01:00
Thomas Basler
1b637f0870 BREAKING CHANGE: Web API Endpoint /api/livedata/status and /api/prometheus/metrics
Yield total and Yield day where moved from the AC section to the INV section
2024-01-30 22:29:25 +01:00
Thomas Basler
e1564780d6 BREAKING CHANGE: Web API Endpoint /api/livedata/status and /api/prometheus/metrics
Power DC was moved from the AC section to the INV section
2024-01-30 22:29:25 +01:00
Thomas Basler
c27ecc3620 BREAKING CHANGE: Web API Endpoint /api/livedata/status
To reduce the heap usage it is necessary to send the inverters one by one instead of a huge response. A simple call to `/api/livedata/status` returns just some very general information. If detailed inverter information are required the inverter serial number has to appended `?inv=<serial number>`.
The websocket also returns only one inverter at a time. It as to be assembled at client side.
2024-01-30 22:29:25 +01:00
Thomas Basler
557c5d645e Remove all files but the pin_mapping.json from filesystem on factory reset
This allows to create more user defined files and get them deleted on factory reset.
2024-01-30 22:29:12 +01:00
Thomas Basler
48a722f826 Merge branch 'pr1642' into dev 2024-01-30 20:47:45 +01:00
Thomas Basler
a848275bb9 Merge branch 'pr1706' into dev 2024-01-30 19:34:19 +01:00
Sabouflage
5d7512e026 fix(mqtt): setting MQTT LWT online message for frontend 2024-01-30 19:03:23 +01:00
Sabouflage
dfed23261a fix(mqtt): MQTTs LWT QoS config used also for TLS connections 2024-01-30 19:02:57 +01:00
Stefan Oberhumer
e752c433af Use http header ETag caching for all static content.
Using the md5sum as ETag http header value should enable caching on all static http content.
2024-01-30 00:35:23 +01:00
Thomas Basler
2716f4c5df Removed not required pointer to AsyncServer instance 2024-01-27 01:09:55 +01:00
Thomas Basler
f0061b976d Merge branch 'pr1676' into dev 2024-01-26 16:48:15 +01:00
Thomas Basler
4e669d8932 Feature: Add support for ST7567 GM12864I-59N Display 2024-01-26 16:05:56 +01:00
Stefan Oberhumer
7aece2e143 Call SunPosition.isDayPeriod() once 2024-01-23 09:42:13 +01:00
Thomas Basler
4f2fbaaf2a Remove unused function parameter 2024-01-20 23:12:59 +01:00
Thomas Basler
16fbad92ac simplify calculations in WebApi_ws_Live 2024-01-20 11:38:52 +01:00
Thomas Basler
7bc1a17fac Move task initialization from init method to constructor
This saves flash
2024-01-20 11:24:57 +01:00
Thomas Basler
251d197fb6 Migrate WebApi loop() methods to scheduler tasks 2024-01-20 02:00:22 +01:00
Thomas Basler
e66060e769 Move the conversation from time_t to String into DevInfoParser 2024-01-20 01:09:42 +01:00
Thomas Basler
dcc157261e Don't perform redundant conversions 2024-01-20 00:32:13 +01:00
Thomas Basler
c20caf8097 Feature: Support HMS/HMT inverters in different countries with different frequency bands
Thanks to @Fribur, @homeautomation2022 and @stefan123t
2024-01-14 16:37:34 +01:00
Thomas Basler
2c92750100 webapp: Remove hard coded min/max frequencies for CMT module 2024-01-13 12:51:20 +01:00
Thomas Basler
ee78698e37 Migrate all frequency calculations to Hz
Previously the code contains calculations  using a mixture  of kHz and Hz.

Thanks to @Fribur
2024-01-13 12:51:20 +01:00
Thomas Basler
638f52a8da Feature: Add current limit to prometheus output
Fixes #1617
2024-01-13 11:33:58 +01:00
Thomas Basler
f013698471 Feature: Added fullscreen diagram to display 2024-01-13 11:31:12 +01:00
Thomas Basler
637d4f06a3 Feature: Added option to disable the diagram at the display 2024-01-08 14:19:26 +01:00
Bernhard Kirchen
2608080708 Feature: add heap details to system info and prometheus (#595)
this change adds the values of ESP.gteMaxAllocHeap() and
ESP.getMinFreeHead() to the prometheus metrics and the system
information object. the web UI uses these values to diplay the size of
the largest free contiguous block, calculate a rough estimate for the
level of fragmentation, and the maximum usage of heap memory since boot
in absolute and relative amounts.
2024-01-06 20:12:35 +01:00
Thomas Basler
3c37b61f44 Use auto keyword and references more often 2024-01-04 15:38:56 +01:00
Thomas Basler
b0b9764a23 Use Utils::checkJsonAlloc in ConfigurationClass 2024-01-04 14:47:21 +01:00
Thomas Basler
ef9f0040e8 Better handling of out of memory situations in live data websocket 2024-01-04 14:47:21 +01:00
Thomas Basler
ca18d2c841 Prevent empty HASS auto discovery topics if memory allocation fails 2024-01-04 14:09:58 +01:00
Thomas Basler
4053e31a5e Prevent config corruption by checking whether memory allocation was successfull. 2024-01-04 13:42:39 +01:00
Thomas Basler
c1fc907ecb Fix: Access Point not working after firmware update
Fixes #1613
2024-01-03 22:04:50 +01:00
Thomas Basler
cbbe053cd5 Fix: Optimize network connection handling
This should provide a more reliable connection to several AP types. See #576
2024-01-03 01:17:39 +01:00
Thomas Basler
aa8068370e Feature: Add support for SSD1309 2.4" Display 2023-12-30 12:42:42 +01:00
Thomas Basler
34983471de Simplfy diagram drawing code 2023-12-28 00:10:40 +01:00
Thomas Basler
06b8fb65a1 Move the diagram in Y direction if screen saver mode is turned on 2023-12-24 15:08:10 +01:00
Thomas Basler
2259b1b525 Add const keyword to variable 2023-12-24 14:35:29 +01:00
Stefan Oberhumer
ac427523b5 Feature: Add screensavermode also to diagram drawing. 2023-12-24 12:24:10 +01:00
Stefan Oberhumer
733a566172 NFC: Use std::size() instead of define. 2023-12-24 12:13:57 +01:00
Stefan Oberhumer
c1f0b9ea6f http response header tag 'ETag' needs quotes.
As per RFC7232 ( https://www.rfc-editor.org/rfc/rfc7232#section-2.3 ) and
MDN docs ( https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag#directives )
the value of the ETag in the http header response has to be between quotes.
2023-12-23 19:00:44 +01:00
Thomas Basler
0ddc7fd28d Feature: Added diagram to display
This is based on the idea of @Henrik-Ingenieur and was discussed in #1504
2023-12-19 17:26:24 +01:00
Thomas Basler
3b923885de Fix #1579: Static IP in Ethernet mode did not work correctly 2023-12-19 11:30:33 +01:00
Thomas Basler
84248ec9b6 Feature: Add DTU to Home Assistant Auto Discovery
This is based on PR 1365 from @CFenner with several fixes and optimizations
2023-12-17 14:40:04 +01:00
Thomas Basler
b4ead9d6ec Feature: Allow setting of an inverter limit of 0% and 0W
Thanks to @madmartin in #1270
2023-12-13 22:15:49 +01:00
Thomas Basler
4f7597eaa1 Adjust member variable names in NetworkSettings 2023-12-12 23:55:03 +01:00
Thomas Basler
66530638de Adjust member variable names in MqttSettings 2023-12-12 23:54:58 +01:00
Thomas Basler
e95afbf2cc Use references instead of pointers whenver possible 2023-12-12 13:26:07 +01:00
Thomas Basler
8fb43fedf8 Add const keyword to methods 2023-12-12 01:30:40 +01:00
Thomas Basler
d6494fa791 Add const keyword to method parameters 2023-12-12 00:21:14 +01:00
Thomas Basler
5e45006831 Replace NULL by nullptr 2023-12-11 20:23:45 +01:00
Thomas Basler
47e905bcfc Add const statement to several variables 2023-12-11 19:54:57 +01:00
Thomas Basler
efe0b6b383 Remove not required casts 2023-12-11 18:44:02 +01:00
Thomas Basler
06651f365a Feature: First version of GridProfile Parser which shows all values contained in the profile. 2023-12-11 14:58:17 +01:00
Thomas Basler
00bc631e87 Feature: Added basic Grid Profile parser which shows the used profile and version
Other values are still outstanding.
2023-12-09 11:12:37 +01:00
Thomas Basler
b937532505 Remove not required AsyncEventSource 2023-12-07 15:21:24 +01:00
Thomas Basler
8b5d406a4f Introduce several const statements 2023-12-07 15:19:04 +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
3b6e9343d4 Adjust device web api endpoint for dynamic led count 2023-11-25 12:45:18 +01:00
Thomas Basler
f8f79c816a Split LedSingle into multiple tasks 2023-11-23 22:35:05 +01:00
Thomas Basler
0db5b2eb9a Calculate SunPosition only every 5 seconds 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
dff6da9a5f Feature: High resolution Icon and PWA (Progressive Web App) functionality
Fix: #1289
2023-11-23 22:32:01 +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
7538b4363c Made resetreason methods static 2023-11-19 17:00:26 +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
d3f95000e2 Optimize Sun data calculation 2023-11-18 22:34:55 +01:00
Thomas Basler
6f685a4ab5 Fix: Day period is only calculated once 2023-11-16 18:03:25 +01:00
Thomas Basler
71d1b3b846 BREAKING CHANGE: Home Assistant Auto Discovery to new naming scheme
Please Upgrade to HASS 2023.8 or greater.
Thanks to @LennartF22 for the first implementation
2023-11-07 19:37:28 +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
Thomas Basler
a068eb2586 Remove duplicated code 2023-10-30 20:42:56 +01:00
Thomas Basler
aba57e687a Set dnsServerStatus first to prevent running 2023-10-30 20:25:39 +01:00
Thomas Basler
11d7b78d80 Apply automatic code formatting 2023-10-11 14:19:20 +02:00
Thomas Basler
97d481fa65 Merge branch 'pr1408' into dev 2023-10-11 14:16:23 +02:00
Thomas Basler
c25e93eb09 Merge branch 'pr1406' into dev 2023-10-11 13:40:05 +02:00
Thomas Basler
f1a8c2ea82 Feature: Added additional event log descriptions and implemented i18n 2023-10-11 13:22:42 +02:00
Stefan Oberhumer
be88da7b26 NFC: Call PinMapping.get() not every iteration. 2023-10-06 11:44:37 +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
Thomas Basler
f8cba5721e Fix: Deny passwordless access to prometheus API if readonly access is disabled
Fix #1358
2023-09-19 18:59:20 +02:00
Thomas Basler
1cf41426de Replace char array by String buffer 2023-09-16 02:21:25 +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
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
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
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
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
4f85d5286d Simplify debug output 2023-09-02 02:14:08 +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
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
e2594ac843 Fix: Calculate the json buffer for the inverter list based on INV_MAX_COUNT 2023-08-22 17:05:46 +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
Thomas Basler
4bf9083b23 Prometheus Endpoint: Publish only relevant amount of digits
Implemented method to return the correctly formatted field value as string
2023-08-22 11:45:14 +02:00
Thomas Basler
9179b672f5 Use lock_guard to simplify code 2023-08-05 01:25:53 +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
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
a68c553d27 Code formatting without functional changes 2023-07-22 18:07:03 +02:00
Thomas Basler
658a42db80 Apply code formatter without functional changes 2023-07-22 18:00:41 +02:00
Thomas Basler
bf4dc56cb8 Fix: Reboot loop if negative display pins and type where provided
Fix #1163
2023-07-21 19:02:18 +02:00
Thomas Basler
9dbeec3a31 Fix: Set WiFi setScanMethod and setSortMethod also on first connect 2023-07-20 23:44:09 +02:00
Thomas Basler
b8c75b02a0 Merge branch 'pr1003' into dev 2023-07-10 19:11:54 +02:00
Stephan
1871a9a692 use FSPI for esp32-c3 and revise device profiles 2023-07-10 19:04:13 +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
Thomas Basler
93057fc3dc Feature: Added touch icon for iOS and Android
Implements #1060
2023-06-21 22:44:18 +02:00
Thomas Basler
e8fee49dc8 Allow the non-existence of the HOYMILES_PIN_ defines 2023-06-21 19:59:35 +02:00
Thomas Basler
30fbd98274 Fix: Reboot loop occoured when no rf module was configured 2023-06-21 19:56:14 +02:00
Dominic Michel
3562e85b5e Change metric type back to gauge 2023-06-13 20:59:24 +02:00