Thanks for that reply Do you know of any ressources or documentation that describes this control via the backend in more detail? and which commands that can be run, and how it would be set up - like where would I run the script from?
Thanks in advance
A more exact approach to stop/start your miners at sunset/sunrise would be:
a) install command 'at'
Code:
sudo apt install at
b) create the following files:
Code:
echo 'systemctl start apollo-miner' > /etc/sunr
echo 'systemctl stop apollo-miner' > /etc/suns
touch /etc/atsunrise.sh
touch /etc/atsunset.sh
chmod +x /etc/atsun*.sh
c) create a shell script which is called via cron every day early in the morning
Code:
# crontab entry:
# run the script everyday at 01:00 am
0 1 * * * /etc/sunr_suns.sh
create the script /etc/sunr_suns.sh
Code:
# /bin/bash
# script name: /etc/sunr_suns.sh
# (don't forget to make the script executable - chmod +x /etc/sunr_suns.sh)
#
# retrieve current sunrise and sunset times at a specific location
# (don't forget to change your country/city)
# for more details visit www.timeanddate.com
#
echo $(wget -q -O- https://www.timeanddate.com/sun/germany/munich | grep -oE 'Sunrise Today.{35}' | awk -F\> '{print $3}' | cut -c 1-5) > /tmp/sunrise
echo $(wget -q -O- https://www.timeanddate.com/sun/germany/munich | grep -oE 'Sunset Today.{35}' | awk -F\> '{print $3}' | cut -c 1-5) > /tmp/sunset
#
# assemble the command line structure for the at command:
#
echo at $(cat /tmp/sunrise) -f /etc/sunr > /etc/atsunrise.sh
echo at $(cat /tmp/sunset) -f /etc/suns > /etc/atsunset.sh
#
# run the scripts
#
/etc/atsunrise.sh
/etc/atsunset.sh
This is REAL nice; I might borrow this, thank you!
THANKS !!!
Another approach I am planning is to control it based on if a battery in a solar setup (hybrid solar solution) is fully charged = start the miner. And then when Battery is discharged to say 70% the Miner must stop.
But in order to do this I need to be able to pull/call this battery charge status - I am not sure if that is possible...But it would be the most efficient solution as many days of the year we have clouds all day = miner need to be off most of the day to wait for battery to be charged fully - as order of priority is 1) electricity for current use in the house 2) charging battery to supply electricity during evenings and night when solar panels don't supply it 3) Run the mining to "eat" left over electricity to avoid having to sell it back to the grid at ridiculous prices.
Anyone having experience with calling battery controllers to get that battery charge %? (to use in the script instead)
I am considering a hybrid solution from Growatt - and I just found this via a google search
4.3.13 Access to the latest energy storage machine real-time data (POST)
https://growatt.pl/wp-content/uploads/2020/01/Growatt-Server-API-Guide.pdf
Maybe the script could access this...