forked from zaubererty/homeassistant-4heat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
const.py
144 lines (126 loc) · 3.92 KB
/
const.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
"""Constants for the 4Heat integration."""
from datetime import timedelta
from homeassistant.const import (
TEMP_CELSIUS,
PRESSURE_PA,
PRESSURE_MBAR,
TIME_HOURS,
)
DOMAIN = "4heat"
ATTR_STOVE_ID = "stove_id"
ATTR_READING_ID = "reading_id"
ATTR_MARKER = "marker"
ATTR_NUM_VAL = "num_val"
DATA_QUERY = b'["SEL","0"]'
ERROR_QUERY = b'["SEC","3","I30001000000000000","I30002000000000000","I30017000000000000"]'
UNBLOCK_CMD = b'["SEC","1","J30255000000000001"]' # Unblock
OFF_CMD = b'["SEC","1","J30254000000000001"]' # OFF
ON_CMD = b'["SEC","1","J30253000000000001"]' # ON
OFF_CMD_OLD = b'["SEC","1","1"]' # OFF
ON_CMD_OLD = b'["SEC","1","0"]' # ON
MODES = [[ON_CMD, OFF_CMD, UNBLOCK_CMD], [ON_CMD_OLD, OFF_CMD_OLD, None]]
CONF_MODE = 'mode'
CMD_MODE_OPTIONS = ['Full set (default)', 'Limited set']
RESULT_VALS = 'SEC'
RESULT_ERROR = 'ERR'
TCP_PORT = 80
SOCKET_BUFFER = 1024
SOCKET_TIMEOUT = 10
DATA_COORDINATOR = "coordinator"
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=20)
MODE_TYPE = "30001"
ERROR_TYPE = "30002"
POWER_TYPE = "20575"
ROOM_TYPE ="50006"
CONSERVATION_TYPE="50138"
STOVE_TYPE = {
"GODIIN PELLET STOVE": [564, "GODIN", "ARTEMIS"],
}
SENSOR_TYPES = {
"20801": ["Heating power", None, ""],
"20118": ["Service Time", TIME_HOURS, ""],
"20119": ["UN 20119", None, ""],
"20364": ["Combustion", None, ""],
"20369": ["UN 20369", None, ""],
"20493": ["Room temperature set point", TEMP_CELSIUS, ""],
"20570": ["UN 20570", None, ""],
"20575": ["Heat Power", None, ""],
"20614": ["UN 20614", None, ""],
"20638": ["UN 20638", None, ""],
"30001": ["State", None, ""],
"30002": ["Error", None, ""],
"30003": ["Timer", None, ""],
"30004": ["Ignition", None, ""],
"30005": ["Exhaust temperature", TEMP_CELSIUS, ""],
"30007": ["Inputs", None, ""],
"30011": ["Combustion power", None, ""],
"30012": ["Puffer temperature", TEMP_CELSIUS, ""],
"30017": ["UN 30017", TEMP_CELSIUS, ""],
"30020": ["UN 30020", PRESSURE_MBAR, ""],
"30026": ["Fireplace", TEMP_CELSIUS, ""],
"30033": ["Exhaust depression", PRESSURE_PA, ""],
"30142": ["Contrast", None, ""],
"30143": ["UN 30143", None, ""],
"30144": ["UN 30144", None, ""],
"50006": ["Room temperature", TEMP_CELSIUS, ""],
"50046": ["UN 50046", None, ""],
"50053": ["UN 50053", None, ""],
"50138": ["Room termostat", TEMP_CELSIUS, ""],
"50139": ["UN 50139", None, ""],
"50140": ["UN 50140", None, ""],
}
MODE_NAMES = {
0: "OFF",
1: "Check Up",
2: "Ignition",
3: "Stabilization",
4: "Ignition",
5: "Run",
6: "Modulation",
7: "Extinguishing",
8: "Safety",
9: "Block",
10: "Recover Ignition",
11: "Standby",
30: "Ignition",
31: "Ignition",
32: "Ignition",
33: "Ignition",
34: "Ignition",
}
ERROR_NAMES = {
0: "No",
1: "Safety Thermostat HV1: signalled also in case of Stove OFF",
2: "Safety PressureSwitch HV2: signalled with Combustion Fan ON",
3: "Extinguishing for Exhausting Temperature lowering",
4: "Extinguishing for water over Temperature",
5: "Extinguishing for Exhausting over Temperature",
6: "unknown",
7: "Encoder Error: No Encoder Signal (in case of P25=1 or 2)",
8: "Encoder Error: Combustion Fan regulation failed (in case of P25=1 or 2)",
9: "Low pressure in to the Boiler",
10: "High pressure in to the Boiler Error",
11: "DAY and TIME not correct due to prolonged absence of Power Supply",
12: "Failed Ignition",
13: "Ignition",
14: "Ignition",
15: "Lack of Voltage Supply",
16: "Ignition",
17: "Ignition",
18: "Lack of Voltage Supply",
}
POWER_NAMES = {
1: "P1",
2: "P2",
3: "P3",
4: "P4",
5: "P5",
6: "P6",
7: "Auto",
}
CLIMATE_MODE = {
"State": ["30001", None, ""],
"Temperature": ["50006", TEMP_CELSIUS, ""],
"Termostate": ["50138", TEMP_CELSIUS, ""],
"Combustao": ["30005", TEMP_CELSIUS, ""],
}