Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure solarcharger classes #1457

Merged
merged 2 commits into from
Jan 18, 2025

Conversation

AndreasBoehm
Copy link
Member

@AndreasBoehm AndreasBoehm commented Dec 13, 2024

Restructure solarcharger classes to allow simple addition of new providers.

Based on the structure that @schlimmchen introduced here: #1451

Closes #1408.
Closes #457.

@AndreasBoehm AndreasBoehm force-pushed the rename-vedirect-to-solarcharger branch from d4d9737 to d11be3b Compare December 23, 2024 12:02
@AndreasBoehm AndreasBoehm force-pushed the andreasboehm/feature/restructure-vedirect branch from e23be05 to 983abde Compare December 23, 2024 12:08
@AndreasBoehm AndreasBoehm marked this pull request as draft December 23, 2024 12:08
@AndreasBoehm AndreasBoehm force-pushed the rename-vedirect-to-solarcharger branch from d11be3b to a3d0408 Compare December 24, 2024 11:24
@AndreasBoehm AndreasBoehm force-pushed the rename-vedirect-to-solarcharger branch 2 times, most recently from 08e5b9a to 635a450 Compare January 4, 2025 15:24
@AndreasBoehm AndreasBoehm force-pushed the andreasboehm/feature/restructure-vedirect branch 5 times, most recently from 5723f4e to b630fb9 Compare January 4, 2025 22:19
@AndreasBoehm AndreasBoehm force-pushed the andreasboehm/feature/restructure-vedirect branch 2 times, most recently from 8f5e560 to d5775dc Compare January 4, 2025 22:59
@AndreasBoehm AndreasBoehm force-pushed the rename-vedirect-to-solarcharger branch 2 times, most recently from 4811e65 to 9e73fcc Compare January 8, 2025 20:31
Base automatically changed from rename-vedirect-to-solarcharger to development January 8, 2025 20:46
@AndreasBoehm AndreasBoehm force-pushed the andreasboehm/feature/restructure-vedirect branch 5 times, most recently from 088c3e0 to ea10501 Compare January 12, 2025 14:42
@AndreasBoehm AndreasBoehm marked this pull request as ready for review January 12, 2025 14:44
@AndreasBoehm AndreasBoehm force-pushed the andreasboehm/feature/restructure-vedirect branch 3 times, most recently from a396cf5 to e447c6b Compare January 15, 2025 15:17
@AndreasBoehm AndreasBoehm force-pushed the andreasboehm/feature/restructure-vedirect branch from e447c6b to d7ff717 Compare January 15, 2025 19:05
_outputPowerTopic = config.PowerTopic;
_outputCurrentTopic = config.CurrentTopic;

auto configValid = config.CalculateOutputPower ? !_outputCurrentTopic.isEmpty() : !_outputPowerTopic.isEmpty();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schlimmchen i forgot to check if the voltage topic is set when we need to calculate the output.

Could you add this check please?

@schlimmchen
Copy link
Member

MQTT solar charger provider: I cannot save the power topic or path, and the units have no default values in the webapp. Something is very wrong: You removed the prefix mqtt_output_ from the JSON members after I commented that the prefix adds nothing of value, but forgot to adjust the webapp accordingly. => Fixed in 0b45918

When booting and until a value is received at the subscribed power topic, the live card's data age always resets to zero after 10 seconds. That's because data_age_ms is always zero in that case and it is included in a new "full update". => Fixed in b1dc1c8

I did the fix you requested, but also made the error message independent of the verbose logging switch. Error messages shall always be printed. The message was adjusted to show whether or not there is a topic set for each of the three values, as it is hard to comprehend why the "config valid" switch toggled to false. => Fixed in 1c18032

The live view card (still) reads "MPPT: MQTT". I took the liberty to change that and have it translated to something meaningful and nothing with "MPPT" in it. Also, I replaced "MPPT" elsewhere in the language files. => See b7dcb9f

this changeset restructures and refactors the solar charger integration
to accomodate different solar charger data providers in the future. we
did only support (multiple) Victron SmartSolar MPPT charge controllers
using the VE.Direct interface, but will be able to integrate solar
output values for use by the DPL in the future.
adds support to integrate solar charge controller output power, current,
and voltage values from the MQTT broker, allowing the DPL to do
solar-passthrough with any solar charge controller hardware as long as
it publishes the relevant values to the MQTT broker.
@schlimmchen schlimmchen force-pushed the andreasboehm/feature/restructure-vedirect branch from b7dcb9f to 60fc9b3 Compare January 18, 2025 20:46
@schlimmchen
Copy link
Member

I then squashed the refactoring commits into one commit, as we discussed, squashed my fixes into the "Feature:" commit, and rebased onto the current development branch.

I will be double-checking that my VE.Direct solar chargers are working fine with the new firmware, and if so, I will merge this PR using the rebase strategy.

@schlimmchen schlimmchen linked an issue Jan 18, 2025 that may be closed by this pull request
@schlimmchen schlimmchen merged commit af92459 into development Jan 18, 2025
16 checks passed
@schlimmchen schlimmchen deleted the andreasboehm/feature/restructure-vedirect branch January 18, 2025 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Request] Make Solarcharger integration more generic [Request] Get value for PV power via MQTT
2 participants