johanmeijer / grott

Growatt inverter monitor
https://github.com/johanmeijer/grott/wiki
374 stars 103 forks source link

How can I achieve fallback in case of Grott goes down #496

Open LightMoon opened 6 months ago

LightMoon commented 6 months ago

I wonder if there is a solution out there that can provide some sort of fallback mechanisation in case of HA or ( Grott ) goes down? I still would like to be able to send the inverter data to the Growatt cloud in case of the HA outage.

rany2 commented 6 months ago

You could use the sniffer mode though admittedly it's not the most elegant method and your router might not be capable. Beyond that you're out of luck I'm afraid.

LightMoon commented 6 months ago

Even the custom fw like this doesn't provide this feature?

rany2 commented 6 months ago

Even the custom fw like this doesn't provide this feature?

That wouldn't even let you connect to Growatt's servers anymore, it would be entirely selfhosted by you.

LightMoon commented 6 months ago

Can you point me to the right documentations so I figure out how I can set it up in Sniff mode? I just installed the grott-home-assistant-add-on by @egguy and running HA as a VM.

rany2 commented 6 months ago

Have a look at https://github.com/johanmeijer/grott/wiki/Rerouting-Growatt-Wifi-TCPIP-data-via-your-Grott-Server#for-sniffer-mode-linux-only

I wouldn't recommend it though, I think it's much of a hassle to get working. I would instead recommend running grott standalone but I'm not sure if it's possible with that extension you linked to

LightMoon commented 6 months ago

Great thanks! I digested that in the Sniff mode, the role of packet forwarding is handed over to the Linux kernel instead of Grott handling it. My edge router is DD-WRT which is basically a Linux with capability of ipv4 packet forwarding and access to iptable. @johanmeijer I wonder if possible to get the dd-wrt router to forward Dataloger (Wifi Dongle) traffic to Grott server ( running on sniff mode)?

johanmeijer commented 6 months ago

I have not tested the sniffer mode for a long time. It is not that simple to configure it and to have it running in parallel next to my other setup.

To be honest I wanted to drop support for it in the 3.0 version of grott and focus more on proxy and grottserver (and integrate those). If you think it is still needed I and can leave the option in, but be-aware it works as long as it works.

Grott in sniffer mode should run at a system where the IP traffic passes. In basic these means that Grott should run at the system where the IPTables rerouting has been configured (in your case the DD-WRT router). I do not think it is possible to run a python application like grott to run on a DD-WRT router.

bardahlm commented 6 months ago

One way I suggested in #480 is to use as mirror-port on the switch. Another might be to set up some kind of load balancer (HAProxy) that sends traffic to Grott as long at it is up and running but sends to the Growatt servers if Grott is down. You might be able to run HAProxy on your firewall.

johanmeijer commented 6 months ago

The best fall-back is provided by the growatt inverter / datalogger itself. In the rare occasion Grott stops (I am running it for your without any problems). The data is stored (buffered) in the datalogger and sent out later.

I do not think that a complex other solution will add any value (but that is my personal opionion, being a little bit biased).