Publish EIC event-code and protection sensors for seplos_bms_v3_ble#235
Merged
Conversation
c48a989 to
b156370
Compare
6e300dd to
88c46e7
Compare
decode_eic_data_ only published problem_code/problem_text. Publish the remaining EIC entities (already defined in the schema): the system state, voltage, temperature and current event codes, the voltage, temperature, current protection and system-fault binary sensors, plus a dedicated heating binary sensor for the "low temperature heating" state. The cell-temperature (TB03) and ambient/power-temperature (TB04) tables are merged into a single temperature event code (TB03 high byte, TB04 low byte) so no detail is lost. The heating status bit (TB04 bit6) drives the heating binary sensor and stays in the raw code, but is masked out of the temperature protection flag since heating is an operating state, not a fault. problem_code is computed inline from the fault bytes; the per-event debug log is dropped now that the values are published. Covered by EIC tests for every code and binary sensor, including a new EIC_DATA_AMBIENT_TEMP frame for the combined temperature path.
88c46e7 to
0731d23
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
decode_eic_data_parses the EIC status block (registers0x2200–0x2248, function0x01) but only publishedproblem_code/problem_text. This publishes the remaining EIC entities — already defined in the schema, example YAML and header, but never fed:system_state_codevoltage_event_codetemperature_event_codecurrent_event_codevoltage_protectiontemperature_protectioncurrent_protectionsystem_faultheatingTB03 + TB04 combined
The cell-temperature (TB03,
data[2]) and ambient/power-temperature (TB04,data[3]) tables are merged into onetemperature_event_code— TB03 in the high byte, TB04 in the low byte — so neither table is dropped and no extra sensor is needed. The "low temperature heating" bit (TB04 bit6) is kept in the raw code but masked out oftemperature_protection, since heating is an operating state, not a fault — it instead drives a dedicatedheatingbinary sensor.Changes
seplos_bms_v3_ble.cpp: publish the four event-code sensors and four protection/fault binary sensors indecode_eic_data_; combine TB03+TB04; drop the now-redundant per-eventESP_LOGD(the values are published) and the unusednamefield on the lookup tableframes.h: newEIC_DATA_AMBIENT_TEMPcapture (TB04 real fault bit, distinct from the heating status bit)seplos_bms_v3_ble_test.cpp: tests for every event code and binary sensor, the combined temperature path, the heating-vs-fault distinction, and the null-sensor pathNo
test.host.yamlchanges — sensors are exercised by the unit tests and the example YAML already lists every EIC entity.Testing
pre-commit run --all-files— all hooks pass./run-cpp-tests.sh seplos_bms_v3_ble seplos_bms_v3_ble_pack— 36/36 pass, incl. 11 EIC tests