Berry energy
module support for 8 phases and move to pseudo-arrays
#21887
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.
Description:
Breaking change
Accessors for phase 2/3 are removed in favor of the array. Ex:
energy.active_power_2
andenergy.active_power_3
are no longer supported.New support for up to 8 phases
Support for up to 8 phases in
module energy
:energy.active_power
_phases
, ex:energy.active_power_phases[0]
toenergy.active_power_phases[7]
.energy.active_power_phases
is a pseudo-array; it accepts read/writes but is not an actual array.var ap = energy.active_power_phases
energy.tomap()
returns a complete map of all attributesExample:
Example of
tomap()
:{'data_valid': 0, 'today_delta_kwh': 0, 'frequency_common': 0, 'import_active_phases': [0,0,0,0,0,0,0,0], 'data_valid_phases': [0,0,0,0,0,0,0,0], 'today_offset_init_kwh': 0, 'type_dc': 0, 'reactive_power': nan, 'energy_active_export': 0, 'start_energy': 0, 'power_history_2_phases': [0,0,0,0,0,0,0,0], 'command_code': 0, 'total_sum': 0, 'total_phases': [0,0,0,0,0,0,0,0], 'total': 0, 'daily': 0, 'today_kwh': 0, 'frequency': nan, 'import_active': 0, 'period': 0, 'voltage': 0, 'power_history_1_phases': [0,0,0,0,0,0,0,0], 'today_kwh_phases': [0,0,0,0,0,0,0,0], 'power_history_1': 0, 'current_available': 1, 'export_active_phases': [nan,nan,nan,nan,nan,nan,nan,nan], 'max_energy_state': 0, 'voltage_phases': [0,0,0,0,0,0,0,0], 'daily_sum_import_balanced': 0, 'power_factor': nan, 'start_energy_phases': [0,0,0,0,0,0,0,0], 'daily_phases': [0,0,0,0,0,0,0,0], 'reactive_power_phases': [nan,nan,nan,nan,nan,nan,nan,nan], 'power_history_0': 0, 'min_voltage_flag': 0, 'mpl_retry_counter': 0, 'yesterday_sum': 0, 'power_factor_phases': [nan,nan,nan,nan,nan,nan,nan,nan], 'voltage_available': 1, 'current': 0, 'use_overtemp': 0, 'period_phases': [0,0,0,0,0,0,0,0], 'export_active': nan, 'today_delta_kwh_phases': [0,0,0,0,0,0,0,0], 'min_current_flag': 0, 'active_power': 0, 'phase_count': 1, 'power_history_0_phases': [0,0,0,0,0,0,0,0], 'frequency_phases': [nan,nan,nan,nan,nan,nan,nan,nan], 'current_phases': [0,0,0,0,0,0,0,0], 'max_power_flag': 0, 'voltage_common': 0, 'power_history_2': 0, 'max_voltage_flag': 0, 'active_power_phases': [0,0,0,0,0,0,0,0], 'apparent_power_phases': [nan,nan,nan,nan,nan,nan,nan,nan], 'min_power_flag': 0, 'today_offset_kwh': 0, 'power_on': 1, 'power_steady_counter': 0, 'mpl_window_counter': 0, 'mpl_hold_counter': 0, 'apparent_power': nan, 'fifth_second': 0, 'daily_sum_export_balanced': 0, 'today_offset_kwh_phases': [0,0,0,0,0,0,0,0], 'max_current_flag': 0, 'daily_sum': 0}
Related issue (if applicable): fixes #21871
Checklist:
NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass