fix evse_link
This commit is contained in:
40
components/loadbalancer/include/pv_optimizer.h
Executable file
40
components/loadbalancer/include/pv_optimizer.h
Executable file
@@ -0,0 +1,40 @@
|
||||
#ifndef PV_OPTIMIZER_H_
|
||||
#define PV_OPTIMIZER_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "esp_err.h"
|
||||
#include "meter_events.h"
|
||||
|
||||
void pv_optimizer_init(void);
|
||||
|
||||
void pv_optimizer_set_enabled(bool en);
|
||||
bool pv_optimizer_is_enabled(void);
|
||||
|
||||
esp_err_t pv_optimizer_set_max_import_w(int32_t w);
|
||||
int32_t pv_optimizer_get_max_import_w(void);
|
||||
|
||||
/**
|
||||
* @brief Calcula o budget TOTAL (A) para todos os EVSEs, para manter importação <= max_import_w.
|
||||
*
|
||||
* - max_import_w = 0 => modo "Só PV": tenta manter importação ~0 (só consome quando há exportação).
|
||||
* - max_import_w > 0 => modo "PV-Grid": permite importar até esse valor.
|
||||
*
|
||||
* @param grid_evt Último evento do medidor GRID (watt_total assinado).
|
||||
* @param last_total_cmd_a Soma da corrente comandada no ciclo anterior (A).
|
||||
* @param total_hw_max_a Soma dos hw_max_current dos conectores ativos (A).
|
||||
* @return budget_total_a (0..total_hw_max_a)
|
||||
*/
|
||||
float pv_optimizer_compute_budget_a(const meter_event_data_t *grid_evt,
|
||||
float last_total_cmd_a,
|
||||
float total_hw_max_a);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* PV_OPTIMIZER_H_ */
|
||||
Reference in New Issue
Block a user