2018-10-01 23:26:07 +02:00
|
|
|
//Replace with your Wifi SSID; example: #define ssid "MyWifi"
|
|
|
|
#define ssid "$SSID$"
|
|
|
|
|
|
|
|
//Replace with your Wifi password; example: #define password "12345678"
|
|
|
|
#define password "$WIFI_PASSWORD$"
|
|
|
|
|
2018-12-10 19:54:02 +01:00
|
|
|
//Replace with a human-friendly host name. Must not contain spaces or special characters
|
2018-10-01 23:26:07 +02:00
|
|
|
#define hostname "esp32_room_presence"
|
|
|
|
|
2018-10-13 04:39:31 +02:00
|
|
|
//Replace with your MQTT Broker address; example: #define mqttHost IPAddress(192, 168, 1, 195)
|
|
|
|
#define mqttHost IPAddress(192, 168, 1, 195)
|
2018-10-01 23:26:07 +02:00
|
|
|
|
|
|
|
//Replace with your MQTT Broker port; example: #define mqttPort 1883
|
|
|
|
#define mqttPort $MQTT_PORT$
|
|
|
|
|
|
|
|
//Replace with your MQTT Broker user; example: #define mqttUser "homeassistant"
|
2018-12-10 19:54:02 +01:00
|
|
|
#define mqttUser "$MQTT_USER$"
|
2018-10-01 23:26:07 +02:00
|
|
|
|
|
|
|
//Replace with your MQTT Broker password; example: #define mqttPassword "12345678"
|
|
|
|
#define mqttPassword "$MQTT_PASSWORD"
|
|
|
|
|
|
|
|
//Replace with the room name where the node will be placed; example: #define room "living-room"
|
|
|
|
#define room "$ROOM_NAME$"
|
2018-10-02 02:01:29 +02:00
|
|
|
|
2018-12-26 20:55:33 +01:00
|
|
|
//Specify the LED pin. For most dev boards, this is GPIO2
|
|
|
|
#define LED_BUILTIN 2
|
|
|
|
|
|
|
|
// Logic level for turning the led on. Most boards use active low, meaning LED_ON should be set to 0
|
|
|
|
#define LED_ON 0
|
|
|
|
|
2018-10-02 02:01:29 +02:00
|
|
|
//Define the base topic for room detection. Usually "room_presence"
|
|
|
|
#define channel "room_presence"
|
2018-10-03 22:53:25 +02:00
|
|
|
|
2018-12-10 20:21:06 +01:00
|
|
|
//Define the topic for publishing availability
|
2018-12-19 02:53:46 +01:00
|
|
|
#define availabilityTopic "presence_nodes/" room
|
2018-12-10 20:21:06 +01:00
|
|
|
|
|
|
|
// Define bluetooth scan parameters
|
2019-01-13 15:42:24 +01:00
|
|
|
#define scanInterval 2 // Define the interval in seconds between scans
|
2019-03-25 22:09:24 +01:00
|
|
|
#define singleScanTime 10 // Define the duration of a single scan in seconds
|
|
|
|
#define activeScan true // Active scan uses more power, but get results faster
|
2019-03-30 00:47:28 +01:00
|
|
|
|
|
|
|
// The two following settings relate to bluetooth / WiFi coexistence and antenna usage. Do not modify unless you know what you're doing
|
|
|
|
|
|
|
|
/*
|
|
|
|
Scan interval. This is defined as the time interval from
|
|
|
|
when the Controller started its last LE scan until it begins the subsequent LE scan.
|
|
|
|
Range: 0x0004 to 0x4000 Default: 0x0010 (10 ms)
|
|
|
|
Time = N * 0.625 msec
|
|
|
|
Time Range: 2.5 msec to 10.24 seconds
|
|
|
|
*/
|
|
|
|
#define bleScanInterval 0x80
|
|
|
|
|
|
|
|
/*
|
|
|
|
Scan window. The duration of the LE scan. LE_Scan_Window
|
|
|
|
shall be less than or equal to LE_Scan_Interval
|
|
|
|
Range: 0x0004 to 0x4000 Default: 0x0010 (10 ms)
|
|
|
|
Time = N * 0.625 msec
|
|
|
|
Time Range: 2.5 msec to 10240 msec
|
|
|
|
*/
|
|
|
|
#define bleScanWindow 0x10 // (milliseconds)
|
2019-01-13 15:42:24 +01:00
|
|
|
|
|
|
|
// Maximum distance (in meters) to report. Devices that are calculated to be further than this distance in meters will not be reported
|
|
|
|
#define maxDistance 5
|