Commit Graph

24 Commits

Author SHA1 Message Date
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
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
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
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
Bernhard Kirchen
9995c1172e
VE.Direct live view enhancements (#269)
* add calculated values to VE.Direct data

solar current, battery output power, and the charger's efficiency can be
calculated from the values reported by the charger. the efficiency must
be taken with a grain of salt. it seems that the solar power value and
the battery output voltage/current are not always in sync. for that
reason a moving average is used to smooth out the calculated efficiency
value.

* show calculated VE.Direct values in web live view

order the values and translations similarly for the input and output,
starting with power at the top, then voltage, then current as the last
of these three.

* VE.Direct live view: use 'd' as unit for days

'd' is the SI unit symbol for days and does not need translation, which
is desirable as units are not translated throughout the project.

* refactor VE.Direct live view

* move Dynamic Power Limiter data into its own type.
* split VE.Direct data into three types: "device", "input", and
  "output". hence all input and output values are now ValueObject, which
  allows to iterate over them using a loop without typing issues.
* generate the tables with input and output values using a loop, rather
  than defining each row individually.
* localize numbers using $n (vue method), which fixes switching the
  number format (dot vs. comma) when switching the language.
* use no decimal point for power values (they are integers), three
  decimal points for kWh values (charger only reports two decimal
  places, but three are easier to read since the unit is *kilo* Wh), one
  decimal point for the efficiency, and two for voltage and current.
* update language tokens to avoid mapping JSON keys to language keys
  (use the JSON keys to access the language tokens).
* re-structure language tokes so the brief keys took over from
  VeDirectFrameHandler always make sense (nest into "input" and
  "output").
* order values similarly from top to bottom: power, then voltage, then
  current. this is following the order of the inverters' details.
* group values by type/unit (yield and max. power) and order them
  "newest" to "oldest" from top to bottom.
* increase the DynamicJsonDocument as it was too small to hold the newly
  added data.

* update webapp_dist to include VE.Direct live view refactoring
2023-06-22 21:32:20 +02:00
helgeerbe
8cc548d13e add pid 0XA110 SmartSolar MPPT RS 450|100 2023-04-17 22:33:11 +02:00
helgeerbe
b8e06bf824 ve.diect with hex asnync messages
ignore async hex messeage on older devices
2023-04-17 22:18:20 +02:00
MalteSchm
06f6a4da8b fixing mppt string for SmartSolar 150/48 2023-04-11 19:23:49 +02:00
helgeerbe
1e7f6b8f0f first version 2023-02-21 22:06:47 +01:00
helgeerbe
dc44cc8e1f create VeDirect.isDataValid() 2023-02-16 12:17:47 +01:00
helgeerbe
1c01e927f9 Add victron pins to device manager 2023-02-02 23:01:22 +01:00
helgeerbe
d5740e4851 clear tmp ve.direct buffer on checksum error 2022-10-17 14:58:33 +02:00
helgeerbe
ba3183e10b Clear map for recieved key, value pairs 2022-10-04 11:34:30 +02:00
helgeerbe
6587282ac2 Fix typo in victron error message 2022-09-30 10:40:41 +02:00
helgeerbe
48e5b567cb frame handler with string and map 2022-08-20 17:06:56 +02:00
helgeerbe
7140574c37 sk 2022-08-19 15:53:18 +02:00
helgeerbe
b8ffa37e97 end poll latest at 500ms 2022-08-17 20:25:46 +02:00
helgeerbe
17abb57ed6 Stop polling after one successful frame read 2022-08-17 18:39:22 +02:00
helgeerbe
0d08c6a136 Check poll intervall 2022-08-17 13:40:38 +02:00
helgeerbe
25094ae5b6 last update is now set after poll full frame 2022-08-17 12:15:12 +02:00
helgeerbe
d9bf0ab2e9 ve.direct:
- add poll rate
- add data_age and age_critical to rest api
2022-08-16 16:26:08 +02:00
helgeerbe
72c0e8579a ve.direct rest api 2022-08-16 14:02:19 +02:00
helgeerbe
2ff8f84387 loop für ve.direct 2022-08-15 10:56:37 +02:00
helgeerbe
c7c1506e42 First version 2022-08-11 17:26:00 +02:00