lumapu / ahoy

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

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

Open tuxianerDE opened 1 year ago

tuxianerDE commented 1 year 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 12 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 9 months ago

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

stefan123t commented 1 month ago

@tuxianerDE @juepi are you still facing the issue in v0.8.152 or can this be closed based on the changes that lumapu mentioned ?

juepi commented 1 month ago

Can't check it at the moment as i'm not at home. My MQTT interval is set to '0' and home automation script that manually updates AC power to '0' when the inverter status is not '2'. Will manually check it asap and let you know.

Yours, Juergen

tuxianerDE commented 1 month ago

Hey, will not be able to check leave it then to @juepi as I switched to OpenDTU.

juepi commented 4 weeks ago

Ok, just upgraded from 0.8.151 to 0.8.152. Concerning this issue, i have now verified this behavior with MQTT Interval = 0 and Reset values when inverter status is 'not available' checked:

So imho, the function Reset values when inverter status is 'not available' is still not working as expected, as it should reset all power related topics to 0 (_AC, _DC) as soon as the Inverter available = 0.

yours, Juergen