-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser_config.h
More file actions
57 lines (45 loc) · 2.37 KB
/
user_config.h
File metadata and controls
57 lines (45 loc) · 2.37 KB
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
/*
* user_config.h
*
* User specific configuration parameters
*/
#define PROJECT "garage_door" // PROJECT is used as the default topic delimiter and OTA file name
#define CFG_HOLDER 0x20160520 // Change this value to load default configurations
// Wifi
#define STA_SSID "" // Wifi SSID
#define STA_PASS "" // Wifi password
#define WIFI_HOSTNAME "esp-%06x-%s" // Expands to esp-<last 6 chars of MAC address>-<MQTT_TOPIC>
// Syslog
#define SYS_LOG_HOST "192.168.1.200"
#define SYS_LOG_PORT 514
#define SYS_LOG_LEVEL LOG_LEVEL_NONE
#define SERIAL_LOG_LEVEL LOG_LEVEL_INFO
// Ota
#if (ARDUINO >= 168)
#define OTA_URL "http://192.168.1.200:80/files/sonoff/firmware/" PROJECT ".ino.bin"
#else
#define OTA_URL "http://192.168.1.200:80/files/sonoff/firmware" PROJECT ".cpp.bin"
#endif
// MQTT
#define MQTT_HOST "192.168.1.200"
#define MQTT_PORT 1883
#define MQTT_CLIENT_ID "DVES_%06X" // Also fall back topic using Chip Id = last 6 characters of MAC address
#define MQTT_USER "DVES_USER"
#define MQTT_PASS "DVES_PASS"
#define SUB_PREFIX "cmnd" // Sonoff devices subscribe to:- cmnd/MQTT_TOPIC and cmnd/MQTT_GRPTOPIC
#define PUB_PREFIX "stat" // Sonoff devices publish to:- stat/MQTT_TOPIC
#define MQTT_TOPIC PROJECT
#define MQTT_GRPTOPIC PROJECT"s" // Group topic
// Time - Up to three NTP servers in your region
#define NTP_SERVER1 "pool.ntp.org"
#define NTP_SERVER2 "nl.pool.ntp.org"
#define NTP_SERVER3 "0.nl.pool.ntp.org"
// Time - Start Daylight Saving Time and timezone offset from UTC in minutes
#define TIME_DST Last, Sun, Mar, 2, +120 // Last sunday in march at 02:00 +120 minutes
// Time - Start Standard Time and timezone offset from UTC in minutes
#define TIME_STD Last, Sun, Oct, 3, +60 // Last sunday in october 02:00 +60 minutes
// Application
#define MQTT_SUBTOPIC "POWER"
#define APP_TIMEZONE 1 // +1 hour (Amsterdam) (-12 .. 12 = hours from UTC, 99 = TIME_DST/TIME_STD usage)
#define APP_POWER 0 // Saved power state Off
#define APP_LEDSTATE 1 // Do not show power state (1 = Show power state)