Check solar panel power generation by hour, week and month.
- ruby 2.7.4
- rails 7.0.2
- sqlite3 1.4
- httparty 0.20.0
- figaro 1.2
- whenever 1.0
- chartkick 4.1
- groupdate 6.1
- Clone this repository
git clone https://github.com/gogvale/solar_panel_stats/
- Inside the project run:
$ rails db:setup
- Modify
config/application.yml
with the following info:
development:
solar_panel_address: <solar_panel_url>/status.html
solar_panel_username: <username>
solar_panel_password: <password>
- Run the following command to add cronjobs:
$ whenever --update-crontab
- If necessary, modify the crontab with
crontab -e
in order to enableroot
to run the rails app, mine is as following:
# m h dom mon dow command
@reboot rbenv sudo /home/gogvale/solar_panel/bin/rails s -b 0.0.0.0 -p 80
# Begin Whenever generated tasks for: /home/gogvale/solar_panel/config/schedule.rb at: 2022-04-28 20:51:44 -0500
0,15,30,45 * * * * /bin/bash -l -c 'cd /home/gogvale/solar_panel && rbenv exec rails runner -e development '\''GetPowerGenerationJob.perform_now'\'''
# End Whenever generated tasks for: /home/gogvale/solar_panel/config/schedule.rb at: 2022-04-28 20:51:44 -0500
- Debugging done with
postfix
, restart Raspberry for starting the server by the cronjob