# SECURITY

## Before using this device you have to change the default password for the user admin. This password will be used for the AP mode hotspot, the web interface (where you are now) and the over-the-air updates.

New Password
Repeat password
Password must be 8..63 characters (numbers and letters and any of these special characters: _,.;:~!?@#$%^&*<>\|(){}[]) and have at least one lowercase and one uppercase or one number.

# STATUS

## Current configuration

Packet count
Node count
Manufacturer
Device
Chip ID
Wifi MAC
SDK version
Core version
Firmware name
Firmware version
Firmware build date
Firmware size
Free space
Network
BSSID
Channel
RSSI
IP
(telnet)
Free heap
Load average
%
VCC
? mV
MQTT Status
NTP Status
Current time
Uptime
Last update
? seconds ago

# GENERAL

## General configuration values

Hostname
This name will identify this device in your network (http://<hostname>.local).
Hostname may contain only the ASCII letters 'a' through 'z' (in a case-insensitive manner), the digits '0' through '9', and the hyphen ('-'). They can neither start or end with an hyphen.
For this setting to take effect you should restart the wifi interface by clicking the "Reconnect" button.
Description
Human-friendly name for your device. Will be reported with the heartbeat.
You can use this to specify the location or some other identification information.
Click repeat delay
Delay in milliseconds to detect a double or triple click (from 0 to 1000ms).
The lower this number the faster the device will respond to button clicks but the harder it will be to get the expected event. Increase this number if you are having trouble triggering the event. Set this value to 0 to disable repeat detection, device will respond immediately to a single button click. When using default configuration, consider that this will disable the SoftAP button action.
You will have to reboot the device to apply this setting.
Alexa integration
Alexa device name
This name will be used in Alexa integration.
Heartbeat messages
Heartbeat interval
How often the heartbeat messages should be sent (number of seconds).
Heartbeat report
Enable / disable heartbeat messages.

# LED

## Notification LED configuration

Available modes
- WiFi status will blink at 1Hz when trying to connect. If successfully connected it will briefly blink every 5 seconds if in STA mode or every second if in AP mode.
- Follow switch will force the LED to follow the status of a given switch (you must define which switch to follow in the side field).
- Inverse switch will force the LED to not-follow the status of a given switch (you must define which switch to follow in the side field).
- Find me will turn the LED ON when all switches are OFF. This is meant to locate switches at night.
- Find me & WiFi will follow the WiFi status but will stay mostly on when switches are OFF, and mostly OFF when any of them is ON.
- Switches status will turn the LED ON whenever any switch is ON, and OFF otherwise. This is global status notification.
- Switches status & WiFi will follow the WiFi status but will stay mostly off when switches are OFF, and mostly ON when any of them is ON.
- Manually managed will let you manage the LED status via MQTT by sending a message to "<base_topic>/led/0/set" with a payload of 0, 1 or 2 (to toggle it).
- Always ON and Always OFF modes are self-explanatory.

# SWITCHES

## Switch / relay configuration

General
Switch sync mode
Define how the different switches should be synchronized.
Interlock delay

# CURTAIN

## Curtain configuration

General
Curtain type
Define your curtain type. It adapts the graphical view in status menu.
Curtain bootup position
Define the initial position of the curtain after a reboot or power loss.

# LIGHTS

## Lights configuration

Light state switch
If enabled, add virtual relay switch that controls the ON / OFF state.
Save values
Save channel & brightness values in settings
Save delay
When "Save values" is enabled, wait for the delay (ms) before the values are saved
Use color
Use the first three channels as RGB channels. This will also enable the color picker in the web UI. Will only work if the device has at least 3 dimmable channels.
Reload the page to update the web interface.
Use RGB picker
Use RGB color picker if enabled (plus brightness), otherwise use HSV (hue-saturation-value) style
Use white channel
For 2 channels warm white and cold white lights or color lights to use forth dimmable channel as (cold) white light calculated out of the RGB values.
Will only work if the device has at least 4 dimmable channels.
Enabling this will render useless the "Channel 4" slider in the status page.
Reload the page to update the web interface.
Use white color temperature
Use a dimmable channel as warm white light and another dimmable channel as cold white light.
On devices with two dimmable channels the first use used for warm white light and the second for cold white light.
On color lights the fifth use used for warm white light and the fourth for cold white light.
Will only work if the device has exactly 2 dimmable channels or at least 5 dimmable channels and "white channel" above is also ON.
Enabling this will render useless the "Channel 5" slider in the status page.
Reload the page to update the web interface.
Use gamma correction
Use gamma correction for RGB channels.
Will only work if "use colorpicker" above is also ON.
Use CSS style
WARNING! Incompatible with Home Assistant MQTT integration
Use CSS style to report colors to MQTT and REST API.
Red will be reported as "#FF0000" if ON, otherwise "255,0,0"
Channel transitions
If enabled, channel changes will be smoothed.
Transition time
Time to transition from one color to another (ms)
Transition step
(ms, depends on the transition time)
MQTT group
Sync color between different lights.

# ADMINISTRATION

## Device administration and security settings

Settings
Admin password
The administrator password is used to access this web interface (user 'admin'), but also to connect to the device when in AP mode or to flash a new firmware over-the-air (OTA).
It must be 8..63 characters (numbers and letters and any of these special characters: _,.;:~!?@#$%^&*<>\|(){}[]) and have at least one lowercase and one uppercase or one number.
HTTP port
This is the port for the web interface and API requests. If different than 80 (standard HTTP port) you will have to add it explicitly to your requests: http://myip:myport/
Enable WS Auth
Enable HTTP API
Restful API
If enabled, API requests to change a status (like a relay) must be done using PUT. If disabled you can issue them as GET requests (easier from a browser).
Real time API
By default, some magnitudes are being preprocessed and filtered to avoid spurious values. If you want to get real-time values (not preprocessed) in the API turn on this setting.
HTTP API Key
This is the key you will have to pass with every HTTP request to the API, either to get or write values. All API calls must contain the apikey parameter with the value above. To know what APIs are enabled do a call to /apis.
Enable TELNET
Turn ON to be able to telnet to your device while connected to your home router.
TELNET is always enabled in AP mode.
TELNET Password
Request password when starting telnet session
Upgrade
The device has bytes available for OTA updates. If your image is larger than this consider doing a two-step update.

# WIFI

## You can configure up to 5 different WiFi networks. The device will try to connect in order of signal strength.

General
Device hostname can be configured on the GENERAL tab.
Scan networks
ESPurna will scan for visible WiFi SSIDs and try to connect to networks defined below in order of signal strength, even if multiple AP share the same SSID. When disabled, ESPurna will try to connect to the networks in the same order they are listed below. Disable this option if you are connecting to a single access point (or router) or to a hidden SSID.
Networks

# SCHEDULE

## Turn switches ON and OFF based on the current time.

# MAPPING

## Configure the map between nodeID/key and MQTT topic. Messages from the given nodeID with the given key will be forwarded to the specified topic. You can also configure a default topic using {nodeid} and {key} as placeholders, if the default topic is empty messages without defined map will be discarded.

Default topic
Specific topics

# MESSAGES

## Messages being received. Previous messages are not displayed. You have to keep the page open in order to keep receiving them. You can filter/unfilter by clicking on the values. Left click on a value to show only rows that match that value, middle click to show all rows but those matching that value. Filtered colums have red headers.

Timestamp | SenderID | PacketID | TargetID | Key | Value | RSSI | Duplicates | Missing
--- | --- | --- | --- | --- | --- | --- | --- | ---

# MQTT

## Configure an MQTT broker in your network and you will be able to change the switch status via an MQTT message.

Enable MQTT
MQTT Broker
MQTT Port
MQTT User
You can use the following placeholders: {hostname}, {mac}
MQTT Password
MQTT Client ID
If left empty the firmware will generate a client ID based on the serial number of the chip. You can use the following placeholders: {hostname}, {mac}
MQTT QoS
MQTT Retain
MQTT Keep Alive
Use secure connection (SSL)
SSL Fingerprint
This is the fingerprint for the SSL certificate of the server.
You can get it using https://www.grc.com/fingerprints.htm
or using openssl from a linux box by typing:

    $ openssl s_client -connect <host>:<port> < /dev/null 2>/dev/null | openssl x509 -fingerprint -noout -in /dev/stdin

MQTT Root Topic
This is the root topic for this device. The {hostname} and {mac} placeholders will be replaced by the device hostname and MAC address.
- <root>/relay/#/set Send a 0 or a 1 as a payload to this topic to switch it on or off. You can also send a 2 to toggle its current state. Replace # with the switch ID (starting from 0). If the board has only one switch it will be 0.
- <root>/curtain/set Set the curtain opening value (0-100), 0 means closed, 100 opened. "on", "off", "pause" pilots buttons.
- <root>/rgb/set Set the color using this topic, your can either send an "#RRGGBB" value or "RRR,GGG,BBB" (0-255 each).
- <root>/hsv/set Set the color using hue (0-360), saturation (0-100) and value (0-100) values, comma separated.
- <root>/brightness/set Set the brighness (0-255).
- <root>/channel/#/set Set the value for a single color channel (0-255). Replace # with the channel ID (starting from 0 and up to 4 for RGBWC lights).
- <root>/mired/set Set the temperature color in mired.
- <root>/status The device will report a 1 to this topic every few minutes. Upon MQTT disconnecting this will be set to 0.
- Other values reported (depending on the build) are: firmware and version, hostname, IP, MAC, signal strenth (RSSI), uptime (in seconds), free heap and power supply.
Use JSON payload
All messages (except the device status) will be included in a JSON payload along with the timestamp and hostname and sent under the <root>/data topic.
Messages will be queued and sent after 100ms, so different messages could be merged into a single payload.
Subscriptions will still be done to single topics.

# NoFUSS

## Automatically upgrade the firmware (see xoseperez/nofuss for details)

Enable
Server
Address of the NoFUSS server

# NTP

## Synchronize the device time with the remote server

Device Time
Device Local Time
NTP Server
Time Zone
POSIX TZ variable, defaults to `UTC0`
For the list of possible options, see esp8266/Arduino's TZ.h (use the value inside of F("...")). For the complete documentation, see libc tzset(3) manual page

# GARLAND

## Garland configuration

Enable Garland
Brightness
Speed

# THERMOSTAT

## Thermostat configuration

Enable Thermostat
Thermostat Mode
Operation mode
Temperature range
Max ()
Min ()
Remote sensor
Remote sensor name
Remote temperature ()
Remote temperature waiting (s)
Operation mode
Max heating time (m)
Min rest time (m)
Autonomous mode
Heating time (m)
Rest time (m)
Time worked
Today
Yesterday
Current month
Previous month
Total

# DOMOTICZ

## Configure the connection to your Domoticz server.

General
Enable Domoticz
Domoticz IN Topic
Domoticz OUT Topic
Sensors & actuators
Set IDX to 0 to disable notifications from that component.

# HOME ASSISTANT

## Add this device to your Home Assistant.

Discovery
Enabled
Home Assistant MQTT discovery. Enable / disable, then save to trigger the update.
Prefix
The prefix for the discovery topic e.g. `<prefix>/switch/espurna-123456/config`
MQTT
Retain
Set the Retain flag when sending the messages.

# THINGSPEAK

## Send your sensors data to Thingspeak.

General
Enable Thingspeak
Clear cache
With every POST to thinkspeak.com only enqueued fields are sent. If you select to clear the cache after every sending this will result in only those fields that have changed will be posted. If you want all fields to be sent with every POST do not clear the cache.
Thingspeak address
Thingspeak API Key
Sensors & actuators
Enter the field number to send each data to, 0 disable notifications from that component.

# INFLUXDB

## Configure the connection to your InfluxDB server. Leave the host field empty to disable InfluxDB connection.

Enable InfluxDB
Host
Port
Database
Username
Password

# RULES

## Here you can configure advanced rules based on RPN expressions. Check the wiki page about the RPN Rules module to know how to use them.

Configuration
Sticky variables
Sticky variables are persistent, once defined the first time they will be always available until next reboot (they do not persist across reboots). Non sticky variables are only available during the next rule execution, just after being defined, and then removed. This applies to status, sensor and MQTT variables equally. Mind that calling a non-existing variable from a rule will make it silently fail.
Execution delay (ms)
Rules
MQTT
MQTT Topic
Variable Name

# DEBUG LOG

## Shows debug messages from the device

Write a command and click send to execute it on the device. The output will be shown in the debug text area below. Type "debug" to display MCU serial exchanges. Any other command is sent to MCU serial as is.

# SENSOR CONFIGURATION

## Configure and calibrate your device sensors.

General
Read interval
Select the interval between readings. These will be filtered and averaged for the report. Please mind some sensors do not have fast refresh intervals. Check the sensor datasheet to know the minimum read interval. The default and recommended value is 6 seconds.
Report every
Select the number of readings to average and report
Save every
Save aggregated data to EEPROM after these many reports. At the moment this only applies to total energy readings. Please mind: saving data to EEPROM too often will wear out the flash memory quickly. Set it to 0 to disable this feature (default value).
Power units
Energy units
Temperature units
Calibrate gas sensor
Move this switch to ON and press "Save" to reset gas sensor calibration. Check the sensor datasheet for calibration conditions.
Energy monitor
Voltage
Mains voltage in your system (in V).
Expected Current
In Amperes (A). If you are using a pure resistive load like a bulb, this will be the ratio between the two previous values, i.e. power / voltage. You can also use a current clamp around one of the power wires to get this value.
Expected Voltage
In Volts (V). Enter your the nominal AC voltage for your household or facility, or use multimeter to get this value.
Expected Power
In Watts (W). Calibrate your sensor connecting a pure resistive load (like a bulb) and enter here its nominal power or use a multimeter.
Energy Ratio
Energy ratio in pulses/kWh.
Reset calibration
Move this switch to ON and press "Save" to revert to factory calibration values.
Reset energy
Move this switch to ON and press "Save" to set energy count to 0.
Value corrections
Correction value is added to the measured value which may be inaccurate due to many factors. The value can be negative.

# RADIO FREQUENCY

## Sonoff 433 RF Bridge & RF Link Configuration
This page allows you to configure the RF codes for the Sonoff RFBridge 433 and also for a basic RF receiver.
To learn a new code click LEARN (the Sonoff RFBridge will beep) then press a button on the remote, the new code should show up (and the RFBridge will double beep). If the device double beeps but the code does not update it has not been properly learnt. Keep trying.
Modify or create new codes manually and then click SAVE to store them in the device memory. If your controlled device uses the same code to switch ON and OFF, learn the code with the ON button and copy paste it to the OFF input box, then click SAVE on the last one to store the value.
Delete any code clicking the FORGET button.
You can also specify any RAW code. For reference see possible commands for Sonoff RF Bridge EFM8BB1 (original firmware supports codes from 0xA0 to 0xA5).

RF Codes
Settings
Repeats
Number of times to repeat transmission
GPIO
Pins used by the receiver (RX) and transmitter (TX). Set to NONE to disable
RX Pin
TX Pin

# LIGHTFOX RF

## LightFox RF configuration
This page allows you to control LightFox RF receiver options.
To learn a new code click LEARN, wait for 3 seconds then press a button on the remote, one of the relays will toggle. If no device relay toggles the code has not been properly learnt. Keep trying.
Delete all the codes by clicking the CLEAR button and wait for 10 seconds.
You can also specify which RF button controls which relay using controls below.

RF Actions
LED #
GPIO
Mode
Relay ID
Switch #
Switch ON
Switch OFF
Button #
Network SSID
Password Static IP
Leave empty for DHCP negotiation
Gateway IP
Set when using a static IP
Network Mask
Usually 255.255.255.0 for /24 networks
DNS IP
Set the Domain Name Server IP to use when using a static IP
When time is
h
m
Use UTC time
And weekday is one of
1 for Monday, 2 for Tuesday etc., comma separated
Enabled
Action
Brightness
Curtain position (0 = open to 100 = closed)
()
Boot mode
Pulse mode
Pulse time (s)
Restore last schedule
MQTT group
MQTT group sync
On MQTT disconnect
Switch
Magnitude
Switch
Magnitude
Brightness
Channel #
Mireds (Cold ↔ Warm)