Report EcoFlow power and temperature as floats

River 2 reported total power and temperature as integers. River 3 reported temperature as an integer. InfluxDB keeps one field type for each measurement, so it rejected these points when another device wrote floats to the same measurement.
This commit is contained in:
tim
2026-10-10 09:03:33 +02:00
parent f36bb2510c
commit aa9888800e
3 changed files with 27 additions and 3 deletions
+5 -3
View File
@@ -338,8 +338,10 @@ class River2Decoder:
if src == 0x02: # Total device power, not just battery power.
charge_ratio(values["soc"], priority=1)
scalar("ef_input_power_watts", "Total Input Power", values["watts_in_sum"], "W")
scalar("ef_output_power_watts", "Total Output Power", values["watts_out_sum"], "W")
# Float, as on River 3: one measurement must keep one type, or
# InfluxDB rejects the other backend's points.
scalar("ef_input_power_watts", "Total Input Power", float(values["watts_in_sum"]), "W")
scalar("ef_output_power_watts", "Total Output Power", float(values["watts_out_sum"]), "W")
remaining("ef_remaining_time_minutes", "Remaining Time", values["remain_time"])
elif cmd_id == 0x02: # EMS has separate charge/discharge estimates.
if "f32_lcd_show_soc" in values:
@@ -352,7 +354,7 @@ class River2Decoder:
charge_ratio(values["f32_show_soc"], priority=3)
else:
charge_ratio(values["soc"], priority=1)
temp = values["temp"]
temp = float(values["temp"]) # Float, as from the JBD sensors.
snapshot.bms_temperature_celsius = BMSMultiField(
help="Battery Temperature", label="sensor",
raw_values={1: temp}, values={1: str(temp)}, units="°C",
+1
View File
@@ -305,6 +305,7 @@ class River3Decoder:
for source, priority in (("cms_batt_temp", 1), ("bms_max_cell_temp", 2)):
temp = values.get(source)
if temp is not None and priority >= self._river3_temp_priority:
temp = float(temp) # Float, as from the JBD sensors.
snapshot.bms_temperature_celsius = BMSMultiField(
help="Battery Temperature", label="sensor",
raw_values={1: temp}, values={1: str(temp)}, units="°C",