EcoFlow Exporter is a Prometheus exporter that collects metrics from EcoFlow devices via the EcoFlow API and exposes them in a format that Prometheus can scrape.
- Fetches real-time data from EcoFlow devices
- Exposes Prometheus-compatible metrics
- Configurable via environment variables
- Automatic filtering of non-relevant metrics
- Handles metric expiration to prevent stale data
- Runs as a standalone HTTP server
This project is hosted at github.com/michikrug/ecoflow-exporter.
- Go 1.18+
- An EcoFlow account with API access
- Prometheus for scraping metrics
Clone the repository and build the exporter:
git clone https://github.com/michikrug/ecoflow-exporter.git
cd ecoflow-exporter
go build -o ecoflow-exporterCreate a .env file or use environment variables:
ECOFLOW_ACCESSKEY=your_access_key
ECOFLOW_SECRETKEY=your_secret_key
DEVICE_SN=your_device_serial_number
DEVICE_NAME=your_device_name
ECOFLOW_API_ENDPOINT=api-e.ecoflow.com
EXPORTER_PORT=9090
COLLECTING_INTERVAL=30s
EXPIRATION_THRESHOLD=15m./ecoflow-exporterdocker build -t ecoflow-exporter .
docker run --env-file .env -p 9090:9090 ecoflow-exporterThe exporter exposes metrics at:
http://localhost:9090/metricsExample metrics:
# HELP ecoflow_ac_set_watts AC set power in watts
# TYPE ecoflow_ac_set_watts gauge
ecoflow_ac_set_watts{device="MyEcoFlow"} 250.0Hint: Some do not provide useful data
ac_off_flagac_set_wattsanti_back_flow_flagbat_err_codebat_error_inv_load_limitbat_input_curbat_input_voltbat_input_wattsbat_load_limit_flagbat_off_flagbat_op_voltbat_output_load_limitbat_socbat_statuebat_systembat_tempbat_warning_codebms_req_chg_ampbms_req_chg_volbp_typechg_remain_timecons_numcons_wattdsg_remain_timedynamic_wattsesp_tempsensorevent_info_adjacent_channel_countevent_info_bandwithevent_info_bssid_countevent_info_bt_stateevent_info_channel_countevent_info_communication_channelevent_info_connect_timeevent_info_cpuevent_info_is_hiddenevent_info_mqtt_error_countevent_info_mqtt_success_countevent_info_typeevent_info_wifi_error_countevent_info_wifi_standardevent_info_wifi_success_countfeed_protectfiso_rxyzfload_limit_outgene_numgene_wattgrid_cons_wattsgrid_ovp_cntheartbeat_frequencyheartbeat_type2_frequencyhistory_bat_input_wattshistory_grid_cons_wattshistory_inv_output_wattshistory_inv_to_plug_wattshistory_permanent_wattshistory_plug_total_wattshistory_pv_to_inv_wattsinstall_countryinstall_towninterface_conn_flaginv_brightnessinv_demand_wattsinv_err_codeinv_freqinv_input_voltinv_load_limit_flaginv_on_offinv_op_voltinv_output_curinv_output_load_limitinv_output_wattsinv_relay_statusinv_statueinv_tempinv_to_other_wattsinv_to_plug_wattsinv_warn_codellc_err_codellc_input_voltllc_off_flagllc_op_voltllc_statuellc_templlc_warning_codelower_limitmesh_idmesh_layelmqtt_connect_return_codemqtt_errmqtt_err_timemqtt_last_dis_reasonmqtt_sock_errnomqtt_tls_last_errmqtt_tls_stack_errnoise_floorparent_macpermanent_wattsplug_total_wattspv_power_limit_ac_powerpv_to_inv_wattspv1_ctrl_mppt_off_flagpv1_err_codepv1_input_curpv1_input_voltpv1_input_wattspv1_op_voltpv1_relay_statuspv1_statuepv1_temppv1_warn_codepv2_ctrl_mppt_off_flagpv2_err_codepv2_input_curpv2_input_voltpv2_input_wattspv2_op_voltpv2_relay_statuspv2_statuepv2_temppv2_warning_coderated_powerreset_countreset_reasonrssi_thresholdrssi_variancerst_brownoutrst_deepsleeprst_extrst_int_wdtrst_panicrst_poweronrst_sdiorst_swrst_task_wdtrst_unknowrst_wdtself_macspace_demand_wattssta_ip_addrstack_freestack_min_freesupply_priorityupdate_timeupper_limituwload_limit_flaguwlow_light_flaguwsoc_flagwifi_connect_channelwifi_encrypt_modewifi_errwifi_err_timewifi_firmware_versionwifi_rssiwireless_err_codewireless_warn_code
This project is licensed under the GNU General Public License v3. See the LICENSE file for details.
Contributions are welcome! Feel free to open an issue or submit a pull request.
For questions or support, open an issue on GitHub.


