lumapu / ahoy

Various tools, examples, and documentation for communicating with Hoymiles microinverters
https://ahoydtu.de
Other
950 stars 223 forks source link

MQTT keeps on reporting value when Inverter went offline (battery usage) #1228

Open tuxianerDE opened 10 months ago

tuxianerDE commented 10 months ago

Hardware

Version / Git SHA:

Version: 0.7.36 Github Hash: ba218ed

Build & Flash Method:

I am using MQTT to report the data to my InfluxDB. I set the interval in the web interface to 5s so that constant data get pushed instead of on demand when they get pulled.

I am operating my HM-1500 with a battery pack, hence it happens that in the middle of the night that batteries run out of power and thus drops to 0. In this case the DTU still publishes data to the MQTT stating the last value in my case last night around 125W of input from WR, which of course is wrong as the connection to the Hub when Offline and of course no data went into the grid.

My question/suggestion: Would it be possible to alter the behaviour that in this setting MQTT stop publishing data i.e. inverter is offline hence no reason to keep on publishing? I do appreciate the regular interval at which data get published especially for the generation of usage data down the road, I am reluctant to the publishing interval back to 0 just for that.

juepi commented 9 months ago

I have the same issue, however imho the problem should be specified a bit different (i am currently on dev build 0.8.14): as far as i can tell, the problem is, that AhoyDTU does not update all MQTT inverter related topics to 0 when an inverter goes offline, even when the checkbox Reset values when inverter status is 'not available' is enabled.

Example:

Imho Ahoy-DTU should reset/update all MQTT power-related topics of the inverter to 0 when the available state changes to 0 when Reset values when inverter status is 'not available' is enabled (discussible imho if an offline-inverter should be assumed to not produce at any time, even if Reset values... not set?)

@tuxianerDE : I'm currently using the workaround to not get MQTT data from Ahoy-DTU periodically (interval = 0) and run a external script periodically which only updates the data in my home automation if the inverter is available. If not, it assumes 0W AC output.

lumapu commented 7 months ago

there was a recent change on this "reset values if the inverter isn't available". Maybe you can test again