forked from fliphess/esp8266_p1meter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.h
67 lines (52 loc) · 1.49 KB
/
settings.h
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
// **********************************
// * Ledstrip Settings *
// **********************************
// * Baud rate for both hardware and software serial
#define BAUD_RATE 115200
// * P1 Meter RX pin
#define P1_SERIAL_RX D2
// * Max telegram length
#define P1_MAXLINELENGTH 1024
// * The hostname of our little creature
#define HOSTNAME "p1meter"
// * The password used for OTA
#define OTA_PASSWORD "admin"
// * Wifi timeout in milliseconds
#define WIFI_TIMEOUT 30000
// * MQTT network settings
#define MQTT_MAX_RECONNECT_TRIES 10
// * MQTT root topic
#define MQTT_ROOT_TOPIC "sensors/power/p1meter"
// * MQTT Last reconnection counter
long LAST_RECONNECT_ATTEMPT = 0;
// * To be filled with EEPROM data
char MQTT_HOST[64] = "";
char MQTT_PORT[6] = "";
char MQTT_USER[32] = "";
char MQTT_PASS[32] = "";
// * Set to store received telegram
char telegram[P1_MAXLINELENGTH];
// * Set to store the data values read
long CONSUMPTION_LOW_TARIF;
long DELIVERY_LOW_TARIF;
long CONSUMPTION_HIGH_TARIF;
long DELIVERY_HIGH_TARIF;
long ACTUAL_CONSUMPTION;
long ACTUAL_DELIVERY;
long L1_INSTANT_POWER_CURRENT;
long L2_INSTANT_POWER_CURRENT;
long L3_INSTANT_POWER_CURRENT;
long INSTANT_POWER_USAGE;
long GAS_METER_M3;
// * Set to Store Line Voltage
long L1_VOLTAGE;
long L2_VOLTAGE;
long L3_VOLTAGE;
// Set to store data counters read
long ACTUAL_TARIF;
long SHORT_POWER_OUTAGES;
long LONG_POWER_OUTAGES;
long SHORT_POWER_DROPS;
long SHORT_POWER_PEAKS;
// * Set during CRC checking
unsigned int currentCRC = 0;