jgyates / genmon

Generac (and other models) Generator Monitoring using a Raspberry Pi and WiFi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request data to csv

diverbill opened this issue · comments

Hello, I recently had had an error show up on my generator Battery Problem : Alarm Code: 2760. I was asked to monitor 2 things the battery charge level and the charger state. Is there an easy way to do this from the CLI and log it to a csv?

I'm thinking something like
Time,12.7V, Not Charging

have it log it every 30 seconds

I first tried to do a curl command on the page and this did not display correctly.

Thanks for your help!

The attached python file will do what you are asking. Just redirect the output of the file to the filename you want.

battery.py.txt

  1. Download the file to a system that can run python3 on your local network, this can be the pi that runs genmon or some other system

  2. rename it battery.py instead of battery.py.txt

  3. edit the file to use your IP address of your genmon system

  4. run this command:

    python3 -u battery.py > out.csv
    

This will run the program and output the info to the file out.csv. You can change the filenme in the line above if you want a different file name.

You can type ctrl+c to stop the program

You can monitor the output while it is running with this command:

 tail -f ./out.csv

Let me know if you have any questions.