Send a discovery packet every 10 minutes to keep UDP inverters "awake" #340
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As per here: home-assistant/core#114173 (comment)
I don't know why, but it seems my (and others) inverters go to sleep every night and stop responding.
I checked the traffic with tcpdump, but obviously being UDP, there's not much going on, UDP requests go out, nothing comes back from about 1-3am onwards; and never wakes up the next day, even once the sun comes out.
Opening the Solar Go app fixes the issue straight away, and inspecting traffic from Solar Go, all it's doing is sending the special discovery request, that's all that is required to wake up the inverter.
I tried to implement this in the goodwe library, instead of inside Home Assistant, but wasn't sure of the best place to put it, inside
UdpInverterProtocol
felt like maybe the right place, but it's breaking the abstraction too much I felt (because now the inverter protocol contains yet another inverter protocol for another port...)So I ended up with this here... it works for me, but I'm not HA developer, I'm probably doing it all wrong 😁
Happy to close this out if you've got a better way to implement, but I'm running this for now and it's working for me 👍