solarrd/config.py

67 lines
2.0 KiB
Python
Raw Permalink Normal View History

2018-03-11 21:30:10 +01:00
#!/usr/bin/env python3
2018-04-27 02:03:42 +02:00
from configutils import *
2018-03-11 21:30:10 +01:00
SERIAL = '/dev/ttyUSB0'
BAUD_RATE = 4800
2018-10-13 14:07:07 +02:00
SFTP_HOST = 'rc-club-albersweiler.de'
SFTP_PORT = 22
SFTP_USER = 'sftprcclub'
2018-10-20 20:35:48 +02:00
SFTP_KEY = '/home/pi/.ssh/id_rsa'
2018-10-13 14:07:07 +02:00
2018-11-07 19:07:07 +01:00
DATA_FILE = './solar.rrd'
ARCHIVE_DATA_FILE = './solar_archive.rrd'
2018-03-11 21:30:10 +01:00
DATA_INTERVAL = 60
2018-11-07 19:15:04 +01:00
ARCHIVE_INTERVAL = 60 * 60 * 24 # 1d
ARCHIVE_KEEP_INTERVAL = 365 * 24 * 60 * 60 # 1 year
2018-04-27 02:03:42 +02:00
MAX_MISSING = 0.5
2018-03-11 21:30:10 +01:00
# Manual claims poly should be 0x8404, internet says xmodem
2018-10-20 20:07:35 +02:00
CRC_TYPE = 'crc-aug-ccitt'
2018-03-11 21:30:10 +01:00
STORED_VALUES = [
2018-11-07 19:15:04 +01:00
StoredValue('U_bat', 0.0, 20.0),
StoredValue('U_mod1', 0.0, 20.0),
StoredValue('U_mod2', 0.0, 20.0),
StoredValue('I_pv_in', 0.0, 100.0),
StoredValue('I_load_total', 0.0, 100.0),
StoredValue('load_switch', 0, 1),
StoredValue('max_charge_bat_day', 0.0, 1000.0),
StoredValue('max_charge_load_day', 0.0, 1000.0),
StoredValue('SOC', 0.0, 1000.0)
2018-03-11 21:30:10 +01:00
]
2018-04-27 02:03:42 +02:00
GRAPHS = {
2018-11-07 19:15:04 +01:00
'voltages': [
GraphLine('U_bat', 'Spannung Batterie [V]', '#ff0000'),
GraphLine('U_mod1', 'Spannung Modul 1 [V]', '#00ff00'),
GraphLine('U_mod2', 'Spannung Modul 2 [V]', '#0000ff'),
],
'currents': [
GraphLine('I_pv_in', 'Strom PV [A]', '#ff0000'),
GraphLine('I_load_total', 'Strom Last [A]', '#00ff00'),
],
'relay': [
GraphLine('load_switch', 'Relay', '#0000ff'),
],
'charges': [
GraphLine('max_charge_bat_day', 'Max. Batterie Ladung [Ah]',
'#0000ff'),
GraphLine('max_charge_load_day', 'Max. Last Entladung [Ah]',
'#ff0000'),
],
'soc': [
2018-11-07 19:26:35 +01:00
GraphLine('SOC', 'State Of Charge', '#ff0000'),
2018-11-07 19:15:04 +01:00
]
}
2018-03-11 21:30:10 +01:00
2018-11-07 19:15:04 +01:00
FORMAT = [
'Version', 'Date', 'Time', 'U_bat', 'U_mod1', 'U_mod2', 'SOC', 'SOH',
'I_bat_total', 'I_pv_max1', 'I_pv_max2', 'I_pv_in', 'I_charge_total',
'I_load_device', 'I_load_total', 'T_bat', 'error', 'charge_mode',
'load_switch', 'relais_aux1', 'relais_aux2', 'max_charge_bat_day',
'max_charge_bat_ever', 'max_charge_load_day', 'max_charge_load_ever',
'derating'
]