This is a Telegram bot that interfaces to the GoodWe inverters of the serie ET, EH and the others supproted by the goodwe python library. Please note that many inverters by other producers are actually rebranded GoodWe inverters: for instance certain Veissmanm inverters are GoodWe inverters.
The bot needs to run on your local network, were the GoodWe inverter is registered. Discovers and accesses the inverter UDP or TCP port directly to fetch data, putting them into a Redis instance, in the Streams data type, as time series with 15 seconds and 1h granuality. Then, you can use the bot to obtain real time data and graphs about your inverter and energy production, like in the following example:
With "help" you'll get a list of commands the bot is able to handle. The main ones are:
- Today (or just "t"): graphs about the energy produced and consumed, using the X axis as separator between the two.
- Bat (or just "b"): graphs about the battery percentage.
- Month (or just "m"): dialy graphs.
- ... and so forth, use the help command for more info.
You need a local Redis instance and a computer able to run Python. You also need the Python goodwe library installed (pip install goodwe
). Redis should be configured to persist using the AOF.
The amount of data that will be stored on Redis is currently not capped, but each entry in the 15 seconds stream takes around 45 bytes. However I'll add the ability to remove older data once the set of features I want to support will be clear.
Once you have everything installed, you should;
- Create a new Telegram Bot API key, via the
@BotFather
. - copy
config_example.py
intoconfig.py
, editing it to match your installation, Telegram bot token, and so forth. Note that the exact IP address of the inverter will be autodetected, just specify your network. - Run
python data_collector.py
underscreen
or something like that. This process will keep going for a long time. - Run
python bot.py
as well. This is the bot process itself.
Now you can talk with your bot.
This code was written using Claude Sonnet 3.7 for the boilerplate parts. The code was tested and reviewed, and fixed by hand when needed. The prompts specified the implementation details. Still, it's not the same quality as carefully hand-written code, however I had only limited time to finish this project.
Released under the AGPL license.