After being connected to the new system of solar installations, I had a challenge that I need to use the amount of power that is produced within an hour.
So I've made a little system where you can measure the amount of watts generated by the system and in the light of various power consuming thing. I currently have 2 relays that control the extraction and cooling of server space.
It all runs on Raspberry Pi with a relay card connected. Can be bought here 8$
I also use a Bluetooth usb adapter from Hama I bought it here.
My inverter is a SMA SB4000TL-
The program to read data from the inverter comes from SMAspot
There are full installation instructions for the program under the downloads page.
Sadly the original site has gone down, so I have put the files on my own site.
The program to control the relays can be found here and the connection to the Raspberry Pi is as follows
Or if the site is gone then here and then just build is
Vcc to pin 2
In1 to pin 16
In2 to pin 18
Gnd to pin 25
My script to read csv file and control the relay via Bash is here.
-
#!/bin/bash
INPUT=/home/pi/smadata/$(date +%Y)/filnavn-
gpio -
gpio -
trikker1="0,500"
trikker2="1,500"
watt=$(tail -
echo $watt
echo $trikker1
echo $trikker2
# switch 1
if [[ "$watt" > "$trikker1" ]]; then
echo "Switch on air flow system"
switch1on="gpio -
eval $switch1on
else
echo "Air flow system off"
switch1off="gpio -
eval $switch1off
fi
# switch 2
if [[ "$watt" > "$trikker2" ]]; then
echo "Switch cooling system on"
switch2on="gpio -
eval $switch2on
else
echo "Cooling system off"
switch2off="gpio -
eval $switch2off
fi
-
Then you just have to make an entry in crontab which run every 5 minutes.
SMA Inverter power usage |