ebuild_rasp2/ebuild/config_statics.py

159 lines
5.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# -*- coding: utf-8 -*-
from __future__ import annotations
__title__ = "ebuild_config_statics"
__author__ = 'Mehmet Karatay & "Saraswati" (ChatGPT)'
__purpose__ = "Bina ve donanım topolojisi için statik konfigürasyon"
__version__ = "0.3.0"
__date__ = "2025-11-22"
"""
ebuild/config_statics.py
Statik (mimari) konfigürasyon
-----------------------------
Bu dosyada bina ve donanım topolojisine ait, sık değişmeyen ayarlar tutulur.
Rasp2 pin eşlemeleri, brülör topolojisi, bina/geo bilgileri vb.
"""
# -------------------------------------------------
# Brülör çalışma modu
# -------------------------------------------------
# F : Dış ısıya bağlı kazan kontrolü
# B : Bina ortalama sıcaklığa bağlı kontrol
BUILD_BURNER = "F" # ilk deneme F
BURNER_DEFAULT_ID = 0 # seçili brülör id
# -------------------------------------------------
# Bina kimliği / konum
# -------------------------------------------------
BUILDING_NAME = "Gunes Apt"
BUILDING_LOCATION = "Ankara"
BUILDING_LABEL = "Resat Nuri"
GEO_CITY = "Ankara"
GEO_COUNTRY = "Turkey"
GEO_TZ = "Europe/Istanbul"
GEO_LAT = 39.92077
GEO_LON = 32.85411
# Lisans ve sistem ana anahtarı
BUILDING_LICENCEID = 10094
BUILDING_SYSTEMONOFF = 1 # 1=On, 0=Off
# -------------------------------------------------
# Daire / oda topolojisi (DS18B20)
# -------------------------------------------------
# Her kayıt: bina içindeki flat/room dağılımı
FLAT_AREA = [
{"serial": "28-00000660e983", "flat_no": 2, "room_no": 0, "floor": 1, "direction": 5, "size_m2": 0.0},
{"serial": "28-0000066144f9", "flat_no": 22, "room_no": 0, "floor": 1, "direction": 7, "size_m2": 0.0},
{"serial": "28-000006605827", "flat_no": 11, "room_no": 0, "floor": 4, "direction": 1, "size_m2": 0.0},
{"serial": "28-000005fd46c4", "flat_no": 24, "room_no": 0, "floor": 2, "direction": 7, "size_m2": 0.0},
{"serial": "28-00000660dc99", "flat_no": 25, "room_no": 0, "floor": 2, "direction": 7, "size_m2": 0.0},
{"serial": "28-00000141b977", "flat_no": 28, "room_no": 0, "floor": 2, "direction": 7, "size_m2": 0.0},
{"serial": "28-000006616fc3", "flat_no": 6, "room_no": 0, "floor": 2, "direction": 1, "size_m2": 0.0},
{"serial": "28-00000660ca02", "flat_no": 1, "room_no": 0, "floor": 1, "direction": 4, "size_m2": 0.0},
]
# -------------------------------------------------
# Hat sensörleri (tamamen DS18B20)
# -------------------------------------------------
# Dış ısı
OUTSIDE_SENSOR_ID = "28-000000b2aa05"
OUTSIDE_SENSOR_NAME = "Dış Isı 1"
# Kazan çıkış
BURNER_OUT_SENSOR_ID = "28-946778126461"
BURNER_OUT_SENSOR_NAME = "Çıkış Isı 2"
# Dönüş hatları
RETURN_LINE_SENSOR_IDS = [
"28-566978126461",
"28-506478126461",
"28-46fa45126461",
]
RETURN_LINE_SENSOR_NAME_MAP = {
"28-566978126461": "Kuzey Hat4",
"28-506478126461": "Güney Hat3",
"28-46fa45126461": "Guney Bat, 5",
}
# -------------------------------------------------
# Donanım / röle / pin eşlemeleri
# -------------------------------------------------
GPIO_BOARD_REVISION = 3
BURNER_IGNITER_CH = "igniter"
RELAY_GPIO = {
"igniter": 16,
"circulation_a": 26,
"circulation_b": 24,
}
# Brülör grupları RelayDriver buradan beslenir
BURNER_GROUPS = {
0: {
"name": "MainBurner",
"location": "Sol binada",
"igniter_pin": 16, # BCM 16 → phys 36 (örnek)
"circulation": {
"circ_1": {"channel": "circulation_a", "pin": 26, "default": 1},
"circ_2": {"channel": "circulation_b", "pin": 24, "default": 0},
},
},
# 1: {...} # ilerde ikinci brülör
}
# Temel röle kanalları (soyut isim → GPIO)
RELAY_GPIO = {
"igniter": 16, # BCM 16, Fiziksel 36
"circulation_a": 26, # BCM 26, Fiziksel 37
"circulation_b": 24, # BCM 24, Fiziksel 18
"gas_sensor": 22, # BCM 22, Fiziksel 15
"pressure_sensor": 6, # BCM 6, Fiziksel 31
}
PUMP_HAS_DUAL_PUMPS = True
PUMP_FEEDBACK_INPUT_PINS = []
PUMP_ROTATE_HOURS_DEFAULT = 24
# -------------------------------------------------
# Buzzer + RGB LED
# -------------------------------------------------
BUZZER_ENABLE = 1
BUZZER_ACTIVE_HIGH = True
BUZZER_BASE_FREQ = 2000 # Hz
BUZZER_PATTERNS = {
"cfg_reload": [
(1, 10),
],
"startup": [
(1, 80),
(0, 0),
],
"shutdown": [[200, 0, 1]],
"reload": [[300, 100, 1], [120, 100, 1], [300, 0, 1]],
"alarm": [[500, 200, 2], [500, 200, 2], [500, 200, 2]],
}
OUTPUT_GPIO = {
"buzzer": 18, # BCM 18, Fiziksel 12 - PWM buzzer
"rgb_r": 12, # BCM 12, Fiziksel 32 - PWM kırmızı
"rgb_g": 13, # BCM 13, Fiziksel 33 - PWM yeşil
"rgb_b": 19, # BCM 19, Fiziksel 35 - PWM mavi
"led": 23, # BCM 23, Fiziksel 16 - basit LED
}
RGB_ORDER = "GRB"
RGB_COMMON_ANODE = False
RGB_BASE_FREQ = 1000 # Hz
INPUT_GPIO = {
"button": 21, # BCM 21, Fiziksel 40
"burner_contactor": 20, # BCM 20, Fiziksel 38
"circulation_contactor1": 27, # BCM 27, Fiziksel 13
"circulation_contactor2": 17, # BCM 17, Fiziksel 11
}