Move data files to data directory, ignore daemon scripts
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
daemon_*.sh
|
||||
363
config.ini
363
config.ini
@@ -1,363 +0,0 @@
|
||||
#-----------------------------------------
|
||||
# CONFIGURATION FILE FOR INVERTER MONITOR
|
||||
#-----------------------------------------
|
||||
|
||||
# Should work with PHOENIXTEC manufactured inverters: CMS / Sun Ezy / Orion / Eaton et al.
|
||||
#
|
||||
# Should at least work with:
|
||||
# * CMS2000 (CMS 2000)
|
||||
# * CMS10000 (CMS 10000) - requires more testing though
|
||||
# * SE2800 (SunEzy 2800)
|
||||
# * SE4600 (SunEzy 600E)
|
||||
# * ETN2000 (Eaton 2000)
|
||||
#
|
||||
# NOTE: http://pvoutput.org capable of accepting 60 data updates per hour,
|
||||
# but will only keep 1 every 5-10mins depending on your setting.
|
||||
|
||||
#-------
|
||||
# flags
|
||||
#-------
|
||||
|
||||
[flags]
|
||||
debug = 0 # 0 = NO, 1 = YES
|
||||
use_pvoutput = 1 # 0 = NO, 1 = YES to export data to http://pvoutput.org
|
||||
use_rrdtool = 1 # 0 = NO, 1 = YES to export data to rrdtool for graphing
|
||||
|
||||
#-------------------
|
||||
# number of seconds
|
||||
#-------------------
|
||||
|
||||
[secs]
|
||||
datapoll_freq = 5
|
||||
pvoutput_freq = 300 # every 5-10mins per your setting in http://pvoutput.org
|
||||
timeout = 20
|
||||
reinit = 10 # -1 = infinite num of times (ie dont die)
|
||||
|
||||
#------------------
|
||||
# file path to use
|
||||
#------------------
|
||||
|
||||
[paths]
|
||||
windows = "C:/solar" # windows
|
||||
other = "/opt/inverter/data" # unix/linux
|
||||
|
||||
#-------------------------
|
||||
# script and binary files
|
||||
#-------------------------
|
||||
|
||||
[scripts]
|
||||
pvoutput = "perl pvoutput.pl" # to export data to http://pvoutput.org
|
||||
pvoutput_php = "./pvoutput.php" # to export data to http://pvoutput.org
|
||||
create_rrd = "./create_rrd.php" # to export data to rrdtool for graphing
|
||||
rrdtool_exe_win = "rrdtool" # windows
|
||||
rrdtool_exe_oth = "/usr/bin/rrdtool" # unix/linux
|
||||
|
||||
#----------------------
|
||||
# serial port settings
|
||||
#----------------------
|
||||
|
||||
[serial]
|
||||
baud = 9600
|
||||
port_win = "COM5" # windows, COM port
|
||||
#port_oth = "/dev/ttyS0" # unix/linux, serial port
|
||||
port_oth = "/dev/ttyUSB0" # unix/linux, USB port
|
||||
#port_oth = "/dev/rfcomm0" # unix/linux, bluetooth port
|
||||
parity = "none"
|
||||
databits = 8
|
||||
stopbits = 1
|
||||
handshake = "none"
|
||||
datatype = 'raw'
|
||||
|
||||
#------------------------------------------------
|
||||
# hex start indeces and lengths for certain data
|
||||
#------------------------------------------------
|
||||
|
||||
[hex]
|
||||
data_to_follow_index = 8
|
||||
capacity_index = 20
|
||||
capacity_length = 12
|
||||
firmware_index = 32
|
||||
firmware_length = 14
|
||||
model_index = 46
|
||||
model_length = 28
|
||||
manuf_index = 74
|
||||
manuf_length = 32
|
||||
serial_index = 106
|
||||
serial_length = 20
|
||||
other_index = 138
|
||||
other_length = 8
|
||||
confserial_index = 18
|
||||
|
||||
#-----------------------------------------------
|
||||
# hex packet codes - SEND (request to inverter)
|
||||
#-----------------------------------------------
|
||||
|
||||
[sendhex]
|
||||
initialise = "aaaa010000000004000159"
|
||||
serial = "aaaa010000000000000155"
|
||||
conf_serial1 = "aaaa0100000000010b"
|
||||
conf_serial2 = "01"
|
||||
version = "aaaa01000001010300015a"
|
||||
paramfmt = "aaaa010000010101000158"
|
||||
param = "aaaa01000001010400015b"
|
||||
datafmt = "aaaa010000010100000157"
|
||||
data = "aaaa010000010102000159"
|
||||
|
||||
#------------------------------------------------
|
||||
# hex packet codes - RECV (response to inverter)
|
||||
#------------------------------------------------
|
||||
|
||||
[recvhex]
|
||||
serial = "aaaa0000010000800a"
|
||||
conf_serial = "aaaa000101000081"
|
||||
version = "aaaa000101000183"
|
||||
paramfmt = "aaaa000101000181"
|
||||
param = "aaaa000101000184"
|
||||
datafmt = "aaaa000101000180"
|
||||
data = "aaaa000101000182"
|
||||
|
||||
#---------------------
|
||||
# inverter parameters
|
||||
#---------------------
|
||||
|
||||
[param_vpvstart]
|
||||
hexcode = "40"
|
||||
multiply = 0.1
|
||||
measure = "V"
|
||||
index = -1
|
||||
descr = "PV Start-up voltage"
|
||||
|
||||
[param_tstart]
|
||||
hexcode = "41"
|
||||
multiply = 1
|
||||
measure = "Sec"
|
||||
index = -1
|
||||
descr = "Time to connect grid"
|
||||
|
||||
[param_vacmin]
|
||||
hexcode = "44"
|
||||
multiply = 0.1
|
||||
measure = "V"
|
||||
index = -1
|
||||
descr = "Minimum operational grid voltage"
|
||||
|
||||
[param_vacmax]
|
||||
hexcode = "45"
|
||||
multiply = 0.1
|
||||
measure = "V"
|
||||
index = -1
|
||||
descr = "Maximum operational grid voltage"
|
||||
|
||||
[param_facmin]
|
||||
hexcode = "46"
|
||||
multiply = 0.01
|
||||
measure = "Hz"
|
||||
index = -1
|
||||
descr = "Minimum operational frequency"
|
||||
|
||||
[param_facmax]
|
||||
hexcode = "47"
|
||||
multiply = 0.01
|
||||
measure = "Hz"
|
||||
index = -1
|
||||
descr = "Maximum operational frequency"
|
||||
|
||||
[param_zacmax]
|
||||
hexcode = "48"
|
||||
multiply = 1
|
||||
measure = "mOhm"
|
||||
index = -1
|
||||
descr = "Maximum operational grid impendance"
|
||||
|
||||
[param_dzac]
|
||||
hexcode = "49"
|
||||
multiply = 1
|
||||
measure = "mOhm"
|
||||
index = -1
|
||||
descr = "Allowable Delta Zac of operation"
|
||||
|
||||
#---------------
|
||||
# inverter data
|
||||
#---------------
|
||||
|
||||
[data_temp]
|
||||
hexcode = "00"
|
||||
multiply = 0.1
|
||||
measure = "deg C"
|
||||
index = -1
|
||||
descr = "Internal Temperature"
|
||||
|
||||
[data_vpv1]
|
||||
hexcode = "01"
|
||||
multiply = 0.1
|
||||
measure = "V"
|
||||
index = -1
|
||||
descr = "Panel 1 Voltage"
|
||||
|
||||
[data_vpv2]
|
||||
hexcode = "02"
|
||||
multiply = 0.1
|
||||
measure = "V"
|
||||
index = -1
|
||||
descr = "Panel 2 Voltage"
|
||||
|
||||
[data_vpv3]
|
||||
hexcode = "03"
|
||||
multiply = 0.1
|
||||
measure = "V"
|
||||
index = -1
|
||||
descr = "Panel 3 Voltage"
|
||||
|
||||
[data_ipv1]
|
||||
hexcode = "04"
|
||||
multiply = 0.1
|
||||
measure = "A"
|
||||
index = -1
|
||||
descr = "Panel 1 DC Current"
|
||||
|
||||
[data_ipv2]
|
||||
hexcode = "05"
|
||||
multiply = 0.1
|
||||
measure = "A"
|
||||
index = -1
|
||||
descr = "Panel 2 DC Current"
|
||||
|
||||
[data_ipv3]
|
||||
hexcode = "06"
|
||||
multiply = 0.1
|
||||
measure = "A"
|
||||
index = -1
|
||||
descr = "Panel 3 DC Current"
|
||||
|
||||
[data_etoday]
|
||||
hexcode = "0d"
|
||||
multiply = 0.01
|
||||
measure = "kWh"
|
||||
index = -1
|
||||
descr = "Accumulated Energy Today"
|
||||
|
||||
[data_vpv]
|
||||
hexcode = "40"
|
||||
multiply = 0.1
|
||||
measure = "V"
|
||||
index = -1
|
||||
descr = "Panel Voltage"
|
||||
|
||||
[data_iac]
|
||||
hexcode = "41"
|
||||
multiply = 0.1
|
||||
measure = "A"
|
||||
index = -1
|
||||
descr = "Grid Current"
|
||||
|
||||
[data_vac]
|
||||
hexcode = "42"
|
||||
multiply = 0.1
|
||||
measure = "V"
|
||||
index = -1
|
||||
descr = "Grid Voltage"
|
||||
|
||||
[data_fac]
|
||||
hexcode = "43"
|
||||
multiply = 0.01
|
||||
measure = "Hz"
|
||||
index = -1
|
||||
descr = "Grid Frequency"
|
||||
|
||||
[data_pac]
|
||||
hexcode = "44" # "0b" for 3phase
|
||||
multiply = 1
|
||||
measure = "W"
|
||||
index = -1
|
||||
descr = "Output Power"
|
||||
|
||||
[data_zac]
|
||||
hexcode = "45"
|
||||
multiply = 1
|
||||
measure = "mOhm"
|
||||
index = -1
|
||||
descr = "Grid Impedance"
|
||||
|
||||
[data_etotalh]
|
||||
hexcode = "47" # "07" for 3phase
|
||||
multiply = 256
|
||||
measure = "kWh"
|
||||
index = -1
|
||||
descr = "Accumulated Energy (high bit)"
|
||||
|
||||
[data_etotall]
|
||||
hexcode = "48" # "08" for 3phase
|
||||
multiply = 0.1
|
||||
measure = "kWh"
|
||||
index = -1
|
||||
descr = "Accumulated Energy (low bit)"
|
||||
|
||||
[data_htotalh]
|
||||
hexcode = "49" # "09" for 3phase
|
||||
multiply = 256
|
||||
measure = "hrs"
|
||||
index = -1
|
||||
descr = "Working Hours (high bit)"
|
||||
|
||||
[data_htotall]
|
||||
hexcode = "4a" # "0a" for 3phase
|
||||
multiply = 1
|
||||
measure = "hrs"
|
||||
index = -1
|
||||
descr = "Working Hours (low bit)"
|
||||
|
||||
[data_mode]
|
||||
hexcode = "4c" # "0c" for 3phase
|
||||
multiply = 1
|
||||
measure = " "
|
||||
index = -1
|
||||
descr = "Operating Mode"
|
||||
|
||||
[data_errgv]
|
||||
hexcode = "78"
|
||||
multiply = 1
|
||||
measure = " "
|
||||
index = -1
|
||||
descr = "Error message: GV fault value"
|
||||
|
||||
[data_errgf]
|
||||
hexcode = "79"
|
||||
multiply = 1
|
||||
measure = " "
|
||||
index = -1
|
||||
descr = "Error message: GF fault value"
|
||||
|
||||
[data_errgz]
|
||||
hexcode = "7a"
|
||||
multiply = 1
|
||||
measure = " "
|
||||
index = -1
|
||||
descr = "Error message: GZ fault value"
|
||||
|
||||
[data_errtemp]
|
||||
hexcode = "7b"
|
||||
multiply = 1
|
||||
measure = " "
|
||||
index = -1
|
||||
descr = "Error message: Tmp fault value"
|
||||
|
||||
[data_errpv1]
|
||||
hexcode = "7c"
|
||||
multiply = 1
|
||||
measure = " "
|
||||
index = -1
|
||||
descr = "Error message: PV1 fault value"
|
||||
|
||||
[data_errgfc1]
|
||||
hexcode = "7d"
|
||||
multiply = 1
|
||||
measure = " "
|
||||
index = -1
|
||||
descr = "Error message: GFC1 fault value"
|
||||
|
||||
[data_errmode]
|
||||
hexcode = "7e"
|
||||
multiply = 1
|
||||
measure = " "
|
||||
index = -1
|
||||
descr = "Error mode"
|
||||
@@ -318,7 +318,7 @@ $config->define( "data_errmode_index=s" );
|
||||
$config->define( "data_errmode_descr=s" );
|
||||
|
||||
# fill variables by reading configuration file
|
||||
$config->file( "config.ini" ) || die "FAILED to open and/or read config file: config.ini\n";
|
||||
$config->file( "data/config.ini" ) || die "FAILED to open and/or read config file: config.ini\n";
|
||||
|
||||
if ($config->flags_debug) {
|
||||
print "debug=" . $config->flags_debug ;
|
||||
|
||||
@@ -92,11 +92,11 @@ if (isset($fTemperature)) {
|
||||
$fTemperature = abs($aToday[3] - $fTemperature) > (MARGIN_TEMPERATURE * $aToday[3]) ? $aToday[3] : $fTemperature;
|
||||
}
|
||||
$aData['v5'] = $fTemperature; // ignore potential flaws in first temperature of the day
|
||||
file_put_contents('temp.csv', sprintf("%d,%f\n", $iTime, $fTemperature), FILE_APPEND);
|
||||
file_put_contents('data/temp.csv', sprintf("%d,%f\n", $iTime, $fTemperature), FILE_APPEND);
|
||||
}
|
||||
|
||||
/* Store debug data */
|
||||
file_put_contents('pvoutput.debug', json_encode(array($argv, $fEnergy, $aToday, $aData)) . "\n", FILE_APPEND);
|
||||
file_put_contents('data/pvoutput.debug', json_encode(array($argv, $fEnergy, $aToday, $aData)) . "\n", FILE_APPEND);
|
||||
|
||||
/* Send data to PVOutput */
|
||||
if (isset($aSystems[$sSerial])) {
|
||||
|
||||
0
weather.php
Normal file → Executable file
0
weather.php
Normal file → Executable file
6
wunderground.php
Normal file → Executable file
6
wunderground.php
Normal file → Executable file
@@ -2,7 +2,7 @@
|
||||
define('KEY', '2556854ea765c351');
|
||||
define('LIMIT_MINUTE', 10);
|
||||
define('LIMIT_DAY', 500);
|
||||
define('LIMIT_FILE', 'wunderground.json');
|
||||
define('LIMIT_FILE', 'data/wunderground.json');
|
||||
|
||||
function wunderground($sService, $sQuery, $bDebug = false) {
|
||||
/* Get current date values */
|
||||
@@ -59,9 +59,9 @@ function wunderground($sService, $sQuery, $bDebug = false) {
|
||||
'minute' => array($iMinute, $aCount['minute']),
|
||||
'day' => array($iDay, $aCount['day']));
|
||||
file_put_contents(LIMIT_FILE, json_encode($aJSON));
|
||||
|
||||
|
||||
/* Perform actual call */
|
||||
$sUrl = sprintf('http://api.wunderground.com/api/%s/%s/q/%s.json', KEY, $sService, $sQuery);
|
||||
$sJSON = file_get_contents($sUrl);
|
||||
return json_decode($sJSON, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user