Merge branch 'arendst/development' into development

# Conflicts:
#	.gitignore
This commit is contained in:
reloxx13 2018-01-14 15:47:11 +01:00
commit 7e9fbdb89b
39 changed files with 3691 additions and 564 deletions

View File

@ -1,7 +1,7 @@
## Sonoff-Tasmota
Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE.
Current version is **5.10.0i** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
Current version is **5.11.1b** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
### ATTENTION All versions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,131 @@
# ESP8266 platform
# ------------------------------
# For more info:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=ESP8266 Modules
version=2.4.0
compiler.warning_flags=-w
compiler.warning_flags.none=-w
compiler.warning_flags.default=
compiler.warning_flags.more=-Wall
compiler.warning_flags.all=-Wall -Wextra
build.lwip_lib=-llwip_gcc
build.lwip_flags=-DLWIP_OPEN_SRC
compiler.path={runtime.tools.xtensa-lx106-elf-gcc.path}/bin/
compiler.sdk.path={runtime.platform.path}/tools/sdk
compiler.libc.path={runtime.platform.path}/tools/sdk/libc/xtensa-lx106-elf
compiler.cpreprocessor.flags=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I{compiler.sdk.path}/include" "-I{compiler.sdk.path}/lwip/include" "-I{compiler.libc.path}/include" "-I{build.path}/core"
compiler.c.cmd=xtensa-lx106-elf-gcc
compiler.c.flags=-c {compiler.warning_flags} -Os -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -std=gnu99 -ffunction-sections -fdata-sections
compiler.S.cmd=xtensa-lx106-elf-gcc
compiler.S.flags=-c -g -x assembler-with-cpp -MMD -mlongcalls
compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u call_user_start -u _printf_float -u _scanf_float -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-L{compiler.libc.path}/lib" "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read
compiler.c.elf.cmd=xtensa-lx106-elf-gcc
compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -lmain -lwps -laxtls -lespnow -lsmartconfig -lairkiss -lmesh -lwpa2 -lstdc++ -lm -lc -lgcc
compiler.cpp.cmd=xtensa-lx106-elf-g++
compiler.cpp.flags=-c {compiler.warning_flags} -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections
compiler.as.cmd=xtensa-lx106-elf-as
compiler.ar.cmd=xtensa-lx106-elf-ar
compiler.ar.flags=cru
compiler.elf2hex.cmd=esptool
compiler.elf2hex.flags=
compiler.size.cmd=xtensa-lx106-elf-size
compiler.esptool.cmd=esptool
compiler.esptool.cmd.windows=esptool.exe
# This can be overriden in boards.txt
build.extra_flags=-DESP8266
# These can be overridden in platform.local.txt
compiler.c.extra_flags=
compiler.c.elf.extra_flags=
compiler.S.extra_flags=
compiler.cpp.extra_flags=
compiler.ar.extra_flags=
compiler.objcopy.eep.extra_flags=
compiler.elf2hex.extra_flags=
## generate file with git version number
## needs bash, git, and echo
## windows-compatible version may be added later
## Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor.flags} {compiler.cpp.flags} -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
## Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.S.flags} -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
## Create archives
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/arduino.ar" "{object_file}"
## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{build.path}/arduino.ar" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}"
## Create eeprom
recipe.objcopy.eep.pattern=
## Create hex
#recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
recipe.objcopy.hex.pattern="{runtime.tools.esptool.path}/{compiler.esptool.cmd}" -eo "{runtime.platform.path}/bootloaders/eboot/eboot.elf" -bo "{build.path}/{build.project_name}.bin" -bm {build.flash_mode} -bf {build.flash_freq} -bz {build.flash_size} -bs .text -bp 4096 -ec -eo "{build.path}/{build.project_name}.elf" -bs .irom0.text -bs .text -bs .data -bs .rodata -bc -ec
## Save hex
recipe.output.tmp_file={build.project_name}.bin
recipe.output.save_file={build.project_name}.{build.variant}.bin
## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
recipe.size.regex=^(?:\.irom0\.text|\.text|\.data|\.rodata|)\s+([0-9]+).*
recipe.size.regex.data=^(?:\.data|\.rodata|\.bss)\s+([0-9]+).*
#recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
# ------------------------------
tools.esptool.cmd=esptool
tools.esptool.cmd.windows=esptool.exe
tools.esptool.path={runtime.tools.esptool.path}
tools.esptool.network_cmd=python
tools.esptool.network_cmd.windows=python.exe
tools.esptool.upload.protocol=esp
tools.esptool.upload.params.verbose=-vv
tools.esptool.upload.params.quiet=
tools.esptool.upload.pattern="{path}/{cmd}" {upload.verbose} -cd {upload.resetmethod} -cb {upload.speed} -cp "{serial.port}" -ca 0x00000 -cf "{build.path}/{build.project_name}.bin"
tools.esptool.upload.network_pattern="{network_cmd}" "{runtime.platform.path}/tools/espota.py" -i "{serial.port}" -p "{network.port}" "--auth={network.password}" -f "{build.path}/{build.project_name}.bin"
tools.mkspiffs.cmd=mkspiffs
tools.mkspiffs.cmd.windows=mkspiffs.exe
tools.mkspiffs.path={runtime.tools.mkspiffs.path}
tools.espupload.cmd=python
tools.espupload.cmd.windows=python.exe
tools.espupload.path={runtime.platform.path}/tools
tools.espupload.upload.protocol=espupload
tools.espupload.upload.params.verbose=
tools.espupload.upload.params.quiet=
tools.espupload.upload.pattern="{cmd}" "{path}/espupload.py" -f "{build.path}/{build.project_name}.bin"

View File

@ -82,35 +82,50 @@ TasmotaSerial::TasmotaSerial(int receive_pin, int transmit_pin)
if (!((isValidGPIOpin(receive_pin)) && (isValidGPIOpin(transmit_pin) || transmit_pin == 16))) {
return;
}
m_buffer = (uint8_t*)malloc(TM_SERIAL_BUFFER_SIZE);
if (m_buffer == NULL) {
return;
}
m_valid = true;
m_rx_pin = receive_pin;
m_tx_pin = transmit_pin;
m_in_pos = m_out_pos = 0;
// Use getCycleCount() loop to get as exact timing as possible
m_bit_time = ESP.getCpuFreqMHz() *1000000 /TM_SERIAL_BAUDRATE;
pinMode(m_rx_pin, INPUT);
ObjList[m_rx_pin] = this;
attachInterrupt(m_rx_pin, ISRList[m_rx_pin], FALLING);
pinMode(m_tx_pin, OUTPUT);
digitalWrite(m_tx_pin, HIGH);
if (m_rx_pin > -1) {
m_buffer = (uint8_t*)malloc(TM_SERIAL_BUFFER_SIZE);
if (m_buffer == NULL) {
return;
}
// Use getCycleCount() loop to get as exact timing as possible
m_bit_time = ESP.getCpuFreqMHz() *1000000 /TM_SERIAL_BAUDRATE;
pinMode(m_rx_pin, INPUT);
ObjList[m_rx_pin] = this;
attachInterrupt(m_rx_pin, ISRList[m_rx_pin], FALLING);
}
if (m_tx_pin > -1) {
pinMode(m_tx_pin, OUTPUT);
digitalWrite(m_tx_pin, HIGH);
}
m_valid = true;
}
bool TasmotaSerial::isValidGPIOpin(int pin)
{
return (pin >= 0 && pin <= 5) || (pin >= 12 && pin <= 15);
return (pin >= -1 && pin <= 5) || (pin >= 12 && pin <= 15);
}
bool TasmotaSerial::begin() {
return m_valid;
}
void TasmotaSerial::flush() {
m_in_pos = m_out_pos = 0;
}
int TasmotaSerial::peek() {
if ((-1 == m_rx_pin) || (m_in_pos == m_out_pos)) {
return -1;
}
return m_buffer[m_out_pos];
}
int TasmotaSerial::read()
{
if (m_in_pos == m_out_pos) {
if ((-1 == m_rx_pin) || (m_in_pos == m_out_pos)) {
return -1;
}
uint8_t ch = m_buffer[m_out_pos];
@ -130,8 +145,11 @@ int TasmotaSerial::available()
//#define TM_SERIAL_WAIT { while (ESP.getCycleCount()-start < wait) optimistic_yield(1); wait += m_bit_time; } // Watchdog timeouts
#define TM_SERIAL_WAIT { while (ESP.getCycleCount()-start < wait); wait += m_bit_time; }
size_t TasmotaSerial::txWrite(uint8_t b)
size_t TasmotaSerial::write(uint8_t b)
{
if (-1 == m_tx_pin) {
return 0;
}
unsigned long wait = m_bit_time;
digitalWrite(m_tx_pin, HIGH);
unsigned long start = ESP.getCycleCount();
@ -149,8 +167,12 @@ size_t TasmotaSerial::txWrite(uint8_t b)
return 1;
}
/*
size_t TasmotaSerial::write(const uint8_t *buffer, size_t size)
{
if (-1 == m_tx_pin) {
return 0;
}
size_t n = 0;
// Flush input buffer on every write
m_in_pos = m_out_pos = 0;
@ -159,6 +181,7 @@ size_t TasmotaSerial::write(const uint8_t *buffer, size_t size)
}
return n;
}
*/
#ifdef TM_SERIAL_USE_IRAM
void ICACHE_RAM_ATTR TasmotaSerial::rxRead()

View File

@ -26,19 +26,30 @@
\*********************************************************************************************/
#define TM_SERIAL_BAUDRATE 9600
#define TM_SERIAL_BUFFER_SIZE 20
#define TM_SERIAL_BUFFER_SIZE 64
//#define TM_SERIAL_USE_IRAM // Enable to use iram (+368 bytes)
class TasmotaSerial {
#include <Stream.h>
class TasmotaSerial : public Stream {
public:
TasmotaSerial(int receive_pin, int transmit_pin);
bool begin();
size_t write(const uint8_t *buffer, size_t size = 1);
int read();
int available();
int peek();
virtual size_t write(uint8_t byte);
virtual int read();
virtual int available();
virtual void flush();
// size_t write(const uint8_t *buffer, size_t size = 1);
// int read();
// int available();
void rxRead();
using Print::write;
private:
bool isValidGPIOpin(int pin);
size_t txWrite(uint8_t byte);

View File

@ -18,13 +18,19 @@ import pycurl
HOST_URL = "domus1:80/api/upload-arduino.php"
def upload(hostUrl, filename):
tname = os.path.normpath(os.path.dirname(filename))
new_filename = tname + os.sep + os.path.basename(tname) + '.bin'
if os.path.exists(new_filename):
os.remove(new_filename)
os.rename(filename, new_filename)
url = 'http://%s' % (hostUrl)
c = pycurl.Curl()
c.setopt(c.URL, url)
# The "Expect:" is there to suppress "Expect: 100-continue" behaviour that is
# the default in libcurl when posting large bodies (and fails on lighttpd).
c.setopt(c.HTTPHEADER, ["Expect:"])
c.setopt(c.HTTPPOST, [('file', (c.FORM_FILE, filename, )), ])
c.setopt(c.HTTPPOST, [('file', (c.FORM_FILE, new_filename, )), ])
c.perform()
c.close()

View File

@ -1,62 +1,51 @@
/* 5.10.0i
* Add device function pointers
* Moved Command and JSON English language defines to one file (i18n.h)
* Update it-IT.h language file (#1449)
* Fix Wemo and Hue emulation by adding M-Search response delay (#1486)
/* 5.11.1b
* Add command PowerOnState option 5 which inverts PulseTime and allows for delayed always on after power on
* Changed OSWATCH_RESET_TIME (Blocked loop) from 30 to 120 seconds to allow slow networks (#1556)
* Add French language file (#1561)
* Fix truncated command names and wrong response for DomoticzSwitchIdx (#1571)
* Add HTTP Allow Cross Origin removed from ESP8266/Arduino 2.4.0 (#1572)
* Fix %-sign issue as printf escape character in Humidity and Sonoff SC (#1579)
*
* 5.10.0h
* Fix Wemo Emulation for Gen 2 devices (#1486)
* 5.11.1a
* Add OtaMagic two step Web server OTA upgrade using filename-minimal image if OTA free space is too small
* Add chinese language file (#1551)
*
* 5.10.0g
* Add 2nd Gen Alexa support to Wemo emulation discovery (#1357, #1450)
* 5.11.1 20180107
* Fix Sonoff Pow command handling (#1542)
*
* 5.10.0f
* Differentiate between JSON text defines and other text defines to allow for English JSON while using different locale (#1449)
* Fix display of build date and time in non-english locale (#1465)
* Add define for additional number of WS2812 schemes (#1463)
*
* 5.10.0e
* Add Italian language file (#1449)
* Fix Wemo Emulation once again closest to issue (#1357)
* Add support for sensor SHT3x (#1314)
*
* 5.10.0d
* Renamed commands Color2,3,4 to Color3,4,5
* Add command Color2 to set color while keeping same dimmer value
* Add led signal to Carbon Dioxide (CO2) sensors (see user_config.h)
* Fix Wemo Emulation again (#1357)
* 5.11.0 20180107
* Minor webpage HTML optimizations (#1358)
* Updated German translation (#1438)
*
* 5.10.0c
* Consolidate device serial (MH-Z19, SenseAir and Pzem004T) into TasmotaSerial library
* Consolidate PWM device recognition
* Fix Wemo Emulation (#1357)
* Add support for Arilux LC06 (#1414)
*
* 5.10.0b
* Add support for PZEM004T energy sensor to be enabled with define USE_PZEM004T in user_config.h
* Change Sonoff Pow Energy MQTT data message and consolidate Status 8 into Status 10
* Change ADS1115 default voltage range from +/-2V to +/-6V (#1289)
* Change text to Active for 3 minutes (#1364)
* Change Wemo SetBinaryState to distinguish from GetBinaryState (#1357)
* Change output of HTTP command to valid JSON and Array only (#1363)
* Add support for MH-Z19(B) CO2 sensor to be enabled with define USE_MHZ19 in user_config.h (#561, #1248)
* Add support for SenseAir S8 CO2 sensor to be enabled with define USE_SENSEAIR in user_config.h
* Add support for Domoticz Air Quality sensor to be used by MH-Z19(B) and SenseAir sensors
*
* 5.10.0a
* Add (experimental) support for sensor SHT3x
* Add support for iTead SI7021 temperature and humidity sensor by consolidating DHT22 into AM2301 and using former DHT22 as SI7021 (#735)
* Removed all MQTT, JSON and Command language defines from locale files and set fixed to English (#1473)
* Renamed commands Color2,3,4 to Color3,4,5
* Fix BME280 calculation (#1051)
* Add support for BME680 using adafruit libraries (#1212)
* Change ADS1115 default voltage range from +/-2V to +/-6V (#1289)
* Add multipress support and more user configurable options to Sonoff Dual R2 (#1291)
* Fix Sonoff Bridge missed learned key if learned data contains 0x55 (End of Transmission) flag (#1095, #1294)
* Add support for TSL2561 using adafruit library (#661, #1311)
* Add alternative support for SHT3x enabled with define USE_SHT3X_V2 in user_config.h (#1314)
* Add alternative support for SHT3x enabled with define USE_SHT3X_V3 in user_config.h (#1314)
* Fix PWM initialization in Dimmer/Color mode (#1321)
* Fix BME680 pressure data (#1356)
* Minor webpage HTML optimizations (#1358)
* Change text to Active for 3 minutes (#1364)
* Fix Wemo Emulation (#1357)
* Fix display of build date and time in non-english locale (#1465)
* Fix Wemo and Hue emulation by adding M-Search response delay (#1486)
* Add libraries Adafruit_BME680-1.0.5, Adafruit_Sensor-1.0.2.02, TasmotaSerial-1.0.0 and TSL2561-Arduino-Library
* Add command Color2 to set color while keeping same dimmer value
* Add device function pointers
* Add support for SenseAir S8 CO2 sensor
* Add color led signal to Carbon Dioxide (CO2) sensors using defines CO2_LOW and CO2_HIGH in user_config.h
* Add support for Domoticz Air Quality sensor to be used by MH-Z19(B) and SenseAir sensors
* Add support for PZEM004T energy sensor
* Add support for iTead SI7021 temperature and humidity sensor by consolidating DHT22 into AM2301 and using former DHT22 as SI7021 (#735)
* Add support for BME680 using adafruit libraries (#1212)
* Add support for MH-Z19(B) CO2 sensor (#561, #1248)
* Add multipress support and more user configurable GPIO to Sonoff Dual R2 (#1291)
* Add support for TSL2561 using adafruit library (#661, #1311)
* Add support for SHT3x (#1314)
* Add support for Arilux LC06 (#1414)
* Add Italian language file (#1449)
* Add 2nd Gen Alexa support to Wemo emulation discovery (#1357, #1450)
* Add define for additional number of WS2812 schemes (#1463)
*
* 5.10.0 20171201
* Upgrade library ArduinoJson to 5.11.2

View File

@ -20,49 +20,114 @@
#ifndef _I18N_H_
#define _I18N_H_
/********************************************************************************************/
/*********************************************************************************************\
* All text used in Commands, MQTT, JSON messages only in English (#1473)
*
* (At this location they can/may be overruled by language files using undefs)
\*********************************************************************************************/
// Text used in JSON messages only in English (#1473)
#define D_JSON_ABORTED "Aborted"
#define D_JSON_ACTIVE "Active"
#define D_JSON_ADDRESS "Address"
#define D_JSON_AIRQUALITY "AirQuality"
#define D_JSON_ANALOG_INPUT "Analog"
#define D_JSON_CO2 "Carbon dioxide"
#define D_JSON_AP "AP" // Access Point
#define D_JSON_APMAC_ADDRESS "APMac"
#define D_JSON_APPENDED "Appended"
#define D_JSON_BAUDRATE "Baudrate"
#define D_JSON_BLINK "Blink"
#define D_JSON_BLOCKED_LOOP "Blocked Loop"
#define D_JSON_BOOTVERSION "Boot"
#define D_JSON_BOOTCOUNT "BootCount"
#define D_JSON_BUILDDATETIME "BuildDateTime"
#define D_JSON_CO2 "CarbonDioxide"
#define D_JSON_COMMAND "Command"
#define D_JSON_COREVERSION "Core"
#define D_JSON_COUNTER "Counter"
#define D_JSON_CURRENT "Current" // As in Voltage and Current
#define D_JSON_CURRENT "Current" // As in Voltage and Current
#define D_JSON_DATA "Data"
#define D_JSON_DNSSERVER "DNSServer"
#define D_JSON_DONE "Done"
#define D_JSON_EMPTY "Empty"
#define D_JSON_ENDDST "EndDST" // End Daylight Savings Time
#define D_JSON_ERASE "Erase"
#define D_JSON_ERROR "Error"
#define D_JSON_EVERY "Every"
#define D_JSON_FAILED "Failed"
#define D_JSON_FALLBACKTOPIC "FallbackTopic"
#define D_JSON_FLASHMODE "FlashMode"
#define D_JSON_FLASHSIZE "FlashSize"
#define D_JSON_FREEMEMORY "Free"
#define D_JSON_FROM "from"
#define D_JSON_GAS "Gas"
#define D_JSON_GATEWAY "Gateway"
#define D_JSON_HEAPSIZE "Heap"
#define D_JSON_HIGH "High"
#define D_JSON_HUMIDITY "Humidity"
#define D_JSON_I2CSCAN_DEVICES_FOUND_AT "Device(s) found at"
#define D_JSON_I2CSCAN_UNKNOWN_ERROR_AT "Unknown error at"
#define D_JSON_I2CSCAN_NO_DEVICES_FOUND "No devices found"
#define D_JSON_ID "Id"
#define D_JSON_ILLUMINANCE "Illuminance"
#define D_JSON_UNKNOWN "Unknown"
#define D_JSON_LIGHT "Light"
#define D_JSON_LOCAL_TIME "Local"
#define D_JSON_LOW "Low"
#define D_JSON_MAC "Mac"
#define D_JSON_MASK "Mask"
#define D_JSON_MINIMAL "minimal"
#define D_JSON_NO "No"
#define D_JSON_NOISE "Noise"
#define D_JSON_NONE "None"
#define D_JSON_OR "or"
#define D_JSON_PERIOD "Period"
#define D_JSON_POWERFACTOR "Factor"
#define D_JSON_POWERUSAGE "Power"
#define D_JSON_PRESSURE "Pressure"
#define D_JSON_PRESSUREATSEALEVEL "SeaPressure"
#define D_JSON_PROGRAMFLASHSIZE "ProgramFlashSize"
#define D_JSON_PROGRAMSIZE "ProgramSize"
#define D_JSON_RESTARTING "Restarting"
#define D_JSON_RESTARTREASON "RestartReason"
#define D_JSON_RSSI "RSSI"
#define D_JSON_SAVEADDRESS "SaveAddress"
#define D_JSON_SAVECOUNT "SaveCount"
#define D_JSON_SAVED "Saved"
#define D_JSON_SAVESTATE "SaveState"
#define D_JSON_SDKVERSION "SDK"
#define D_JSON_SELECTED "selected"
#define D_JSON_SSID "SSId"
#define D_JSON_STARTDST "StartDST" // Start Daylight Savings Time
#define D_JSON_STARTED "Started"
#define D_JSON_SUBNETMASK "Subnetmask"
#define D_JSON_SUCCESSFUL "Successful"
#define D_JSON_SWITCH "Switch"
#define D_JSON_SYNC "Sync"
#define D_JSON_TEMPERATURE "Temperature"
#define D_JSON_TEMPERATURE_UNIT "TempUnit"
#define D_JSON_TIME "Time"
#define D_JSON_TODAY "Today"
#define D_JSON_TOTAL "Total"
#define D_JSON_TYPE "Type"
#define D_JSON_UV_LEVEL "UV Level"
#define D_JSON_UPTIME "Uptime"
#define D_JSON_UTC_TIME "UTC"
#define D_JSON_UV_LEVEL "UvLevel"
#define D_JSON_VCC "Vcc"
#define D_JSON_VERSION "Version"
#define D_JSON_VOLTAGE "Voltage"
#define D_JSON_WIFI "Wifi"
#define D_JSON_WRONG "Wrong"
#define D_JSON_YESTERDAY "Yesterday"
// Result
#define D_RSLT_RESULT "RESULT"
#define D_RSLT_INFO "INFO"
#define D_RSLT_STATE "STATE"
#define D_RSLT_SENSOR "SENSOR"
#define D_RSLT_UPTIME "UPTIME"
#define D_RSLT_MARGINS "MARGINS"
#define D_RSLT_WARNING "WARNING"
#define D_RSLT_ENERGY "ENERGY"
#define D_RSLT_INFO "INFO"
#define D_RSLT_MARGINS "MARGINS"
#define D_RSLT_POWER "POWER"
#define D_RSLT_RESULT "RESULT"
#define D_RSLT_SENSOR "SENSOR"
#define D_RSLT_STATE "STATE"
#define D_RSLT_UPTIME "UPTIME"
#define D_RSLT_WARNING "WARNING"
// Commands sonoff.ino
#define D_CMND_MQTTHOST "MqttHost"
@ -102,7 +167,6 @@
#define D_STATUS10_SENSOR "SNS"
#define D_STATUS11_STATUS "STS"
#define D_CMND_POWER "Power"
#define D_RSLT_POWER "POWER"
#define D_CMND_POWERONSTATE "PowerOnState"
#define D_CMND_PULSETIME "PulseTime"
#define D_CMND_BLINKTIME "BlinkTime"
@ -119,7 +183,7 @@
#define D_CMND_MODULE "Module"
#define D_CMND_MODULES "Modules"
#define D_CMND_GPIO "GPIO"
#define D_NOT_SUPPORTED "Not supported"
#define D_JSON_NOT_SUPPORTED "Not supported"
#define D_CMND_GPIOS "GPIOs"
#define D_CMND_PWM "PWM"
#define D_CMND_PWMFREQUENCY "PWMFrequency"
@ -130,7 +194,7 @@
#define D_CMND_SLEEP "Sleep"
#define D_CMND_UPLOAD "Upload"
#define D_CMND_UPGRADE "Upgrade"
#define D_ONE_OR_GT "1 or >%s to upgrade"
#define D_JSON_ONE_OR_GT "1 or >%s to upgrade"
#define D_CMND_OTAURL "OtaUrl"
#define D_CMND_SERIALLOG "SerialLog"
#define D_CMND_SYSLOG "SysLog"
@ -153,18 +217,19 @@
#define D_CMND_FRIENDLYNAME "FriendlyName"
#define D_CMND_SWITCHMODE "SwitchMode"
#define D_CMND_WEBSERVER "Webserver"
#define D_WEBSERVER_MODE "WebServerMode"
#define D_ACTIVE_FOR "Active for"
#define D_ON_DEVICE "on"
#define D_JSON_WEBSERVER_MODE "WebServerMode"
#define D_JSON_ACTIVE_FOR "Active for"
#define D_JSON_ON_DEVICE "on"
#define D_JSON_WITH_IP_ADDRESS "with IP address"
#define D_CMND_WEBPASSWORD "WebPassword"
#define D_CMND_WEBLOG "WebLog"
#define D_CMND_EMULATION "Emulation"
#define D_CMND_TELEPERIOD "TelePeriod"
#define D_CMND_RESTART "Restart"
#define D_ONE_TO_RESTART "1 to restart"
#define D_JSON_ONE_TO_RESTART "1 to restart"
#define D_CMND_RESET "Reset"
#define D_RESET_AND_RESTARTING "Reset and Restarting"
#define D_ONE_TO_RESET "1 to reset"
#define D_JSON_RESET_AND_RESTARTING "Reset and Restarting"
#define D_JSON_ONE_TO_RESET "1 to reset"
#define D_CMND_TIMEZONE "Timezone"
#define D_CMND_ALTITUDE "Altitude"
#define D_CMND_LEDPOWER "LedPower"
@ -192,7 +257,7 @@
#define D_CMND_IRSEND "IRSend"
#define D_CMND_IRHVAC "IRHVAC"
// Commands xsns_03_energy.ino
// Commands xdrv_03_energy.ino
#define D_CMND_POWERLOW "PowerLow"
#define D_CMND_POWERHIGH "PowerHigh"
#define D_CMND_VOLTAGELOW "VoltageLow"
@ -209,19 +274,32 @@
#define D_CMND_MAXPOWER "MaxPower"
#define D_CMND_MAXPOWERHOLD "MaxPowerHold"
#define D_CMND_MAXPOWERWINDOW "MaxPowerWindow"
#define D_JSON_MAXPOWERREACHED "MaxPowerReached"
#define D_JSON_MAXPOWERREACHEDRETRY "MaxPowerReachedRetry"
#define D_CMND_SAFEPOWER "SafePower"
#define D_CMND_SAFEPOWERHOLD "SafePowerHold"
#define D_CMND_SAFEPOWERWINDOW "SafePowerWindow"
#define D_JSON_POWERMONITOR "PowerMonitor"
#define D_CMND_MAXENERGY "MaxEnergy"
#define D_CMND_MAXENERGYSTART "MaxEnergyStart"
#define D_JSON_ENERGYMONITOR "EnergyMonitor"
#define D_JSON_MAXENERGYREACHED "MaxEnergyReached"
// Commands xdrv_04_snfbridge.ino
#define D_CMND_RFCODE "RfCode"
#define D_CMND_RFHIGH "RfHigh"
#define D_CMND_RFHOST "RfHost"
#define D_CMND_RFKEY "RfKey"
#define D_JSON_START_LEARNING "Start learning"
#define D_JSON_SET_TO_DEFAULT "Set to default"
#define D_JSON_DEFAULT_SENT "Default sent"
#define D_JSON_LEARNED_SENT "Learned sent"
#define D_JSON_LEARNING_ACTIVE "Learning active"
#define D_JSON_LEARN_FAILED "Learn failed"
#define D_JSON_LEARNED "Learned"
#define D_CMND_RFLOW "RfLow"
#define D_CMND_RFSYNC "RfSync"
#define D_JSON_RFRECEIVED "RfReceived"
// Commands xdrv_05_domoticz.ino
#define D_CMND_DOMOTICZ "Domoticz"
@ -282,7 +360,7 @@ const char kUnitNames[] PROGMEM =
D_UNIT_MILLIAMPERE "|"
D_UNIT_MILLISECOND "|"
D_UNIT_MINUTE "|"
D_UNIT_PPM "|"
D_UNIT_PARTS_PER_MILLION "|"
D_UNIT_PRESSURE "|"
D_UNIT_SECOND "|"
D_UNIT_SECTORS "|"
@ -296,7 +374,7 @@ const char S_JSON_COMMAND_NVALUE_UNIT[] PROGMEM = "{\"%s\":\"%d%s\"}
const char S_JSON_COMMAND_NVALUE_UNIT_NVALUE_UNIT[] PROGMEM = "{\"%s\":\"%d%s (%d%s)\"}";
const char S_JSON_COMMAND_NVALUE_SVALUE[] PROGMEM = "{\"%s\":\"%d (%s)\"}";
const char S_JSON_COMMAND_NVALUE_ACTIVE_NVALUE[] PROGMEM = "{\"%s\":\"%d (" D_ACTIVE " %d)\"}";
const char S_JSON_COMMAND_NVALUE_ACTIVE_NVALUE[] PROGMEM = "{\"%s\":\"%d (" D_JSON_ACTIVE " %d)\"}";
const char S_JSON_COMMAND_NVALUE[] PROGMEM = "{\"%s\":%d}";
const char S_JSON_COMMAND_SVALUE[] PROGMEM = "{\"%s\":\"%s\"}";
@ -345,13 +423,13 @@ static const char kMonthNames[] = D_MONTH3LIST;
// webserver.ino
#ifdef USE_WEBSERVER
const char HTTP_SNS_TEMP[] PROGMEM = "%s{s}%s " D_TEMPERATURE "{m}%s&deg;%c{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
const char HTTP_SNS_HUM[] PROGMEM = "%s{s}%s " D_HUMIDITY "{m}%s%{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
const char HTTP_SNS_HUM[] PROGMEM = "%s{s}%s " D_HUMIDITY "{m}%s%%{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
const char HTTP_SNS_PRESSURE[] PROGMEM = "%s{s}%s " D_PRESSURE "{m}%s " D_UNIT_PRESSURE "{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
const char HTTP_SNS_SEAPRESSURE[] PROGMEM = "%s{s}%s " D_PRESSUREATSEALEVEL "{m}%s " D_UNIT_PRESSURE "{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
const char HTTP_SNS_ANALOG[] PROGMEM = "%s{s}%s " D_ANALOG_INPUT "%d{m}%d{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
#if defined(USE_MHZ19) || defined(USE_SENSEAIR)
const char HTTP_SNS_CO2[] PROGMEM = "%s{s}%s " D_CO2 "{m}%d " D_UNIT_PPM "{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
const char HTTP_SNS_CO2[] PROGMEM = "%s{s}%s " D_CO2 "{m}%d " D_UNIT_PARTS_PER_MILLION "{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
#endif // USE_WEBSERVER
const char S_MAIN_MENU[] PROGMEM = D_MAIN_MENU;

View File

@ -44,32 +44,24 @@
#define D_DECIMAL_SEPARATOR "."
// Common
#define D_ABORTED "abgebrochen"
#define D_ACTIVE "aktiv"
#define D_ADMIN "Admin"
#define D_AIR_QUALITY "Luftqualität"
#define D_AP "AP" // Access Point
#define D_APMAC_ADDRESS "AP-Mac"
#define D_APPENDED "angehängt"
#define D_AS "wie"
#define D_AUTO "AUTO"
#define D_BAUDRATE "Baudrate"
#define D_BLINK "Blinken"
#define D_BLINKOFF "BlinkenAus"
#define D_BOOTVERSION "Boot"
#define D_BOOT_COUNT "Anzahl Startvorgänge"
#define D_BOOTCOUNT "BootZähler"
#define D_BRIGHTLIGHT "hell"
#define D_BUILDDATETIME "BuildDatumUhrzeit"
#define D_BUTTON "Knopf"
#define D_BY "von" // Written by me
#define D_BYTES "Bytes"
#define D_CELSIUS "Celsius"
#define D_CO2 "CO²"
#define D_CODE "code" // Button code
#define D_COLDLIGHT "kalt"
#define D_COMMAND "Befehl"
#define D_CONNECTED "verbunden"
#define D_COREVERSION "Core"
#define D_COUNT "zählen"
#define D_COUNTER "Zähler"
#define D_CURRENT "Strom" // As in Voltage and Current
@ -78,36 +70,25 @@
#define D_DEBUG "debug"
#define D_DISABLED "deaktiviert"
#define D_DNS_SERVER "DNS Server"
#define D_DNSSERVER "DNSServer"
#define D_DONE "erledigt"
#define D_DST_TIME "DST"
#define D_EMPTY "leer"
#define D_EMULATION "Emulation"
#define D_ENABLED "aktiviert"
#define D_ENDDST "EndDST" // End Daylight Savings Time
#define D_ERASE "löschen"
#define D_ERROR "Fehler"
#define D_EVERY "alle"
#define D_FAHRENHEIT "Fahrenheit"
#define D_FAILED "fehlgeschlagen"
#define D_FALLBACK "Fallback"
#define D_FALLBACK_TOPIC "Fallback topic"
#define D_FALLBACKTOPIC "FallbackTopic"
#define D_FALSE "falsch"
#define D_FILE "Datei"
#define D_FLASHMODE "FlashMode"
#define D_FLASHSIZE "FlashSize"
#define D_FREE_MEMORY "Freier Arbeitsspeicher"
#define D_FREEMEMORY "frei"
#define D_FROM "von"
#define D_GAS "Gas"
#define D_GATEWAY "Gateway"
#define D_GROUP "Gruppe"
#define D_HEAPSIZE "Heap-Größe"
#define D_HOST "Host"
#define D_HOSTNAME "Hostname"
#define D_HUMIDITY "Feuchtigkeit"
#define D_ID "ID"
#define D_ILLUMINANCE "Beleuchtungsintensität"
#define D_IMMEDIATE "direkt" // Button immediate
#define D_INDEX "Index"
@ -115,15 +96,10 @@
#define D_INITIALIZED "initialisiert"
#define D_IP_ADDRESS "IP-Addresse"
#define D_LIGHT "Licht"
#define D_LIMIT "Grenzwert"
#define D_LOCAL_TIME "lokale Zeit"
#define D_LWT "LWT"
#define D_MAC "MAC"
#define D_MASK "Maske"
#define D_MODULE "Modul"
#define D_MQTT "MQTT"
#define D_MULTI_PRESS "Mehrfachdruck"
#define D_NO "nein"
#define D_NOISE "Lautstärke"
#define D_NONE "keine"
#define D_OFF "aus"
@ -138,41 +114,24 @@
#define D_PRESSURE "Druck"
#define D_PRESSUREATSEALEVEL "MeeresDruck"
#define D_PROGRAM_FLASH_SIZE "Ges. Flash Speicher"
#define D_PROGRAMFLASHSIZE "ProgramFlashSize"
#define D_PROGRAM_SIZE "Ben. Flash Speicher"
#define D_PROGRAMSIZE "ProgramSize"
#define D_PROJECT "Projekt"
#define D_RECEIVED "erhalten"
#define D_RESTART "Neustart"
#define D_RESTARTING "starte neu"
#define D_RESTART_REASON "Grund für Neustart"
#define D_RESTARTREASON "RestartReason"
#define D_RESTORE "Wiederherstellung"
#define D_RETAINED "beibehalten"
#define D_SAVE "Speichern"
#define D_SAVEADDRESS "SaveAddress"
#define D_SAVECOUNT "SaveCount"
#define D_SAVESTATE "SaveState"
#define D_SDKVERSION "SDK"
#define D_SELECTED "ausgewählt"
#define D_SENSOR "Sensor"
#define D_SERIAL "Seriell"
#define D_BYTES "Bytes"
#define D_SSID "SSID"
#define D_START "Start"
#define D_STARTED "gestartet"
#define D_STARTDST "StartDST" // Start Daylight Savings Time
#define D_STD_TIME "STD"
#define D_STOP "Stop"
#define D_SUBNET_MASK "Subnetzmaske"
#define D_SUBNETMASK "Subnetmaske"
#define D_SUBSCRIBE_TO "subscribe to"
#define D_SUCCESSFUL "erfolgreich"
#define D_SWITCH "Schalter"
#define D_SYS "Sys " // Sys log
#define D_TEMPERATURE "Temperatur"
#define D_TEMPERATURE_UNIT "TempUnit"
#define D_TIME "Zeit"
#define D_TO "zu"
#define D_TOGGLE "An/Aus"
#define D_TOPIC "topic"
@ -184,15 +143,13 @@
#define D_USER "Benutzer"
#define D_UTC_TIME "UTC"
#define D_UV_LEVEL "UV Level"
#define D_VCC "VCC"
#define D_VERSION "Version"
#define D_VOLTAGE "Spannung"
#define D_WARMLIGHT "warm"
#define D_WEB "Web" // Web log
#define D_WEB_SERVER "Web-Server"
#define D_WIFI "WLAN"
// sonoff.ino
#define D_WARNING_MINIMAL_VERSION "WARNING This version does not support persistent settings"
#define D_LEVEL_10 "level 1-0"
#define D_LEVEL_01 "level 0-1"
#define D_SERIAL_LOGGING_DISABLED "Serielles logging deaktiviert"
@ -227,10 +184,7 @@
#define D_CHECKING_CONNECTION "Prüfe Verbindung..."
#define D_QUERY_DONE "Suchanfrage abgeschlossen. MQTT-Services gefunden"
#define D_MQTT_SERVICE_FOUND "MQTT-Service gefunden bei"
#define D_I2CSCAN_DEVICES_FOUND_AT "Gerät(e) gefunden bei"
#define D_FOUND_AT "gefunden bei"
#define D_I2CSCAN_UNKNOWN_ERROR_AT "unbekannter Fehler bei"
#define D_I2CSCAN_NO_DEVICES_FOUND "keine Geräte gefunden"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog Host nicht gefunden"
// settings.ino
@ -299,7 +253,9 @@
#define D_FULL_TOPIC "full topic"
#define D_LOGGING_PARAMETERS "Logging Einstellungen"
#define D_LOG_LEVEL "Log level"
#define D_SERIAL_LOG_LEVEL "Seriell Log level"
#define D_WEB_LOG_LEVEL "Web Log level"
#define D_SYS_LOG_LEVEL "Sys Log level"
#define D_MORE_DEBUG "More debug"
#define D_SYSLOG_HOST "Sys Log Host"
#define D_SYSLOG_PORT "Sys Log Port"
@ -392,17 +348,6 @@
#define D_JSON_IRHVAC_TEMP "TEMPERATUR"
#define D_JSON_IRRECEIVED "IR empfangen"
// xdrv_04_snfbridge.ino
#define D_RFRECEIVED "RF empfangen"
#define D_START_LEARNING "starte Anlernen"
#define D_SET_TO_DEFAULT "auf Standard zurücksetzen"
#define D_DEFAULT_SENT "Standard gesendet"
#define D_LEARNED_SENT "Anlernen gesendet"
#define D_LEARNING_ACTIVE "Anlernen aktiv"
#define D_LEARN_FAILED "Anlernen fehlgeschlagen"
#define D_LEARNED "angelernt"
#define D_SAVED "gespeichert"
// xdrv_05_domoticz.ino
#define D_DOMOTICZ_PARAMETERS "Domoticz parameters"
#define D_DOMOTICZ_IDX "Idx"
@ -420,12 +365,7 @@
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
#define D_DOMOTICZ_UPDATE_TIMER "Update timer"
// xsns_03_energy.ino
#define D_MAXPOWERREACHED "MaxPowerReached"
#define D_MAXPOWERREACHEDRETRY "MaxPowerReachedRetry"
#define D_POWERMONITOR "PowerMonitor"
#define D_ENERGYMONITOR "EnergyMonitor"
#define D_MAXENERGYREACHED "MaxEnergyReached"
// xdrv_03_energy.ino
#define D_ENERGY_TODAY "Energie heute"
#define D_ENERGY_YESTERDAY "Energie gestern"
#define D_ENERGY_TOTAL "Energie insgesamt"
@ -446,6 +386,11 @@
#define D_SENSOR_DID_NOT_ACK_COMMAND "Sensor hat ACK-Befehl nicht ausgeführt"
#define D_SHT1X_FOUND "SHT1X gefunden"
// xsns_18_pms5003.ino
#define D_STANDARD_CONCENTRATION "Standard Concentration"
#define D_ENVIRONMENTAL_CONCENTRATION "Environmental Concentration"
#define D_PARTICALS_BEYOND "Particals beyond"
// sonoff_template.h
// Max string length is 8 characters including suffixes
#define D_SENSOR_NONE "None"
@ -473,6 +418,7 @@
#define D_SENSOR_SPI_CS "SPI CS"
#define D_SENSOR_SPI_DC "SPI DC"
#define D_SENSOR_BACKLIGHT "BkLight"
#define D_SENSOR_PMS5003 "PMS5003"
// Units
#define D_UNIT_AMPERE "A"
@ -480,11 +426,14 @@
#define D_UNIT_KILOOHM "kOhm"
#define D_UNIT_KILOWATTHOUR "kWh"
#define D_UNIT_LUX "lx"
#define D_UNIT_MICROGRAM_PER_CUBIC_METER "ug/m3"
#define D_UNIT_MICROMETER "um"
#define D_UNIT_MICROSECOND "µs"
#define D_UNIT_MILLIAMPERE "mA"
#define D_UNIT_MILLISECOND "ms"
#define D_UNIT_MINUTE "min"
#define D_UNIT_PPM "ppm"
#define D_UNIT_PARTS_PER_DECILITER "ppd"
#define D_UNIT_PARTS_PER_MILLION "ppm"
#define D_UNIT_PRESSURE "hPa"
#define D_UNIT_SECOND "sek"
#define D_UNIT_SECTORS "Sektoren"

View File

@ -44,32 +44,24 @@
#define D_DECIMAL_SEPARATOR "."
// Common
#define D_ABORTED "Aborted"
#define D_ACTIVE "Active"
#define D_ADMIN "Admin"
#define D_AIR_QUALITY "Air quality"
#define D_AP "AP" // Access Point
#define D_APMAC_ADDRESS "APMac"
#define D_APPENDED "Appended"
#define D_AS "as"
#define D_AUTO "AUTO"
#define D_BAUDRATE "Baudrate"
#define D_BLINK "Blink"
#define D_BLINKOFF "BlinkOff"
#define D_BOOTVERSION "Boot"
#define D_BOOT_COUNT "Boot Count"
#define D_BOOTCOUNT "BootCount"
#define D_BRIGHTLIGHT "Bright"
#define D_BUILDDATETIME "BuildDateTime"
#define D_BUTTON "Button"
#define D_BY "by" // Written by me
#define D_BYTES "Bytes"
#define D_CELSIUS "Celsius"
#define D_CO2 "Carbon dioxide"
#define D_CODE "code" // Button code
#define D_COLDLIGHT "Cold"
#define D_COMMAND "Command"
#define D_CONNECTED "Connected"
#define D_COREVERSION "Core"
#define D_COUNT "Count"
#define D_COUNTER "Counter"
#define D_CURRENT "Current" // As in Voltage and Current
@ -78,36 +70,25 @@
#define D_DEBUG "Debug"
#define D_DISABLED "Disabled"
#define D_DNS_SERVER "DNS Server"
#define D_DNSSERVER "DNSServer"
#define D_DONE "Done"
#define D_DST_TIME "DST"
#define D_EMPTY "Empty"
#define D_EMULATION "Emulation"
#define D_ENABLED "Enabled"
#define D_ENDDST "EndDST" // End Daylight Savings Time
#define D_ERASE "Erase"
#define D_ERROR "Error"
#define D_EVERY "Every"
#define D_FAHRENHEIT "Fahrenheit"
#define D_FAILED "Failed"
#define D_FALLBACK "Fallback"
#define D_FALLBACK_TOPIC "Fallback Topic"
#define D_FALLBACKTOPIC "FallbackTopic"
#define D_FALSE "False"
#define D_FILE "File"
#define D_FLASHMODE "FlashMode"
#define D_FLASHSIZE "FlashSize"
#define D_FREE_MEMORY "Free Memory"
#define D_FREEMEMORY "Free"
#define D_FROM "from"
#define D_GAS "Gas"
#define D_GATEWAY "Gateway"
#define D_GROUP "Group"
#define D_HEAPSIZE "Heap"
#define D_HOST "Host"
#define D_HOSTNAME "Hostname"
#define D_HUMIDITY "Humidity"
#define D_ID "Id"
#define D_ILLUMINANCE "Illuminance"
#define D_IMMEDIATE "immediate" // Button immediate
#define D_INDEX "Index"
@ -115,15 +96,10 @@
#define D_INITIALIZED "Initialized"
#define D_IP_ADDRESS "IP Address"
#define D_LIGHT "Light"
#define D_LIMIT "Limit"
#define D_LOCAL_TIME "Local"
#define D_LWT "LWT"
#define D_MAC "Mac"
#define D_MASK "Mask"
#define D_MODULE "Module"
#define D_MQTT "MQTT"
#define D_MULTI_PRESS "multi-press"
#define D_NO "No"
#define D_NOISE "Noise"
#define D_NONE "None"
#define D_OFF "Off"
@ -138,41 +114,24 @@
#define D_PRESSURE "Pressure"
#define D_PRESSUREATSEALEVEL "SeaPressure"
#define D_PROGRAM_FLASH_SIZE "Program Flash Size"
#define D_PROGRAMFLASHSIZE "ProgramFlashSize"
#define D_PROGRAM_SIZE "Program Size"
#define D_PROGRAMSIZE "ProgramSize"
#define D_PROJECT "Project"
#define D_RECEIVED "Received"
#define D_RESTART "Restart"
#define D_RESTARTING "Restarting"
#define D_RESTART_REASON "Restart Reason"
#define D_RESTARTREASON "RestartReason"
#define D_RESTORE "restore"
#define D_RETAINED "retained"
#define D_SAVE "Save"
#define D_SAVEADDRESS "SaveAddress"
#define D_SAVECOUNT "SaveCount"
#define D_SAVESTATE "SaveState"
#define D_SDKVERSION "SDK"
#define D_SELECTED "selected"
#define D_SENSOR "Sensor"
#define D_SERIAL "Serial"
#define D_BYTES "Bytes"
#define D_SSID "SSId"
#define D_START "Start"
#define D_STARTED "Started"
#define D_STARTDST "StartDST" // Start Daylight Savings Time
#define D_STD_TIME "STD"
#define D_STOP "Stop"
#define D_SUBNET_MASK "Subnet Mask"
#define D_SUBNETMASK "Subnetmask"
#define D_SUBSCRIBE_TO "Subscribe to"
#define D_SUCCESSFUL "Successful"
#define D_SWITCH "Switch"
#define D_SYS "Sys" // Sys log
#define D_TEMPERATURE "Temperature"
#define D_TEMPERATURE_UNIT "TempUnit"
#define D_TIME "Time"
#define D_TO "to"
#define D_TOGGLE "Toggle"
#define D_TOPIC "Topic"
@ -184,15 +143,13 @@
#define D_USER "User"
#define D_UTC_TIME "UTC"
#define D_UV_LEVEL "UV Level"
#define D_VCC "Vcc"
#define D_VERSION "Version"
#define D_VOLTAGE "Voltage"
#define D_WARMLIGHT "Warm"
#define D_WEB "Web" // Web log
#define D_WEB_SERVER "Web Server"
#define D_WIFI "Wifi"
// sonoff.ino
#define D_WARNING_MINIMAL_VERSION "WARNING This version does not support persistent settings"
#define D_LEVEL_10 "level 1-0"
#define D_LEVEL_01 "level 0-1"
#define D_SERIAL_LOGGING_DISABLED "Serial logging disabled"
@ -227,10 +184,7 @@
#define D_CHECKING_CONNECTION "Checking connection..."
#define D_QUERY_DONE "Query done. MQTT services found"
#define D_MQTT_SERVICE_FOUND "MQTT service found on"
#define D_I2CSCAN_DEVICES_FOUND_AT "Device(s) found at"
#define D_FOUND_AT "found at"
#define D_I2CSCAN_UNKNOWN_ERROR_AT "Unknown error at"
#define D_I2CSCAN_NO_DEVICES_FOUND "No devices found"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog Host not found"
// settings.ino
@ -299,7 +253,9 @@
#define D_FULL_TOPIC "Full Topic"
#define D_LOGGING_PARAMETERS "Logging parameters"
#define D_LOG_LEVEL "log level"
#define D_SERIAL_LOG_LEVEL "Serial log level"
#define D_WEB_LOG_LEVEL "Web log level"
#define D_SYS_LOG_LEVEL "Syslog level"
#define D_MORE_DEBUG "More debug"
#define D_SYSLOG_HOST "Syslog host"
#define D_SYSLOG_PORT "Syslog port"
@ -392,17 +348,6 @@
#define D_JSON_IRHVAC_TEMP "TEMP"
#define D_JSON_IRRECEIVED "IrReceived"
// xdrv_04_snfbridge.ino
#define D_RFRECEIVED "RfReceived"
#define D_START_LEARNING "Start learning"
#define D_SET_TO_DEFAULT "Set to default"
#define D_DEFAULT_SENT "Default sent"
#define D_LEARNED_SENT "Learned sent"
#define D_LEARNING_ACTIVE "Learning active"
#define D_LEARN_FAILED "Learn failed"
#define D_LEARNED "Learned"
#define D_SAVED "Saved"
// xdrv_05_domoticz.ino
#define D_DOMOTICZ_PARAMETERS "Domoticz parameters"
#define D_DOMOTICZ_IDX "Idx"
@ -420,12 +365,7 @@
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
#define D_DOMOTICZ_UPDATE_TIMER "Update timer"
// xsns_03_energy.ino
#define D_MAXPOWERREACHED "MaxPowerReached"
#define D_MAXPOWERREACHEDRETRY "MaxPowerReachedRetry"
#define D_POWERMONITOR "PowerMonitor"
#define D_ENERGYMONITOR "EnergyMonitor"
#define D_MAXENERGYREACHED "MaxEnergyReached"
// xdrv_03_energy.ino
#define D_ENERGY_TODAY "Energy Today"
#define D_ENERGY_YESTERDAY "Energy Yesterday"
#define D_ENERGY_TOTAL "Energy Total"
@ -446,6 +386,11 @@
#define D_SENSOR_DID_NOT_ACK_COMMAND "Sensor did not ACK command"
#define D_SHT1X_FOUND "SHT1X found"
// xsns_18_pms5003.ino
#define D_STANDARD_CONCENTRATION "Standard Concentration"
#define D_ENVIRONMENTAL_CONCENTRATION "Environmental Concentration"
#define D_PARTICALS_BEYOND "Particals beyond"
// sonoff_template.h
// Max string length is 8 characters including suffixes
#define D_SENSOR_NONE "None"
@ -473,6 +418,7 @@
#define D_SENSOR_SPI_CS "SPI CS"
#define D_SENSOR_SPI_DC "SPI DC"
#define D_SENSOR_BACKLIGHT "BkLight"
#define D_SENSOR_PMS5003 "PMS5003"
// Units
#define D_UNIT_AMPERE "A"
@ -480,11 +426,14 @@
#define D_UNIT_KILOOHM "kOhm"
#define D_UNIT_KILOWATTHOUR "kWh"
#define D_UNIT_LUX "lx"
#define D_UNIT_MICROGRAM_PER_CUBIC_METER "ug/m3"
#define D_UNIT_MICROMETER "um"
#define D_UNIT_MICROSECOND "us"
#define D_UNIT_MILLIAMPERE "mA"
#define D_UNIT_MILLISECOND "ms"
#define D_UNIT_MINUTE "Min"
#define D_UNIT_PPM "ppm"
#define D_UNIT_PARTS_PER_DECILITER "ppd"
#define D_UNIT_PARTS_PER_MILLION "ppm"
#define D_UNIT_PRESSURE "hPa"
#define D_UNIT_SECOND "sec"
#define D_UNIT_SECTORS "sectors"

469
sonoff/language/fr-FR.h Normal file
View File

@ -0,0 +1,469 @@
/*
fr-FR.h - localization for French - France for Sonoff-Tasmota
Copyright (C) 2018 Olivier Francais
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LANGUAGE_FR_FR_H_
#define _LANGUAGE_FR_FR_H_
/*************************** ATTENTION *******************************\
*
* Due to memory constraints only UTF-8 is supported.
* To save code space keep text as short as possible.
* Time and Date provided by SDK can not be localized (yet).
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
* Use online command Prefix to translate cmnd, stat and tele.
*
\*********************************************************************/
// "2017-03-07T11:08:02" - ISO8601:2004
#define D_YEAR_MONTH_SEPARATOR "-"
#define D_MONTH_DAY_SEPARATOR "-"
#define D_DATE_TIME_SEPARATOR "T"
#define D_HOUR_MINUTE_SEPARATOR ":"
#define D_MINUTE_SECOND_SEPARATOR ":"
#define D_DAY3LIST "DimLunMarMerJeuVenSam"
#define D_MONTH3LIST "JanFevMarAvrMaiJunJulAutSepOctNovDec"
// Non JSON decimal separator
#define D_DECIMAL_SEPARATOR ","
// Common
#define D_ADMIN "Admin"
#define D_AIR_QUALITY "Qualité de l'Air"
#define D_AP "AP" // Access Point
#define D_AS "comme"
#define D_AUTO "AUTO"
#define D_BLINK "Blink"
#define D_BLINKOFF "BlinkOff"
#define D_BOOT_COUNT "Nombre de boot"
#define D_BRIGHTLIGHT "Luminosité"
#define D_BUTTON "Boutton"
#define D_BY "par" // Written by me
#define D_BYTES "Bytes"
#define D_CELSIUS "Celsius"
#define D_CO2 "Dioxyde arbone"
#define D_CODE "code" // Button code
#define D_COLDLIGHT "Froid"
#define D_COMMAND "Commande"
#define D_CONNECTED "Connecté"
#define D_COUNT "Compte"
#define D_COUNTER "Compteur"
#define D_CURRENT "Courrant" // As in Voltage and Current
#define D_DATA "Data"
#define D_DARKLIGHT "Sombre"
#define D_DEBUG "Debug"
#define D_DISABLED "Désactivé"
#define D_DNS_SERVER "Serveur DNS"
#define D_DONE "Fait"
#define D_DST_TIME "DST"
#define D_EMULATION "Emulation"
#define D_ENABLED "Activé"
#define D_ERASE "Effacer"
#define D_ERROR "Erreur"
#define D_FAHRENHEIT "Fahrenheit"
#define D_FAILED "Echoué"
#define D_FALLBACK "Fallback"
#define D_FALLBACK_TOPIC "Fallback Topic"
#define D_FALSE "Faux"
#define D_FILE "Fichier"
#define D_FREE_MEMORY "Memoire libre"
#define D_GAS "Gaz"
#define D_GATEWAY "Passerelle"
#define D_GROUP "Groupe"
#define D_HOST "Host"
#define D_HOSTNAME "Hostname"
#define D_HUMIDITY "Humidité"
#define D_ILLUMINANCE "Éclairement"
#define D_IMMEDIATE "immediat" // Button immediate
#define D_INDEX "Index"
#define D_INFO "Info"
#define D_INITIALIZED "Initialisé"
#define D_IP_ADDRESS "Adresse IP"
#define D_LIGHT "Lumière"
#define D_LWT "LWT"
#define D_MODULE "Module"
#define D_MQTT "MQTT"
#define D_MULTI_PRESS "multi-pression"
#define D_NOISE "Bruit"
#define D_NONE "None"
#define D_OFF "Off"
#define D_OFFLINE "Déconnecté"
#define D_OK "Ok"
#define D_ON "On"
#define D_ONLINE "Connecté"
#define D_PASSWORD "Mot de passe"
#define D_PORT "Port"
#define D_POWER_FACTOR "Facteur de puissance"
#define D_POWERUSAGE "Puissance"
#define D_PRESSURE "Pression"
#define D_PRESSUREATSEALEVEL "PressionMer"
#define D_PROGRAM_FLASH_SIZE "Taille Flash Programme"
#define D_PROGRAM_SIZE "Taille programme"
#define D_PROJECT "Projet"
#define D_RECEIVED "Reçu"
#define D_RESTART "Redémarrage"
#define D_RESTARTING "Redémarrage"
#define D_RESTART_REASON "Raison redémarrage"
#define D_RESTORE "restorer"
#define D_RETAINED "retenu"
#define D_SAVE "Enregister"
#define D_SENSOR "Capteur"
#define D_SSID "SSID"
#define D_START "Start"
#define D_STD_TIME "STD"
#define D_STOP "Stop"
#define D_SUBNET_MASK "Masque sous réseau"
#define D_SUBSCRIBE_TO "Souscrire à"
#define D_SUCCESSFUL "Réussi"
#define D_TEMPERATURE "Temperature"
#define D_TO "à"
#define D_TOGGLE "Bascule"
#define D_TOPIC "Topic"
#define D_TRANSMIT "Transmettre"
#define D_TRUE "Vrai"
#define D_UPGRADE "upgrade"
#define D_UPLOAD "Upload"
#define D_UPTIME "Uptime"
#define D_USER "Utilisateur"
#define D_UTC_TIME "UTC"
#define D_UV_LEVEL "Niveau UV"
#define D_VERSION "Version"
#define D_VOLTAGE "Voltage"
#define D_WARMLIGHT "Chaud"
#define D_WEB_SERVER "Serveur web"
// sonoff.ino
#define D_WARNING_MINIMAL_VERSION "WARNING This version does not support persistent settings"
#define D_LEVEL_10 "level 1-0"
#define D_LEVEL_01 "level 0-1"
#define D_SERIAL_LOGGING_DISABLED "Journalisation série désactivé"
#define D_SYSLOG_LOGGING_REENABLED "Jounalisation syslog réactivé"
#define D_SET_BAUDRATE_TO "Definir baudrate à"
#define D_RECEIVED_TOPIC "Topic reçu"
#define D_DATA_SIZE "Taille données"
#define D_ANALOG_INPUT "Analogique"
#define D_FINGERPRINT "Verification empreinte TLS ..."
#define D_TLS_CONNECT_FAILED_TO "Echec de connexion TLS à"
#define D_RETRY_IN "Nouvelle tentative dans"
#define D_VERIFIED "Verifié"
#define D_INSECURE "Connexion non sécurisée car empreinte non vérifée"
#define D_CONNECT_FAILED_TO "Echec de connexion à"
// support.ino
#define D_OSWATCH "osWatch"
#define D_BLOCKED_LOOP "Boucle bloquée"
#define D_WPS_FAILED_WITH_STATUS "WPSconfig ECHOUÉ avec status"
#define D_ACTIVE_FOR_3_MINUTES "actif pour 3 minutes"
#define D_FAILED_TO_START "Echec de démarrage"
#define D_PATCH_ISSUE_2186 "Patch issue 2186"
#define D_CONNECTING_TO_AP "Connexion à l'AP"
#define D_IN_MODE "en mode"
#define D_CONNECT_FAILED_NO_IP_ADDRESS "Echec de connexion car aucune adresse IP n'a été reçue"
#define D_CONNECT_FAILED_AP_NOT_REACHED "Echec de connexion car l'AP ne peut-être contacté"
#define D_CONNECT_FAILED_WRONG_PASSWORD "Echec de connexion car le mot de passe de l'AP est incorrect"
#define D_CONNECT_FAILED_AP_TIMEOUT "Echec de connexion avec l'AP, expiré"
#define D_ATTEMPTING_CONNECTION "Tentative de connexion..."
#define D_CHECKING_CONNECTION "Verification connexion..."
#define D_QUERY_DONE "Requête terminé. Services MQTT trouvés"
#define D_MQTT_SERVICE_FOUND "Service MQTT trouvé sur"
#define D_FOUND_AT "trouvé à"
#define D_SYSLOG_HOST_NOT_FOUND "Host syslog introuvable"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Enregistré dans la flash à"
#define D_LOADED_FROM_FLASH_AT "Chargé de la flash à"
#define D_USE_DEFAULTS "Utiliser par défaut"
#define D_ERASED_SECTOR "Secteur effacé"
// webserver.ino
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "Firmware MINIMAL - merci de mettre à jour"
#define D_WEBSERVER_ACTIVE_ON "Serveur web actif sur"
#define D_WITH_IP_ADDRESS "avec l'adresse IP"
#define D_WEBSERVER_STOPPED "Serveur web éteint"
#define D_FILE_NOT_FOUND "Fichier introuvable"
#define D_REDIRECTED "Redirection sur le portail captif"
#define D_WIFIMANAGER_SET_ACCESSPOINT_AND_STATION "Wifimanager defini AccessPoint et garde station"
#define D_WIFIMANAGER_SET_ACCESSPOINT "Wifimanager defini AccessPoint"
#define D_TRYING_TO_CONNECT "Tentative de connexion du module au réseau"
#define D_RESTART_IN "Redémarrage dans"
#define D_SECONDS "secondes"
#define D_DEVICE_WILL_RESTART "Le module va redémarrer dans quelques secondes"
#define D_BUTTON_TOGGLE "on/off"
#define D_CONFIGURATION "Configuration"
#define D_INFORMATION "Information"
#define D_FIRMWARE_UPGRADE "Mise à jour Firmware"
#define D_CONSOLE "Console"
#define D_CONFIRM_RESTART "Confirmer redémarrage"
#define D_CONFIGURE_MODULE "Configuration Module"
#define D_CONFIGURE_WIFI "Configuration WiFi"
#define D_CONFIGURE_MQTT "Configuration MQTT"
#define D_CONFIGURE_DOMOTICZ "Configuration Domoticz"
#define D_CONFIGURE_LOGGING "Configuration Logging"
#define D_CONFIGURE_OTHER "Autre configuration"
#define D_CONFIRM_RESET_CONFIGURATION "Confirmer réinitialisation configuration"
#define D_RESET_CONFIGURATION "Réinitialisation Configuration"
#define D_BACKUP_CONFIGURATION "Sauvegarde Configuration"
#define D_RESTORE_CONFIGURATION "Restauration Configuration"
#define D_MAIN_MENU "Menu principal"
#define D_MODULE_PARAMETERS "Paramètres module"
#define D_MODULE_TYPE "Type module"
#define D_GPIO "GPIO"
#define D_SERIAL_IN "Serial In"
#define D_SERIAL_OUT "Serial Out"
#define D_WIFI_PARAMETERS "Paramètres Wifi"
#define D_SCAN_FOR_WIFI_NETWORKS "Scan des réseaux wifi"
#define D_SCAN_DONE "Scan terminé"
#define D_NO_NETWORKS_FOUND "Aucun réseau trouvé"
#define D_REFRESH_TO_SCAN_AGAIN "Rafraichir pour scanner à nouveau"
#define D_DUPLICATE_ACCESSPOINT "AccessPoint dupliqué"
#define D_SKIPPING_LOW_QUALITY "Passe car mauvaise qualité"
#define D_RSSI "RSSI"
#define D_WEP "WEP"
#define D_WPA_PSK "WPA PSK"
#define D_WPA2_PSK "WPA2 PSK"
#define D_AP1_SSID "AP1 SSID"
#define D_AP1_PASSWORD "Mot de passe AP1"
#define D_AP2_SSID "AP2 SSId"
#define D_AP2_PASSWORD "Mot de passe AP2"
#define D_MQTT_PARAMETERS "Paramètres MQTT"
#define D_CLIENT "Client"
#define D_FULL_TOPIC "topic complet"
#define D_LOGGING_PARAMETERS "Paramètres journalisation"
#define D_SERIAL_LOG_LEVEL "Niveau de journalisation série"
#define D_WEB_LOG_LEVEL "Niveau de journalisation web"
#define D_SYS_LOG_LEVEL "Niveau syslog"
#define D_MORE_DEBUG "Plus de debug"
#define D_SYSLOG_HOST "Host syslog"
#define D_SYSLOG_PORT "Host syslog"
#define D_TELEMETRY_PERIOD "Période télémetrie"
#define D_OTHER_PARAMETERS "Autres paramètres"
#define D_WEB_ADMIN_PASSWORD "Mot de passe Web Admin"
#define D_MQTT_ENABLE "MQTT activé"
#define D_FRIENDLY_NAME "Nom d'usage"
#define D_BELKIN_WEMO "Belkin WeMo"
#define D_HUE_BRIDGE "Hue Bridge"
#define D_SINGLE_DEVICE "module unique"
#define D_MULTI_DEVICE "multi module"
#define D_SAVE_CONFIGURATION "Enregistrer configuration"
#define D_CONFIGURATION_SAVED "Configuration enregistré"
#define D_CONFIGURATION_RESET "Configuration réinitialisé"
#define D_PROGRAM_VERSION "Version Programme"
#define D_BUILD_DATE_AND_TIME "Date & Heure de build"
#define D_CORE_AND_SDK_VERSION "Version Core/SDK"
#define D_FLASH_WRITE_COUNT "Compteur écriture flash"
#define D_MAC_ADDRESS "Adresse MAC"
#define D_MQTT_HOST "Hôte MQTT"
#define D_MQTT_PORT "Port MQTT"
#define D_MQTT_CLIENT "Client MQTT"
#define D_MQTT_USER "Utilisateur MQTT"
#define D_MQTT_TOPIC "Topic MQTT"
#define D_MQTT_GROUP_TOPIC "Groupe topic MQTT"
#define D_MQTT_FULL_TOPIC "Topic complet MQTT"
#define D_MDNS_DISCOVERY "Découverte mDNS"
#define D_MDNS_ADVERTISE "Annonce mDNS"
#define D_ESP_CHIP_ID "ESP Chip Id"
#define D_FLASH_CHIP_ID "Flash Chip Id"
#define D_FLASH_CHIP_SIZE "Taille flash"
#define D_FREE_PROGRAM_SPACE "Espace programme libre"
#define D_UPGRADE_BY_WEBSERVER "Mise à jour par serveur web"
#define D_OTA_URL "URL OTA"
#define D_START_UPGRADE "Lancer la mise à jour"
#define D_UPGRADE_BY_FILE_UPLOAD "Mise à jour par téléchargement fichier"
#define D_UPLOAD_STARTED "Téléchargement lancé"
#define D_UPGRADE_STARTED "Mise à jour lancé"
#define D_UPLOAD_DONE "Téléchargement terminé"
#define D_UPLOAD_ERR_1 "Aucun fichier sélectionné"
#define D_UPLOAD_ERR_2 "Espace insuffisant"
#define D_UPLOAD_ERR_3 "Magic byte n'est pas 0xE9"
#define D_UPLOAD_ERR_4 "La taille de la flash programme est plus grande que la taille réelle de la flash"
#define D_UPLOAD_ERR_5 "Erreur comparaison buffer de téléchargement"
#define D_UPLOAD_ERR_6 "Téléchargement échoué. Activation logging 3"
#define D_UPLOAD_ERR_7 "Téléchargement annulé"
#define D_UPLOAD_ERR_8 "Fichier invalide"
#define D_UPLOAD_ERR_9 "Fichier trop grand"
#define D_UPLOAD_ERROR_CODE "Code d'erreur téléchargement"
#define D_ENTER_COMMAND "Saisir commande"
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Activer weblog 2 si response attendue"
#define D_NEED_USER_AND_PASSWORD "Nécessite utilisateur=<username>&password=<password>"
// xdrv_wemohue.ino
#define D_MULTICAST_DISABLED "Multicast désactivé"
#define D_MULTICAST_REJOINED "Multicast (re)joint"
#define D_MULTICAST_JOIN_FAILED "Multicast echec abonnement"
#define D_FAILED_TO_SEND_RESPONSE "Echec d'envoi réponse"
#define D_WEMO "WeMo"
#define D_WEMO_BASIC_EVENT "WeMo basic event"
#define D_WEMO_EVENT_SERVICE "WeMo event service"
#define D_WEMO_META_SERVICE "WeMo meta service"
#define D_WEMO_SETUP "Réglage WeMo"
#define D_RESPONSE_SENT "Response envoyé"
#define D_HUE "Hue"
#define D_HUE_BRIDGE_SETUP "Réglage Hue"
#define D_HUE_API_NOT_IMPLEMENTED "API Hue non implémentée"
#define D_HUE_API "Hue API"
#define D_HUE_POST_ARGS "Hue POST args"
#define D_3_RESPONSE_PACKETS_SENT "3 paquets response envoyés"
// xdrv_02_irremote.ino
#define D_JSON_INVALID_JSON "JSON Invalide"
#define D_JSON_PROTOCOL_NOT_SUPPORTED "Protocole non supporté"
#define D_JSON_IR_PROTOCOL "PROTOCOL"
#define D_JSON_IR_BITS "BITS"
#define D_JSON_IR_DATA "DATA"
#define D_JSON_IRHVAC_VENDOR "VENDOR"
#define D_JSON_IRHVAC_POWER "POWER"
#define D_JSON_IRHVAC_MODE "MODE"
#define D_JSON_IRHVAC_FANSPEED "FANSPEED"
#define D_JSON_IRHVAC_TEMP "TEMP"
#define D_JSON_IRRECEIVED "IrReceived"
// xdrv_05_domoticz.ino
#define D_DOMOTICZ_PARAMETERS "Paramètres Domoticz"
#define D_DOMOTICZ_IDX "Idx"
#define D_DOMOTICZ_KEY_IDX "Key idx"
#define D_DOMOTICZ_SWITCH_IDX "Switch idx"
#define D_DOMOTICZ_SENSOR_IDX "Sensor idx"
#define D_DOMOTICZ_TEMP "Temp"
#define D_DOMOTICZ_TEMP_HUM "Temp,Hum"
#define D_DOMOTICZ_TEMP_HUM_BARO "Temp,Hum,Baro"
#define D_DOMOTICZ_POWER_ENERGY "Power,Energy"
#define D_DOMOTICZ_ILLUMINANCE "Illuminance"
#define D_DOMOTICZ_COUNT "Count"
#define D_DOMOTICZ_VOLTAGE "Voltage"
#define D_DOMOTICZ_CURRENT "Current"
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
#define D_DOMOTICZ_UPDATE_TIMER "Update timer"
// xsns_03_energy.ino
#define D_ENERGY_TODAY "Energie aujourd'hui"
#define D_ENERGY_YESTERDAY "Energie hier"
#define D_ENERGY_TOTAL "Energie totale"
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Capteur occupé"
#define D_SENSOR_CRC_ERROR "Erreur CRC capteur"
#define D_SENSORS_FOUND "Capteur trouvé"
// xsns_06_dht.ino
#define D_TIMEOUT_WAITING_FOR "Expiré attend pour"
#define D_START_SIGNAL_LOW "Signal démarrage bas"
#define D_START_SIGNAL_HIGH "Signal démarrage haut"
#define D_PULSE "pulse"
#define D_CHECKSUM_FAILURE "Echec checksum"
// xsns_07_sht1x.ino
#define D_SENSOR_DID_NOT_ACK_COMMAND "Sensor did not ACK command"
#define D_SHT1X_FOUND "SHT1X found"
// xsns_18_pms5003.ino
#define D_STANDARD_CONCENTRATION "Standard Concentration"
#define D_ENVIRONMENTAL_CONCENTRATION "Environmental Concentration"
#define D_PARTICALS_BEYOND "Particals beyond"
// sonoff_template.h
// Max string length is 8 characters including suffixes
#define D_SENSOR_NONE "None"
#define D_SENSOR_DHT11 "DHT11"
#define D_SENSOR_AM2301 "AM2301"
#define D_SENSOR_SI7021 "SI7021"
#define D_SENSOR_DS18X20 "DS18x20"
#define D_SENSOR_I2C_SCL "I2C SCL"
#define D_SENSOR_I2C_SDA "I2C SDA"
#define D_SENSOR_WS2812 "WS2812"
#define D_SENSOR_IRSEND "IRsend"
#define D_SENSOR_SWITCH "Switch" // Suffix "1"
#define D_SENSOR_BUTTON "Button" // Suffix "1"
#define D_SENSOR_RELAY "Relay" // Suffix "1i"
#define D_SENSOR_LED "LED" // Suffix "1i"
#define D_SENSOR_PWM "PWM" // Suffix "1"
#define D_SENSOR_COUNTER "Counter" // Suffix "1"
#define D_SENSOR_IRRECV "IRrecv"
#define D_SENSOR_MHZ_RX "MHZ Rx"
#define D_SENSOR_MHZ_TX "MHZ Tx"
#define D_SENSOR_PZEM_RX "PZEM Rx"
#define D_SENSOR_PZEM_TX "PZEM Tx"
#define D_SENSOR_SAIR_RX "SAir Rx"
#define D_SENSOR_SAIR_TX "SAir Tx"
#define D_SENSOR_SPI_CS "SPI CS"
#define D_SENSOR_SPI_DC "SPI DC"
#define D_SENSOR_BACKLIGHT "BkLight"
#define D_SENSOR_PMS5003 "PMS5003"
// Units
#define D_UNIT_AMPERE "A"
#define D_UNIT_HOUR "h"
#define D_UNIT_KILOOHM "kOhm"
#define D_UNIT_KILOWATTHOUR "kWh"
#define D_UNIT_LUX "lx"
#define D_UNIT_MICROGRAM_PER_CUBIC_METER "ug/m3"
#define D_UNIT_MICROMETER "um"
#define D_UNIT_MICROSECOND "us"
#define D_UNIT_MILLIAMPERE "mA"
#define D_UNIT_MILLISECOND "ms"
#define D_UNIT_MINUTE "Min"
#define D_UNIT_PARTS_PER_DECILITER "ppd"
#define D_UNIT_PARTS_PER_MILLION "ppm"
#define D_UNIT_PRESSURE "hPa"
#define D_UNIT_SECOND "sec"
#define D_UNIT_SECTORS "secteurs"
#define D_UNIT_VOLT "V"
#define D_UNIT_WATT "W"
#define D_UNIT_WATTHOUR "Wh"
// Log message prefix
#define D_LOG_APPLICATION "APP: " // Application
#define D_LOG_BRIDGE "BRG: " // Bridge
#define D_LOG_CONFIG "CFG: " // Settings
#define D_LOG_COMMAND "CMD: " // Command
#define D_LOG_DEBUG "DBG: " // Debug
#define D_LOG_DHT "DHT: " // DHT sensor
#define D_LOG_DOMOTICZ "DOM: " // Domoticz
#define D_LOG_DSB "DSB: " // DS18xB20 sensor
#define D_LOG_HTTP "HTP: " // HTTP webserver
#define D_LOG_I2C "I2C: " // I2C
#define D_LOG_IRR "IRR: " // Infra Red Received
#define D_LOG_LOG "LOG: " // Logging
#define D_LOG_MODULE "MOD: " // Module
#define D_LOG_MDNS "DNS: " // mDNS
#define D_LOG_MQTT "MQT: " // MQTT
#define D_LOG_OTHER "OTH: " // Other
#define D_LOG_RESULT "RSL: " // Result
#define D_LOG_RFR "RFR: " // RF Received
#define D_LOG_SERIAL "SER: " // Serial
#define D_LOG_SHT1 "SHT: " // SHT1x sensor
#define D_LOG_UPLOAD "UPL: " // Upload
#define D_LOG_UPNP "UPP: " // UPnP
#define D_LOG_WIFI "WIF: " // Wifi
#endif // _LANGUAGE_FR_FR_H_

View File

@ -44,32 +44,24 @@
#define D_DECIMAL_SEPARATOR "."
// Common
#define D_ABORTED "Aborted"
#define D_ACTIVE "Active"
#define D_ADMIN "Admin"
#define D_AIR_QUALITY "Qualita' dell'aria"
#define D_AP "AP" // Access Point
#define D_APMAC_ADDRESS "APMac"
#define D_APPENDED "Appended"
#define D_AS "come"
#define D_AUTO "AUTO"
#define D_BAUDRATE "Baudrate"
#define D_BLINK "Blink"
#define D_BLINKOFF "BlinkOff"
#define D_BOOTVERSION "Boot"
#define D_BOOT_COUNT "Boot Count"
#define D_BOOTCOUNT "BootCount"
#define D_BRIGHTLIGHT "Luminoso"
#define D_BUILDDATETIME "BuildDateTime"
#define D_BUTTON "Pulsante"
#define D_BY "da" // Written by me
#define D_BYTES "Bytes"
#define D_CELSIUS "Celsius"
#define D_CO2 "CO2"
#define D_CODE "codice" // Button code
#define D_COLDLIGHT "Fredda"
#define D_COMMAND "Command"
#define D_CONNECTED "Connesso"
#define D_COREVERSION "Core"
#define D_COUNT "Conteggio"
#define D_COUNTER "Contatore"
#define D_CURRENT "Corrente" // As in Voltage and Current
@ -78,36 +70,25 @@
#define D_DEBUG "Debug"
#define D_DISABLED "Disabilitato"
#define D_DNS_SERVER "DNS Server"
#define D_DNSSERVER "DNSServer"
#define D_DONE "Fatto"
#define D_DST_TIME "DST"
#define D_EMPTY "Empty"
#define D_EMULATION "Emulazione"
#define D_ENABLED "Abilitato"
#define D_ENDDST "EndDST" // End Daylight Savings Time
#define D_ERASE "Erase"
#define D_ERROR "Error"
#define D_EVERY "Ogni"
#define D_FAHRENHEIT "Fahrenheit"
#define D_FAILED "Fallito"
#define D_FALLBACK "Fallback"
#define D_FALLBACK_TOPIC "Topic Riserva"
#define D_FALLBACKTOPIC "FallbackTopic"
#define D_FALSE "False"
#define D_FILE "File"
#define D_FLASHMODE "FlashMode"
#define D_FLASHSIZE "FlashSize"
#define D_FREE_MEMORY "Memoria Libera"
#define D_FREEMEMORY "Free"
#define D_FROM "from"
#define D_GAS "Gas"
#define D_GATEWAY "Gateway"
#define D_GROUP "Gruppo"
#define D_HEAPSIZE "Heap"
#define D_HOST "Host"
#define D_HOSTNAME "Hostname"
#define D_HUMIDITY "Umidita'"
#define D_ID "Id"
#define D_ILLUMINANCE "Illuminazione"
#define D_IMMEDIATE "immediato" // Button immediate
#define D_INDEX "Index"
@ -115,15 +96,10 @@
#define D_INITIALIZED "Inizializzato"
#define D_IP_ADDRESS "Indirizzo IP"
#define D_LIGHT "Luce"
#define D_LIMIT "Limit"
#define D_LOCAL_TIME "Local"
#define D_LWT "LWT"
#define D_MAC "Mac"
#define D_MASK "Mask"
#define D_MODULE "Module"
#define D_MQTT "MQTT"
#define D_MULTI_PRESS "multi-pressione"
#define D_NO "No"
#define D_NOISE "Rumore"
#define D_NONE "Nessuno"
#define D_OFF "Off"
@ -138,41 +114,24 @@
#define D_PRESSURE "Pressione"
#define D_PRESSUREATSEALEVEL "Pressione al livello del mare"
#define D_PROGRAM_FLASH_SIZE "Dimensione Flash Programma"
#define D_PROGRAMFLASHSIZE "ProgramFlashSize"
#define D_PROGRAM_SIZE "Dimensione Programma"
#define D_PROGRAMSIZE "ProgramSize"
#define D_PROJECT "Project"
#define D_RECEIVED "Ricevuto"
#define D_RESTART "Riavvio"
#define D_RESTARTING "Restarting"
#define D_RESTART_REASON "Causa Riavvio"
#define D_RESTARTREASON "RestartReason"
#define D_RESTORE "ripristino"
#define D_RETAINED "salvato"
#define D_SAVE "Salva"
#define D_SAVEADDRESS "SaveAddress"
#define D_SAVECOUNT "SaveCount"
#define D_SAVESTATE "SaveState"
#define D_SDKVERSION "SDK"
#define D_SELECTED "selected"
#define D_SENSOR "Sensore"
#define D_SERIAL "Seriale"
#define D_BYTES "Bytes"
#define D_SSID "SSId"
#define D_START "Start"
#define D_STARTED "Started"
#define D_STARTDST "StartDST" // Start Daylight Savings Time
#define D_STD_TIME "STD"
#define D_STOP "Stop"
#define D_SUBNET_MASK "Maschera sottorete"
#define D_SUBNETMASK "Subnetmask"
#define D_SUBSCRIBE_TO "Sottoscrivi a"
#define D_SUCCESSFUL "Successful"
#define D_SWITCH "Switch"
#define D_SYS "Sys" // Sys log
#define D_TEMPERATURE "Temperature"
#define D_TEMPERATURE_UNIT "TempUnit"
#define D_TIME "Time"
#define D_TO "a"
#define D_TOGGLE "Toggle"
#define D_TOPIC "Topic"
@ -184,15 +143,13 @@
#define D_USER "Utente"
#define D_UTC_TIME "UTC"
#define D_UV_LEVEL "Livello UV"
#define D_VCC "Vcc"
#define D_VERSION "Version"
#define D_VOLTAGE "Tensione"
#define D_WARMLIGHT "Calda"
#define D_WEB "Web" // Web log
#define D_WEB_SERVER "Web Server"
#define D_WIFI "Wifi"
// sonoff.ino
#define D_WARNING_MINIMAL_VERSION "WARNING This version does not support persistent settings"
#define D_LEVEL_10 "level 1-0"
#define D_LEVEL_01 "level 0-1"
#define D_SERIAL_LOGGING_DISABLED "Log seriale disabilitato"
@ -227,10 +184,7 @@
#define D_CHECKING_CONNECTION "Controllo connessione..."
#define D_QUERY_DONE "Query eseguita. Servizio MQTT trovato"
#define D_MQTT_SERVICE_FOUND "Servizio MQTT trovato su"
#define D_I2CSCAN_DEVICES_FOUND_AT "Dispositivo/i trovato a"
#define D_FOUND_AT "trovato a"
#define D_I2CSCAN_UNKNOWN_ERROR_AT "Errore sconosciuto a"
#define D_I2CSCAN_NO_DEVICES_FOUND "Nessun dispositivo trovato"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog Host non trovato"
// settings.ino
@ -299,7 +253,9 @@
#define D_FULL_TOPIC "Full Topic"
#define D_LOGGING_PARAMETERS "Parametri Logging"
#define D_LOG_LEVEL "livello di log"
#define D_SERIAL_LOG_LEVEL "Seriale livello di log"
#define D_WEB_LOG_LEVEL "Web livello di log"
#define D_SYS_LOG_LEVEL "Sys livello di log"
#define D_MORE_DEBUG "Debug aggiuntivo"
#define D_SYSLOG_HOST "Syslog host"
#define D_SYSLOG_PORT "Syslog porta"
@ -392,17 +348,6 @@
#define D_JSON_IRHVAC_TEMP "TEMP"
#define D_JSON_IRRECEIVED "IrReceived"
// xdrv_04_snfbridge.ino
#define D_RFRECEIVED "RfReceived"
#define D_START_LEARNING "Avvio apprendimento"
#define D_SET_TO_DEFAULT "Imposta al default"
#define D_DEFAULT_SENT "Default inviato"
#define D_LEARNED_SENT "Apprendimento inviato"
#define D_LEARNING_ACTIVE "Apprendimento attivo"
#define D_LEARN_FAILED "Apprendimento fallito"
#define D_LEARNED "Appreso"
#define D_SAVED "Salvato"
// xdrv_05_domoticz.ino
#define D_DOMOTICZ_PARAMETERS "Parametri Domoticz"
#define D_DOMOTICZ_IDX "Idx"
@ -420,12 +365,7 @@
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
#define D_DOMOTICZ_UPDATE_TIMER "Intervallo di aggiornamento"
// xsns_03_energy.ino
#define D_MAXPOWERREACHED "MaxPowerReached"
#define D_MAXPOWERREACHEDRETRY "MaxPowerReachedRetry"
#define D_POWERMONITOR "PowerMonitor"
#define D_ENERGYMONITOR "EnergyMonitor"
#define D_MAXENERGYREACHED "MaxEnergyReached"
// xdrv_03_energy.ino
#define D_ENERGY_TODAY "Energia Oggi"
#define D_ENERGY_YESTERDAY "Energia Ieri"
#define D_ENERGY_TOTAL "Energia Totale"
@ -446,6 +386,11 @@
#define D_SENSOR_DID_NOT_ACK_COMMAND "Sensore non ha eseguito il comando ACK"
#define D_SHT1X_FOUND "SHT1X trovato"
// xsns_18_pms5003.ino
#define D_STANDARD_CONCENTRATION "Standard Concentration"
#define D_ENVIRONMENTAL_CONCENTRATION "Environmental Concentration"
#define D_PARTICALS_BEYOND "Particals beyond"
// sonoff_template.h
// Max string length is 8 characters including suffixes
#define D_SENSOR_NONE "None"
@ -473,6 +418,7 @@
#define D_SENSOR_SPI_CS "SPI CS"
#define D_SENSOR_SPI_DC "SPI DC"
#define D_SENSOR_BACKLIGHT "BkLight"
#define D_SENSOR_PMS5003 "PMS5003"
// Units
#define D_UNIT_AMPERE "A"
@ -480,11 +426,14 @@
#define D_UNIT_KILOOHM "kOhm"
#define D_UNIT_KILOWATTHOUR "kWh"
#define D_UNIT_LUX "lx"
#define D_UNIT_MICROGRAM_PER_CUBIC_METER "ug/m3"
#define D_UNIT_MICROMETER "um"
#define D_UNIT_MICROSECOND "us"
#define D_UNIT_MILLIAMPERE "mA"
#define D_UNIT_MILLISECOND "ms"
#define D_UNIT_MINUTE "Min"
#define D_UNIT_PPM "ppm"
#define D_UNIT_PARTS_PER_DECILITER "ppd"
#define D_UNIT_PARTS_PER_MILLION "ppm"
#define D_UNIT_PRESSURE "hPa"
#define D_UNIT_SECOND "sec"
#define D_UNIT_SECTORS "settori"

View File

@ -44,32 +44,24 @@
#define D_DECIMAL_SEPARATOR ","
// Common
#define D_ABORTED "Afgebroken"
#define D_ACTIVE "Actief"
#define D_ADMIN "Admin"
#define D_AIR_QUALITY "Lucht kwalitiet"
#define D_AP "AP" // Access Point
#define D_APMAC_ADDRESS "APMac"
#define D_APPENDED "Aangevuld"
#define D_AS "als"
#define D_AUTO "AUTO"
#define D_BAUDRATE "Baudrate"
#define D_BLINK "Knipper"
#define D_BLINKOFF "KnipperUit"
#define D_BOOTVERSION "Boot"
#define D_BOOT_COUNT "Herstarts"
#define D_BOOTCOUNT "Herstarts"
#define D_BRIGHTLIGHT "Fel"
#define D_BUILDDATETIME "BuildDateTime"
#define D_BUTTON "DrukKnop"
#define D_BY "door" // Written by me
#define D_BYTES "Bytes"
#define D_CELSIUS "Celsius"
#define D_CO2 "Koolstofdioxide"
#define D_CODE "code" // Button code
#define D_COLDLIGHT "Koud"
#define D_COMMAND "Opdracht"
#define D_CONNECTED "Verbonden"
#define D_COREVERSION "Core"
#define D_COUNT "Aantal"
#define D_COUNTER "Teller"
#define D_CURRENT "Stroom" // As in Voltage and Current
@ -78,36 +70,25 @@
#define D_DEBUG "Debug"
#define D_DISABLED "Uitgeschakeld"
#define D_DNS_SERVER "DNS Server"
#define D_DNSSERVER "DNSServer"
#define D_DONE "Klaar"
#define D_DST_TIME "ZT"
#define D_EMPTY "Leeg"
#define D_EMULATION "Emulatie"
#define D_ENABLED "Geactiveerd"
#define D_ENDDST "WinterTijd" // End Daylight Savings Time
#define D_ERASE "Wissen"
#define D_ERROR "Fout"
#define D_EVERY "Iedere"
#define D_FAHRENHEIT "Fahrenheit"
#define D_FAILED "Mislukt"
#define D_FALLBACK "Fallback"
#define D_FALLBACK_TOPIC "Fallback Topic"
#define D_FALLBACKTOPIC "FallbackTopic"
#define D_FALSE "Onwaar"
#define D_FILE "Bestand"
#define D_FLASHMODE "FlashStand"
#define D_FLASHSIZE "FlashGrootte"
#define D_FREE_MEMORY "Vrij geheugen"
#define D_FREEMEMORY "Vrij"
#define D_FROM "van"
#define D_GAS "Gas"
#define D_GATEWAY "Gateway"
#define D_GROUP "Groep"
#define D_HEAPSIZE "Heap"
#define D_HOST "Host"
#define D_HOSTNAME "Hostnaam"
#define D_HUMIDITY "Luchtvochtigheid"
#define D_ID "Id"
#define D_ILLUMINANCE "Verlichtingssterkte"
#define D_IMMEDIATE "onmiddelijk" // Button immediate
#define D_INDEX "Index"
@ -115,15 +96,10 @@
#define D_INITIALIZED "Geinitialiseerd"
#define D_IP_ADDRESS "IP Adres"
#define D_LIGHT "Licht"
#define D_LIMIT "Grenswaarde"
#define D_LOCAL_TIME "Plaatselijk"
#define D_LWT "LWT"
#define D_MAC "Mac"
#define D_MASK "Masker"
#define D_MODULE "Module"
#define D_MQTT "MQTT"
#define D_MULTI_PRESS "meervoudig"
#define D_NO "Nee"
#define D_NOISE "Lawaai"
#define D_NONE "Geen"
#define D_OFF "Uit"
@ -138,41 +114,24 @@
#define D_PRESSURE "Luchtdruk"
#define D_PRESSUREATSEALEVEL "ZeeLuchtdruk"
#define D_PROGRAM_FLASH_SIZE "Programma Flash Grootte"
#define D_PROGRAMFLASHSIZE "ProgrammaFlashGrootte"
#define D_PROGRAM_SIZE "Programma Grootte"
#define D_PROGRAMSIZE "ProgrammaGrootte"
#define D_PROJECT "Project"
#define D_RECEIVED "Ontvangen"
#define D_RESTART "Herstart"
#define D_RESTARTING "Herstarten"
#define D_RESTART_REASON "Reden herstart"
#define D_RESTARTREASON "RedenHerstart"
#define D_RESTORE "herstellen"
#define D_RETAINED "retained"
#define D_SAVE "Opslaan"
#define D_SAVEADDRESS "OpslagAdres"
#define D_SAVECOUNT "AantalOpslagen"
#define D_SAVESTATE "OpslagToestand"
#define D_SDKVERSION "SDK"
#define D_SELECTED "gekozen"
#define D_SENSOR "Sensor"
#define D_SERIAL "Serieel"
#define D_BYTES "Bytes"
#define D_SSID "SSId"
#define D_START "Start"
#define D_STARTED "Gestart"
#define D_STARTDST "Zomertijd" // Start Daylight Savings Time
#define D_STD_TIME "WT"
#define D_STOP "Stop"
#define D_SUBNET_MASK "Subnet Masker"
#define D_SUBNETMASK "Subnetmasker"
#define D_SUBSCRIBE_TO "Abonneer op"
#define D_SUCCESSFUL "Gelukt"
#define D_SWITCH "Schakelaar"
#define D_SYS "Sys" // Sys log
#define D_TEMPERATURE "Temperatuur"
#define D_TEMPERATURE_UNIT "TempEenheid"
#define D_TIME "Tijd"
#define D_TO "naar"
#define D_TOGGLE "Toggle" // Wissel, Tuimel
#define D_TOPIC "Topic" // Onderwerp
@ -184,15 +143,13 @@
#define D_USER "Gebruiker"
#define D_UTC_TIME "UTC"
#define D_UV_LEVEL "UV niveau"
#define D_VCC "Vcc"
#define D_VERSION "Versie"
#define D_VOLTAGE "Spanning"
#define D_WARMLIGHT "Warm"
#define D_WEB "Web" // Web log
#define D_WEB_SERVER "Webserver"
#define D_WIFI "Wifi"
// sonoff.ino
#define D_WARNING_MINIMAL_VERSION "WAARSCHUWING Deze versie bewaart geen instellingen"
#define D_LEVEL_10 "niveau 1-0"
#define D_LEVEL_01 "niveau 0-1"
#define D_SERIAL_LOGGING_DISABLED "Serieel logging uitgeschakeld"
@ -227,10 +184,7 @@
#define D_CHECKING_CONNECTION "Controleer verbinding..."
#define D_QUERY_DONE "Aanvraag klaar. Aantal MQTT diensten gevonden"
#define D_MQTT_SERVICE_FOUND "MQTT dienst gevonden op"
#define D_I2CSCAN_DEVICES_FOUND_AT "Apparaten gevonden op"
#define D_FOUND_AT "gevonden op"
#define D_I2CSCAN_UNKNOWN_ERROR_AT "Onbekende fout op"
#define D_I2CSCAN_NO_DEVICES_FOUND "Geen apparaten gevonden"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog Host niet gevonden"
// settings.ino
@ -299,7 +253,9 @@
#define D_FULL_TOPIC "Volledig Topic"
#define D_LOGGING_PARAMETERS "Logging parameters"
#define D_LOG_LEVEL "log niveau"
#define D_SERIAL_LOG_LEVEL "Serieel log niveau"
#define D_WEB_LOG_LEVEL "Web log niveau"
#define D_SYS_LOG_LEVEL "Syslog niveau"
#define D_MORE_DEBUG "Meer debug"
#define D_SYSLOG_HOST "Syslog host"
#define D_SYSLOG_PORT "Syslog poort"
@ -392,17 +348,6 @@
#define D_JSON_IRHVAC_TEMP "TEMP"
#define D_JSON_IRRECEIVED "IrReceived"
// xdrv_04_snfbridge.ino
#define D_RFRECEIVED "RfReceived"
#define D_START_LEARNING "Start leren"
#define D_SET_TO_DEFAULT "Zet standaard waarden"
#define D_DEFAULT_SENT "Standaard verzonden"
#define D_LEARNED_SENT "Geleerde verzonden"
#define D_LEARNING_ACTIVE "Leren actief"
#define D_LEARN_FAILED "Leren mislukt"
#define D_LEARNED "Geleerd"
#define D_SAVED "Opgeslagen"
// xdrv_05_domoticz.ino
#define D_DOMOTICZ_PARAMETERS "Domoticz parameters"
#define D_DOMOTICZ_IDX "Idx"
@ -420,12 +365,7 @@
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
#define D_DOMOTICZ_UPDATE_TIMER "Bijwerk timer"
// xsns_03_energy.ino
#define D_MAXPOWERREACHED "MaxPowerReached"
#define D_MAXPOWERREACHEDRETRY "MaxPowerReachedRetry"
#define D_POWERMONITOR "PowerMonitor"
#define D_ENERGYMONITOR "EnergyMonitor"
#define D_MAXENERGYREACHED "MaxEnergyReached"
// xdrv_03_energy.ino
#define D_ENERGY_TODAY "Verbruik vandaag"
#define D_ENERGY_YESTERDAY "Verbruik gisteren"
#define D_ENERGY_TOTAL "Verbruik totaal"
@ -446,6 +386,11 @@
#define D_SENSOR_DID_NOT_ACK_COMMAND "Geen opdracht ACK van sensor"
#define D_SHT1X_FOUND "SHT1X gevonden"
// xsns_18_pms5003.ino
#define D_STANDARD_CONCENTRATION "Standard Concentration"
#define D_ENVIRONMENTAL_CONCENTRATION "Environmental Concentration"
#define D_PARTICALS_BEYOND "Particals beyond"
// sonoff_template.h
// Max string length is 8 characters including suffixes
#define D_SENSOR_NONE "Geen"
@ -473,6 +418,7 @@
#define D_SENSOR_SPI_CS "SPI CS"
#define D_SENSOR_SPI_DC "SPI DC"
#define D_SENSOR_BACKLIGHT "BkLight"
#define D_SENSOR_PMS5003 "PMS5003"
// Units
#define D_UNIT_AMPERE "A"
@ -480,11 +426,14 @@
#define D_UNIT_KILOOHM "kOhm"
#define D_UNIT_KILOWATTHOUR "kWh"
#define D_UNIT_LUX "lx"
#define D_UNIT_MICROGRAM_PER_CUBIC_METER "ug/m3"
#define D_UNIT_MICROMETER "um"
#define D_UNIT_MICROSECOND "us"
#define D_UNIT_MILLIAMPERE "mA"
#define D_UNIT_MILLISECOND "ms"
#define D_UNIT_MINUTE "Min"
#define D_UNIT_PPM "ppm"
#define D_UNIT_PARTS_PER_DECILITER "ppd"
#define D_UNIT_PARTS_PER_MILLION "ppm"
#define D_UNIT_PRESSURE "hPa"
#define D_UNIT_SECOND "sec"
#define D_UNIT_SECTORS "sectoren"

View File

@ -44,32 +44,24 @@
#define D_DECIMAL_SEPARATOR ","
// Common
#define D_ABORTED "Anulowany"
#define D_ACTIVE "Aktywny"
#define D_ADMIN "Admin"
#define D_AIR_QUALITY "Jakosc powietrza"
#define D_AP "AP" // Access Point
#define D_APMAC_ADDRESS "APMac"
#define D_APPENDED "Dolaczony"
#define D_AS "jak"
#define D_AUTO "AUTO"
#define D_BAUDRATE "Szybkosc transmisji"
#define D_BLINK "Miganie"
#define D_BLINKOFF "MiganieWyl"
#define D_BOOTVERSION "Uruchomienie"
#define D_BOOT_COUNT "Licznik uruchomienia"
#define D_BOOTCOUNT "LiczUruchomienia"
#define D_BRIGHTLIGHT "Jasny"
#define D_BUILDDATETIME "ZbudowanoDataCzas"
#define D_BUTTON "Przycisk"
#define D_BY "by" // Written by me
#define D_BYTES "Bajtow"
#define D_CELSIUS "Celsiusza"
#define D_CO2 "Dwutlenku węgla"
#define D_CODE "kod" // Button code
#define D_COLDLIGHT "Zimny"
#define D_COMMAND "Komenda"
#define D_CONNECTED "Polaczony"
#define D_COREVERSION "Wersja"
#define D_COUNT "Licz"
#define D_COUNTER "Licznik"
#define D_CURRENT "Biezacy" // As in Voltage and Current
@ -78,36 +70,25 @@
#define D_DEBUG "Debug"
#define D_DISABLED "Zablokowany"
#define D_DNS_SERVER "Server DNS"
#define D_DNSSERVER "ServerDNS"
#define D_DONE "Wykonane"
#define D_DST_TIME "DST"
#define D_EMPTY "Pusty"
#define D_EMULATION "Emulacja"
#define D_ENABLED "Otwarty"
#define D_ENDDST "KoniecDST" // End Daylight Savings Time
#define D_ERASE "Nadpisz"
#define D_ERROR "Blad"
#define D_EVERY "Kazdy"
#define D_FAHRENHEIT "Fahrenheita"
#define D_FAILED "Bledny"
#define D_FALLBACK "Awaryjny"
#define D_FALLBACK_TOPIC "Zastepczy temat"
#define D_FALLBACKTOPIC "ZastepczyTemat"
#define D_FALSE "Falsz"
#define D_FILE "Plik"
#define D_FLASHMODE "FlashMode"
#define D_FLASHSIZE "FlashWielkosc"
#define D_FREE_MEMORY "Wolna pamiec"
#define D_FREEMEMORY "Wolne"
#define D_FROM "z"
#define D_GAS "Gas"
#define D_GATEWAY "Brama"
#define D_GROUP "Grupa"
#define D_HEAPSIZE "Stos"
#define D_HOST "Serwer"
#define D_HOSTNAME "Nazwa serwera"
#define D_HUMIDITY "Wilgotnosc"
#define D_ID "ID"
#define D_ILLUMINANCE "Oswietlenie"
#define D_IMMEDIATE "Natychmiastowe" // Button immediate
#define D_INDEX "Indeks"
@ -115,15 +96,10 @@
#define D_INITIALIZED "Zainicjowany"
#define D_IP_ADDRESS "Adres IP"
#define D_LIGHT "Swiatlo"
#define D_LIMIT "Wartość graniczna"
#define D_LOCAL_TIME "Lokalny"
#define D_LWT "LWT"
#define D_MAC "Mac"
#define D_MASK "Maska"
#define D_MODULE "Modul"
#define D_MQTT "MQTT"
#define D_MULTI_PRESS "wielokrotne-nacisniecie"
#define D_NO "Nie"
#define D_NOISE "Halas"
#define D_NONE "Brak"
#define D_OFF "Wylaczony"
@ -138,41 +114,24 @@
#define D_PRESSURE "Cisnienie"
#define D_PRESSUREATSEALEVEL "Cisnienie na poziomie morza"
#define D_PROGRAM_FLASH_SIZE "Wielkosc programu flash"
#define D_PROGRAMFLASHSIZE "ProgramFlashSize"
#define D_PROGRAM_SIZE "Wielkosc programu"
#define D_PROGRAMSIZE "ProgramSize"
#define D_PROJECT "Projekt"
#define D_RECEIVED "Otrzymany"
#define D_RESTART "Restart"
#define D_RESTARTING "Restartowanie"
#define D_RESTART_REASON "Przyczyna restartu"
#define D_RESTARTREASON "PrzyczynaRestartu"
#define D_RESTORE "Przywracanie"
#define D_RETAINED "Zachowane"
#define D_SAVE "Zapisz"
#define D_SAVEADDRESS "AdresZapisu"
#define D_SAVECOUNT "LicznikZapisu"
#define D_SAVESTATE "StanZapisu"
#define D_SDKVERSION "SDK"
#define D_SELECTED "Wybrany"
#define D_SENSOR "Czujnik"
#define D_SERIAL "Serial"
#define D_BYTES "Bajtow"
#define D_SSID "SSID"
#define D_START "Start"
#define D_STARTED "Uruchomiony"
#define D_STARTDST "StartDST" // Start Daylight Savings Time
#define D_STD_TIME "STD"
#define D_STOP "Stop"
#define D_SUBNET_MASK "Maska podsieci"
#define D_SUBNETMASK "MaskaPodsieci"
#define D_SUBSCRIBE_TO "Subskrybuj do"
#define D_SUCCESSFUL "Powodzenie"
#define D_SWITCH "Przelacznik"
#define D_SYS "System " // Sys log
#define D_TEMPERATURE "Temperatura"
#define D_TEMPERATURE_UNIT "JednTemp"
#define D_TIME "Czas"
#define D_TO "do"
#define D_TOGGLE "Przelacz"
#define D_TOPIC "Temat"
@ -184,15 +143,13 @@
#define D_USER "Uzytkownik"
#define D_UTC_TIME "UTC"
#define D_UV_LEVEL "Poziom UV"
#define D_VCC "VCC"
#define D_VERSION "Wersja"
#define D_VOLTAGE "Napiecie"
#define D_WARMLIGHT "Nagrzanie"
#define D_WEB "Web" // Web log
#define D_WEB_SERVER "Web Server"
#define D_WIFI "Wifi"
// sonoff.ino
#define D_WARNING_MINIMAL_VERSION "WARNING This version does not support persistent settings"
#define D_LEVEL_10 "poziom 1-0"
#define D_LEVEL_01 "poziom 0-1"
#define D_SERIAL_LOGGING_DISABLED "Wylaczony dziennik na porcie szeregowym"
@ -227,10 +184,7 @@
#define D_CHECKING_CONNECTION "Sprawdzanie polaczenia..."
#define D_QUERY_DONE "Wykonano zapytanie. Znaleziono uslugi MQTT"
#define D_MQTT_SERVICE_FOUND "Usluga MQTT została znaleziona"
#define D_I2CSCAN_DEVICES_FOUND_AT "Znaleziono urządzenie(a) na"
#define D_FOUND_AT "znalezione w"
#define D_I2CSCAN_UNKNOWN_ERROR_AT "Nieznany blad w"
#define D_I2CSCAN_NO_DEVICES_FOUND "Nie znaleziono urzadzen"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog Host nie znaleziony"
// settings.ino
@ -299,7 +253,9 @@
#define D_FULL_TOPIC "Pelen temat"
#define D_LOGGING_PARAMETERS "Opcje dziennika"
#define D_LOG_LEVEL "poziom dziennika"
#define D_SERIAL_LOG_LEVEL "Serial poziom dziennika"
#define D_WEB_LOG_LEVEL "Web poziom dziennika"
#define D_SYS_LOG_LEVEL "System poziom dziennika"
#define D_MORE_DEBUG "Wiecej informacji debugujacych"
#define D_SYSLOG_HOST "Syslog host"
#define D_SYSLOG_PORT "Syslog port"
@ -392,17 +348,6 @@
#define D_JSON_IRHVAC_TEMP "TEMP"
#define D_JSON_IRRECEIVED "IrReceived"
// xdrv_04_snfbridge.ino
#define D_RFRECEIVED "RfReceived"
#define D_START_LEARNING "Zacznij nauke"
#define D_SET_TO_DEFAULT "Ustaw domyslne"
#define D_DEFAULT_SENT "Domyslne wyslane"
#define D_LEARNED_SENT "Wyuczone wyslane"
#define D_LEARNING_ACTIVE "Wyuczone aktywne"
#define D_LEARN_FAILED "Uczenie niepowodzenie"
#define D_LEARNED "Wyuczone"
#define D_SAVED "Zapisane"
// xdrv_05_domoticz.ino
#define D_DOMOTICZ_PARAMETERS "Parametry Domoticz"
#define D_DOMOTICZ_IDX "Idx"
@ -420,12 +365,7 @@
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
#define D_DOMOTICZ_UPDATE_TIMER "Zaktualizuj czasomierz"
// xsns_03_energy.ino
#define D_MAXPOWERREACHED "MaksMocOsiagnieta"
#define D_MAXPOWERREACHEDRETRY "MaksMocOsiagnietaPonowienie"
#define D_POWERMONITOR "MonitorMocy"
#define D_ENERGYMONITOR "MonitorEnergii"
#define D_MAXENERGYREACHED "MaksEnergiaOsiagnieta"
// xdrv_03_energy.ino
#define D_ENERGY_TODAY "Energia Dzisiaj"
#define D_ENERGY_YESTERDAY "Energia Wczoraj"
#define D_ENERGY_TOTAL "Energia suma"
@ -446,6 +386,11 @@
#define D_SENSOR_DID_NOT_ACK_COMMAND "Czujnik nie otrzymal komendy ACK"
#define D_SHT1X_FOUND "SHT1X znaleziony"
// xsns_18_pms5003.ino
#define D_STANDARD_CONCENTRATION "Standard Concentration"
#define D_ENVIRONMENTAL_CONCENTRATION "Environmental Concentration"
#define D_PARTICALS_BEYOND "Particals beyond"
// sonoff_template.h
// Max string length is 8 characters including suffixes
#define D_SENSOR_NONE "Brak"
@ -473,6 +418,7 @@
#define D_SENSOR_SPI_CS "SPI CS"
#define D_SENSOR_SPI_DC "SPI DC"
#define D_SENSOR_BACKLIGHT "BkLight"
#define D_SENSOR_PMS5003 "PMS5003"
// Units
#define D_UNIT_AMPERE "A"
@ -480,11 +426,14 @@
#define D_UNIT_KILOOHM "kOhm"
#define D_UNIT_KILOWATTHOUR "kWh"
#define D_UNIT_LUX "lx"
#define D_UNIT_MICROGRAM_PER_CUBIC_METER "ug/m3"
#define D_UNIT_MICROMETER "um"
#define D_UNIT_MICROSECOND "us"
#define D_UNIT_MILLIAMPERE "mA"
#define D_UNIT_MILLISECOND "ms"
#define D_UNIT_MINUTE "Min"
#define D_UNIT_PPM "ppm"
#define D_UNIT_PARTS_PER_DECILITER "ppd"
#define D_UNIT_PARTS_PER_MILLION "ppm"
#define D_UNIT_PRESSURE "hPa"
#define D_UNIT_SECOND "sec"
#define D_UNIT_SECTORS "sektory"

469
sonoff/language/zh-CN.h Normal file
View File

@ -0,0 +1,469 @@
/*
zh-CN.h - localization for Chinese (Simplified) - China for Sonoff-Tasmota
Copyright (C) 2018 Theo Arends (translated by killadm)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LANGUAGE_ZH_CN_H_
#define _LANGUAGE_ZH_CN_H_
/*************************** ATTENTION *******************************\
*
* Due to memory constraints only UTF-8 is supported.
* To save code space keep text as short as possible.
* Time and Date provided by SDK can not be localized (yet).
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
* Use online command Prefix to translate cmnd, stat and tele.
*
\*********************************************************************/
// "2017-03-07T11:08:02" - ISO8601:2004
#define D_YEAR_MONTH_SEPARATOR "-"
#define D_MONTH_DAY_SEPARATOR "-"
#define D_DATE_TIME_SEPARATOR "T"
#define D_HOUR_MINUTE_SEPARATOR ":"
#define D_MINUTE_SECOND_SEPARATOR ":"
#define D_DAY3LIST "SunMonTueWedThuFriSat"
#define D_MONTH3LIST "JanFebMarAprMayJunJulAugSepOctNovDec"
// Non JSON decimal separator
#define D_DECIMAL_SEPARATOR "."
// Common
#define D_ADMIN "Admin"
#define D_AIR_QUALITY "空气质量"
#define D_AP "AP" // Access Point
#define D_AS "名称:"
#define D_AUTO "自动"
#define D_BLINK "闪烁"
#define D_BLINKOFF "闪烁关"
#define D_BOOT_COUNT "启动次数"
#define D_BRIGHTLIGHT "亮度"
#define D_BUTTON "按钮"
#define D_BY "by" // Written by me
#define D_BYTES "大小:"
#define D_CELSIUS "摄氏"
#define D_CO2 "二氧化碳"
#define D_CODE "代码" // Button code
#define D_COLDLIGHT "冷"
#define D_COMMAND "命令:"
#define D_CONNECTED "已连接"
#define D_COUNT "数量:"
#define D_COUNTER "Counter"
#define D_CURRENT "电流" // As in Voltage and Current
#define D_DATA "数据:"
#define D_DARKLIGHT "Dark"
#define D_DEBUG "调试"
#define D_DISABLED "禁用"
#define D_DNS_SERVER "DNS服务器"
#define D_DONE "完成"
#define D_DST_TIME "DST"
#define D_EMULATION "设备模拟"
#define D_ENABLED "启用"
#define D_ERASE "擦除"
#define D_ERROR "错误"
#define D_FAHRENHEIT "华氏"
#define D_FAILED "失败"
#define D_FALLBACK "Fallback"
#define D_FALLBACK_TOPIC "Fallback Topic"
#define D_FALSE "False"
#define D_FILE "文件:"
#define D_FREE_MEMORY "空闲内存"
#define D_GAS "气体"
#define D_GATEWAY "网关"
#define D_GROUP "组:"
#define D_HOST "主机"
#define D_HOSTNAME "主机名"
#define D_HUMIDITY "湿度"
#define D_ILLUMINANCE "照度"
#define D_IMMEDIATE "immediate" // Button immediate
#define D_INDEX "索引:"
#define D_INFO "信息"
#define D_INITIALIZED "初始化完成"
#define D_IP_ADDRESS "IP地址"
#define D_LIGHT "灯"
#define D_LWT "LWT"
#define D_MODULE "模块"
#define D_MQTT "MQTT"
#define D_MULTI_PRESS "多次按键"
#define D_NOISE "嘈杂"
#define D_NONE "无"
#define D_OFF "关"
#define D_OFFLINE "离线"
#define D_OK "好"
#define D_ON "开"
#define D_ONLINE "在线"
#define D_PASSWORD "密码"
#define D_PORT "端口"
#define D_POWER_FACTOR "功率因数"
#define D_POWERUSAGE "功率"
#define D_PRESSURE "气压"
#define D_PRESSUREATSEALEVEL "海平面气压"
#define D_PROGRAM_FLASH_SIZE "固件 Flash 大小"
#define D_PROGRAM_SIZE "固件大小"
#define D_PROJECT "项目:"
#define D_RECEIVED "已接收"
#define D_RESTART "重启"
#define D_RESTARTING "正在重启"
#define D_RESTART_REASON "重启原因"
#define D_RESTORE "恢复"
#define D_RETAINED "已保留"
#define D_SAVE "保存"
#define D_SENSOR "传感器"
#define D_SSID "名称"
#define D_START "开始"
#define D_STD_TIME "STD"
#define D_STOP "停止"
#define D_SUBNET_MASK "子网掩码"
#define D_SUBSCRIBE_TO "订阅"
#define D_SUCCESSFUL "成功"
#define D_TEMPERATURE "温度"
#define D_TO "to"
#define D_TOGGLE "切换"
#define D_TOPIC "主题"
#define D_TRANSMIT "发送"
#define D_TRUE "True"
#define D_UPGRADE "升级"
#define D_UPLOAD "上传"
#define D_UPTIME "运行时间"
#define D_USER "用户名"
#define D_UTC_TIME "UTC"
#define D_UV_LEVEL "紫外线水平"
#define D_VERSION "版本"
#define D_VOLTAGE "电压"
#define D_WARMLIGHT "暖"
#define D_WEB_SERVER "Web Server"
// sonoff.ino
#define D_WARNING_MINIMAL_VERSION "警告:精简固件不支持配置持久化保存"
#define D_LEVEL_10 "level 1-0"
#define D_LEVEL_01 "level 0-1"
#define D_SERIAL_LOGGING_DISABLED "串口日志已禁用"
#define D_SYSLOG_LOGGING_REENABLED "Syslog 日志已开启"
#define D_SET_BAUDRATE_TO "设置波特率为:"
#define D_RECEIVED_TOPIC "接收到的主题:"
#define D_DATA_SIZE "数据大小:"
#define D_ANALOG_INPUT "Analog"
#define D_FINGERPRINT "验证 TLS 指纹..."
#define D_TLS_CONNECT_FAILED_TO "TLS 连接失败"
#define D_RETRY_IN "重试倒计时:"
#define D_VERIFIED "验证成功"
#define D_INSECURE "指纹无效导致连接不安全"
#define D_CONNECT_FAILED_TO "连接失败:"
// support.ino
#define D_OSWATCH "osWatch"
#define D_BLOCKED_LOOP "Blocked Loop"
#define D_WPS_FAILED_WITH_STATUS "WPSconfig FAILED with status"
#define D_ACTIVE_FOR_3_MINUTES "active for 3 minutes"
#define D_FAILED_TO_START "未能启动"
#define D_PATCH_ISSUE_2186 "Patch issue 2186"
#define D_CONNECTING_TO_AP "连接到 AP"
#define D_IN_MODE "模式:"
#define D_CONNECT_FAILED_NO_IP_ADDRESS "连接失败因为没有获取到IP地址"
#define D_CONNECT_FAILED_AP_NOT_REACHED "连接失败无法连接AP"
#define D_CONNECT_FAILED_WRONG_PASSWORD "连接失败AP密码不正确"
#define D_CONNECT_FAILED_AP_TIMEOUT "连接失败AP超时"
#define D_ATTEMPTING_CONNECTION "尝试连接..."
#define D_CHECKING_CONNECTION "检查连接..."
#define D_QUERY_DONE "查询完成。 发现MQTT服务"
#define D_MQTT_SERVICE_FOUND "发现MQTT服务:"
#define D_FOUND_AT "found at"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog主机未找到"
// settings.ino
#define D_SAVED_TO_FLASH_AT "保存到 flash:"
#define D_LOADED_FROM_FLASH_AT "从 flash 载入"
#define D_USE_DEFAULTS "使用默认设置"
#define D_ERASED_SECTOR "擦除删除"
// webserver.ino
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "固件版本过低 - 请升级"
#define D_WEBSERVER_ACTIVE_ON "Web服务器:"
#define D_WITH_IP_ADDRESS "IP地址:"
#define D_WEBSERVER_STOPPED "Web 服务器已停止"
#define D_FILE_NOT_FOUND "文件未找到"
#define D_REDIRECTED "重定向到认证页面"
#define D_WIFIMANAGER_SET_ACCESSPOINT_AND_STATION "Wifimanager set AccessPoint and keep Station"
#define D_WIFIMANAGER_SET_ACCESSPOINT "Wifimanager 设置接入点"
#define D_TRYING_TO_CONNECT "尝试将设备连接到网络"
#define D_RESTART_IN "重启需要"
#define D_SECONDS "秒"
#define D_DEVICE_WILL_RESTART "设备将在几分钟内重启"
#define D_BUTTON_TOGGLE "状态切换"
#define D_CONFIGURATION "设置"
#define D_INFORMATION "信息"
#define D_FIRMWARE_UPGRADE "固件升级"
#define D_CONSOLE "控制台"
#define D_CONFIRM_RESTART "确认重启"
#define D_CONFIGURE_MODULE "模块设置"
#define D_CONFIGURE_WIFI "WiFi设置"
#define D_CONFIGURE_MQTT "MQTT设置"
#define D_CONFIGURE_DOMOTICZ "Domoticz设置"
#define D_CONFIGURE_LOGGING "日志设置"
#define D_CONFIGURE_OTHER "其他设置"
#define D_CONFIRM_RESET_CONFIGURATION "确认重置配置"
#define D_RESET_CONFIGURATION "重置配置"
#define D_BACKUP_CONFIGURATION "备份配置"
#define D_RESTORE_CONFIGURATION "还原配置"
#define D_MAIN_MENU "主菜单"
#define D_MODULE_PARAMETERS "模块设置"
#define D_MODULE_TYPE "模块类型"
#define D_GPIO "GPIO"
#define D_SERIAL_IN "串口输入(RX)"
#define D_SERIAL_OUT "串口输出(TX)"
#define D_WIFI_PARAMETERS "Wifi设置"
#define D_SCAN_FOR_WIFI_NETWORKS "扫描无线网络"
#define D_SCAN_DONE "扫描完毕"
#define D_NO_NETWORKS_FOUND "未找到任何网络"
#define D_REFRESH_TO_SCAN_AGAIN "刷新并重试"
#define D_DUPLICATE_ACCESSPOINT "重复AP"
#define D_SKIPPING_LOW_QUALITY "忽略弱信号网络"
#define D_RSSI "RSSI"
#define D_WEP "WEP"
#define D_WPA_PSK "WPA PSK"
#define D_WPA2_PSK "WPA2 PSK"
#define D_AP1_SSID "AP1 名称"
#define D_AP1_PASSWORD "AP1 密码"
#define D_AP2_SSID "AP2 名称"
#define D_AP2_PASSWORD "AP2 密码"
#define D_MQTT_PARAMETERS "MQTT设置"
#define D_CLIENT "客户端"
#define D_FULL_TOPIC "完整主题"
#define D_LOGGING_PARAMETERS "日志设置"
#define D_SERIAL_LOG_LEVEL "串口日志级别"
#define D_WEB_LOG_LEVEL "Web 日志级别"
#define D_SYS_LOG_LEVEL "Syslog 日志级别"
#define D_MORE_DEBUG "全部调试"
#define D_SYSLOG_HOST "Syslog 主机地址"
#define D_SYSLOG_PORT "Syslog 端口"
#define D_TELEMETRY_PERIOD "上报周期"
#define D_OTHER_PARAMETERS "其他设置"
#define D_WEB_ADMIN_PASSWORD "WEB管理密码"
#define D_MQTT_ENABLE "启用MQTT"
#define D_FRIENDLY_NAME "昵称"
#define D_BELKIN_WEMO "贝尔金 WeMo"
#define D_HUE_BRIDGE "飞利浦 Hue 网桥"
#define D_SINGLE_DEVICE "单设备"
#define D_MULTI_DEVICE "多设备"
#define D_SAVE_CONFIGURATION "保存设置"
#define D_CONFIGURATION_SAVED "设置已保存"
#define D_CONFIGURATION_RESET "设置已重置"
#define D_PROGRAM_VERSION "固件版本"
#define D_BUILD_DATE_AND_TIME "编译时间"
#define D_CORE_AND_SDK_VERSION "内核版本"
#define D_FLASH_WRITE_COUNT "刷机次数"
#define D_MAC_ADDRESS "MAC地址"
#define D_MQTT_HOST "MQTT主机"
#define D_MQTT_PORT "MQTT端口"
#define D_MQTT_CLIENT "MQTT客户端"
#define D_MQTT_USER "MQTT用户名"
#define D_MQTT_TOPIC "MQTT 主题(Topic)"
#define D_MQTT_GROUP_TOPIC "MQTT 主题组(Group Topic)"
#define D_MQTT_FULL_TOPIC "MQTT 完整主题(Full Topic)"
#define D_MDNS_DISCOVERY "mDNS 发现"
#define D_MDNS_ADVERTISE "mDNS 广播"
#define D_ESP_CHIP_ID "ESP芯片ID"
#define D_FLASH_CHIP_ID "Flash芯片ID"
#define D_FLASH_CHIP_SIZE "Flash大小"
#define D_FREE_PROGRAM_SPACE "空闲程序空间"
#define D_UPGRADE_BY_WEBSERVER "通过Web升级"
#define D_OTA_URL "OTA地址"
#define D_START_UPGRADE "开始升级"
#define D_UPGRADE_BY_FILE_UPLOAD "通过文件升级"
#define D_UPLOAD_STARTED "开始上传"
#define D_UPGRADE_STARTED "开始升级"
#define D_UPLOAD_DONE "上传完成"
#define D_UPLOAD_ERR_1 "没有选择文件"
#define D_UPLOAD_ERR_2 "没有足够空间"
#define D_UPLOAD_ERR_3 "固件头不是 0xE9"
#define D_UPLOAD_ERR_4 "固件太大"
#define D_UPLOAD_ERR_5 "上传缓冲区不匹配"
#define D_UPLOAD_ERR_6 "上传失败。 启用日志记录 3"
#define D_UPLOAD_ERR_7 "上传取消"
#define D_UPLOAD_ERR_8 "错误的固件"
#define D_UPLOAD_ERR_9 "固件太大"
#define D_UPLOAD_ERROR_CODE "上传错误代码"
#define D_ENTER_COMMAND "输入命令"
#define D_ENABLE_WEBLOG_FOR_RESPONSE "如果预期响应则启用Weblog 2"
#define D_NEED_USER_AND_PASSWORD "需要 user=<用户名>&password=<密码>"
// xdrv_wemohue.ino
#define D_MULTICAST_DISABLED "组播已禁用"
#define D_MULTICAST_REJOINED "组播已(重新)加入"
#define D_MULTICAST_JOIN_FAILED "组播加入失败"
#define D_FAILED_TO_SEND_RESPONSE "请求发送失败"
#define D_WEMO "WeMo"
#define D_WEMO_BASIC_EVENT "WeMo 基础事件"
#define D_WEMO_EVENT_SERVICE "WeMo 事件服务"
#define D_WEMO_META_SERVICE "WeMo meta 服务"
#define D_WEMO_SETUP "WeMo 设置"
#define D_RESPONSE_SENT "发送请求"
#define D_HUE "Hue"
#define D_HUE_BRIDGE_SETUP "Hue 设置"
#define D_HUE_API_NOT_IMPLEMENTED "Hue API 未实现"
#define D_HUE_API "Hue API"
#define D_HUE_POST_ARGS "Hue POST 参数"
#define D_3_RESPONSE_PACKETS_SENT "3 请求包发送"
// xdrv_02_irremote.ino
#define D_JSON_INVALID_JSON "无效的JSON"
#define D_JSON_PROTOCOL_NOT_SUPPORTED "协议不支持"
#define D_JSON_IR_PROTOCOL "协议"
#define D_JSON_IR_BITS "BITS"
#define D_JSON_IR_DATA "数据"
#define D_JSON_IRHVAC_VENDOR "供应商"
#define D_JSON_IRHVAC_POWER "电源"
#define D_JSON_IRHVAC_MODE "模式"
#define D_JSON_IRHVAC_FANSPEED "风扇转速"
#define D_JSON_IRHVAC_TEMP "温度"
#define D_JSON_IRRECEIVED "IrReceived"
// xdrv_05_domoticz.ino
#define D_DOMOTICZ_PARAMETERS "Domoticz 设置"
#define D_DOMOTICZ_IDX "Idx"
#define D_DOMOTICZ_KEY_IDX "Key idx"
#define D_DOMOTICZ_SWITCH_IDX "开关 idx"
#define D_DOMOTICZ_SENSOR_IDX "传感器 idx"
#define D_DOMOTICZ_TEMP "温度"
#define D_DOMOTICZ_TEMP_HUM "温度,湿度"
#define D_DOMOTICZ_TEMP_HUM_BARO "温度,湿度,气压"
#define D_DOMOTICZ_POWER_ENERGY "功率,电量"
#define D_DOMOTICZ_ILLUMINANCE "照度"
#define D_DOMOTICZ_COUNT "数值"
#define D_DOMOTICZ_VOLTAGE "电压"
#define D_DOMOTICZ_CURRENT "电流"
#define D_DOMOTICZ_AIRQUALITY "空气质量"
#define D_DOMOTICZ_UPDATE_TIMER "更新计时器"
// xdrv_03_energy.ino
#define D_ENERGY_TODAY "今日用电量"
#define D_ENERGY_YESTERDAY "昨日用电量"
#define D_ENERGY_TOTAL "总用电量"
// xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "传感器正忙"
#define D_SENSOR_CRC_ERROR "传感器 CRC 校验错误"
#define D_SENSORS_FOUND "发现传感器"
// xsns_06_dht.ino
#define D_TIMEOUT_WAITING_FOR "等待超时"
#define D_START_SIGNAL_LOW "开始低电平"
#define D_START_SIGNAL_HIGH "开始高电平"
#define D_PULSE "pulse"
#define D_CHECKSUM_FAILURE "校验失败"
// xsns_07_sht1x.ino
#define D_SENSOR_DID_NOT_ACK_COMMAND "传感器没有确认命令"
#define D_SHT1X_FOUND "发现 SHT1X 传感器"
// xsns_18_pms5003.ino
#define D_STANDARD_CONCENTRATION "标准颗粒物浓度"
#define D_ENVIRONMENTAL_CONCENTRATION "大气环境下浓度"
#define D_PARTICALS_BEYOND "颗粒物直径大于"
// sonoff_template.h
// Max string length is 8 characters including suffixes
#define D_SENSOR_NONE "None"
#define D_SENSOR_DHT11 "DHT11"
#define D_SENSOR_AM2301 "AM2301"
#define D_SENSOR_SI7021 "SI7021"
#define D_SENSOR_DS18X20 "DS18x20"
#define D_SENSOR_I2C_SCL "I2C SCL"
#define D_SENSOR_I2C_SDA "I2C SDA"
#define D_SENSOR_WS2812 "WS2812"
#define D_SENSOR_IRSEND "IRsend"
#define D_SENSOR_SWITCH "Switch" // Suffix "1"
#define D_SENSOR_BUTTON "Button" // Suffix "1"
#define D_SENSOR_RELAY "Relay" // Suffix "1i"
#define D_SENSOR_LED "Led" // Suffix "1i"
#define D_SENSOR_PWM "PWM" // Suffix "1"
#define D_SENSOR_COUNTER "Counter" // Suffix "1"
#define D_SENSOR_IRRECV "IRrecv"
#define D_SENSOR_MHZ_RX "MHZ Rx"
#define D_SENSOR_MHZ_TX "MHZ Tx"
#define D_SENSOR_PZEM_RX "PZEM Rx"
#define D_SENSOR_PZEM_TX "PZEM Tx"
#define D_SENSOR_SAIR_RX "SAir Rx"
#define D_SENSOR_SAIR_TX "SAir Tx"
#define D_SENSOR_SPI_CS "SPI CS"
#define D_SENSOR_SPI_DC "SPI DC"
#define D_SENSOR_BACKLIGHT "BkLight"
#define D_SENSOR_PMS5003 "PMS5003"
// Units
#define D_UNIT_AMPERE "安"
#define D_UNIT_HOUR "时"
#define D_UNIT_KILOOHM "千欧"
#define D_UNIT_KILOWATTHOUR "千瓦时"
#define D_UNIT_LUX "勒克斯"
#define D_UNIT_MICROGRAM_PER_CUBIC_METER "微克/立方米"
#define D_UNIT_MICROMETER "微米"
#define D_UNIT_MICROSECOND "微秒"
#define D_UNIT_MILLIAMPERE "毫安"
#define D_UNIT_MILLISECOND "毫秒"
#define D_UNIT_MINUTE "分"
#define D_UNIT_PARTS_PER_DECILITER "每分升"
#define D_UNIT_PARTS_PER_MILLION "ppm"
#define D_UNIT_PRESSURE "百帕"
#define D_UNIT_SECOND "秒"
#define D_UNIT_SECTORS "扇区"
#define D_UNIT_VOLT "伏"
#define D_UNIT_WATT "瓦"
#define D_UNIT_WATTHOUR "瓦时"
// Log message prefix
#define D_LOG_APPLICATION "APP: " // Application
#define D_LOG_BRIDGE "BRG: " // Bridge
#define D_LOG_CONFIG "CFG: " // Settings
#define D_LOG_COMMAND "CMD: " // Command
#define D_LOG_DEBUG "DBG: " // Debug
#define D_LOG_DHT "DHT: " // DHT sensor
#define D_LOG_DOMOTICZ "DOM: " // Domoticz
#define D_LOG_DSB "DSB: " // DS18xB20 sensor
#define D_LOG_HTTP "HTP: " // HTTP webserver
#define D_LOG_I2C "I2C: " // I2C
#define D_LOG_IRR "IRR: " // Infra Red Received
#define D_LOG_LOG "LOG: " // Logging
#define D_LOG_MODULE "MOD: " // Module
#define D_LOG_MDNS "DNS: " // mDNS
#define D_LOG_MQTT "MQT: " // MQTT
#define D_LOG_OTHER "OTH: " // Other
#define D_LOG_RESULT "RSL: " // Result
#define D_LOG_RFR "RFR: " // RF Received
#define D_LOG_SERIAL "SER: " // Serial
#define D_LOG_SHT1 "SHT: " // SHT1x sensor
#define D_LOG_UPLOAD "UPL: " // Upload
#define D_LOG_UPNP "UPP: " // UPnP
#define D_LOG_WIFI "WIF: " // Wifi
#endif // _LANGUAGE_ZH_CN_H_

View File

@ -44,7 +44,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu
uint32_t ws_clock_reverse : 1; // bit 16 (v5.8.1)
uint32_t decimal_text : 1; // bit 17 (v5.8.1)
uint32_t light_signal : 1; // bit 18 (v5.10.0c)
uint32_t spare19 : 1;
uint32_t hass_discovery : 1; // bit 19 (v5.11.1a)
uint32_t voltage_resolution : 1; // Replaced by below
uint32_t spare21 : 1;
uint32_t spare22 : 1;
@ -262,7 +262,7 @@ struct SYSCFG {
struct RTCMEM {
uint16_t valid; // 000
byte oswatch_blocked_loop; // 002
uint8_t unused; // 003
uint8_t ota_loader; // 003
unsigned long energy_kWhtoday; // 004
unsigned long energy_kWhtotal; // 008
unsigned long pulse_counter[MAX_COUNTERS]; // 00C

View File

@ -25,6 +25,31 @@
#define EMULATION EMUL_NONE // [Emulation] Select Belkin WeMo (single relay/light) or Hue Bridge emulation (multi relay/light) (EMUL_NONE, EMUL_WEMO or EMUL_HUE)
#endif
#ifndef MTX_ADDRESS1 // Add Display Support for up to eigth Matrices
#define MTX_ADDRESS1 0
#endif
#ifndef MTX_ADDRESS2
#define MTX_ADDRESS2 0
#endif
#ifndef MTX_ADDRESS3
#define MTX_ADDRESS3 0
#endif
#ifndef MTX_ADDRESS4
#define MTX_ADDRESS4 0
#endif
#ifndef MTX_ADDRESS5
#define MTX_ADDRESS5 0
#endif
#ifndef MTX_ADDRESS6
#define MTX_ADDRESS6 0
#endif
#ifndef MTX_ADDRESS7
#define MTX_ADDRESS7 0
#endif
#ifndef MTX_ADDRESS8
#define MTX_ADDRESS8 0
#endif
/*********************************************************************************************\
* RTC memory
\*********************************************************************************************/

View File

@ -80,7 +80,7 @@ typedef unsigned long power_t; // Power (Relay) type
#define STATES 20 // State loops per second
#define SYSLOG_TIMER 600 // Seconds to restore syslog_level
#define SERIALLOG_TIMER 600 // Seconds to disable SerialLog
#define OTA_ATTEMPTS 10 // Number of times to try fetching the new firmware
#define OTA_ATTEMPTS 5 // Number of times to try fetching the new firmware
#define INPUT_BUFFER_SIZE 250 // Max number of characters in (serial) command buffer
#define CMDSZ 24 // Max number of characters in command
@ -137,7 +137,7 @@ enum LichtSubtypes {LST_NONE, LST_SINGLE, LST_COLDWARM, LST_RGB, LST_RGBW, LST_R
enum LichtSchemes {LS_POWER, LS_WAKEUP, LS_CYCLEUP, LS_CYCLEDN, LS_RANDOM, LS_MAX};
enum XsnsFunctions {FUNC_INIT, FUNC_EVERY_50_MSECOND, FUNC_EVERY_SECOND, FUNC_PREP_BEFORE_TELEPERIOD, FUNC_JSON_APPEND, FUNC_WEB_APPEND, FUNC_SAVE_BEFORE_RESTART,
FUNC_COMMAND, FUNC_MQTT_SUBSCRIBE, FUNC_MQTT_DATA, FUNC_SET_POWER, FUNC_SHOW_SENSOR};
FUNC_COMMAND, FUNC_MQTT_SUBSCRIBE, FUNC_MQTT_CONNECTED, FUNC_MQTT_DATA, FUNC_SET_POWER, FUNC_SHOW_SENSOR};
const uint8_t kDefaultRfCode[9] PROGMEM = { 0x21, 0x16, 0x01, 0x0E, 0x03, 0x48, 0x2E, 0x1A, 0x00 };

View File

@ -25,8 +25,7 @@
- Select IDE Tools - Flash Size: "1M (no SPIFFS)"
====================================================*/
#define VERSION 0x050A0009
#define VERSION_STRING "5.10.0i" // Would be great to have a macro that fills this from VERSION ...
#define VERSION 0x050B0102 // 5.11.1b
// Location specific includes
#include "sonoff.h" // Enumaration used in user_config.h
@ -120,6 +119,7 @@ int mqtt_connection_flag = 2; // MQTT connection messages flag
int ota_state_flag = 0; // OTA state flag
int ota_result = 0; // OTA result
byte ota_retry_counter = OTA_ATTEMPTS; // OTA retry counter
char *ota_url; // OTA url string
int restart_flag = 0; // Sonoff restart flag
int wifi_state_flag = WIFI_RESTART; // Wifi state flag
int uptime = 0; // Current uptime in hours
@ -188,6 +188,7 @@ uint8_t xdrv_present = 0; // Number of drivers found
boolean (*xdrv_func_ptr[XDRV_MAX])(byte); // Driver Function Pointers
uint8_t xsns_present = 0; // Number of External Sensors found
boolean (*xsns_func_ptr[XSNS_MAX])(byte); // External Sensor Function Pointers for simple implementation of sensors
char my_version[33]; // Composed version string
char my_hostname[33]; // Composed Wifi hostname
char mqtt_client[33]; // Composed MQTT Clientname
char serial_in_buffer[INPUT_BUFFER_SIZE + 2]; // Receive buffer
@ -394,7 +395,7 @@ void MqttPublishPrefixTopic_P(uint8_t prefix, const char* subtopic, boolean reta
* prefix 5 = stat using subtopic or RESULT
* prefix 6 = tele using subtopic or RESULT
*/
char romram[16];
char romram[33];
char stopic[TOPSZ];
snprintf_P(romram, sizeof(romram), ((prefix > 3) && !Settings.flag.mqtt_response) ? S_RSLT_RESULT : subtopic);
@ -414,7 +415,7 @@ void MqttPublishPrefixTopic_P(uint8_t prefix, const char* subtopic)
void MqttPublishPowerState(byte device)
{
char stopic[TOPSZ];
char scommand[16];
char scommand[33];
if ((device < 1) || (device > devices_present)) {
device = 1;
@ -431,12 +432,12 @@ void MqttPublishPowerState(byte device)
void MqttPublishPowerBlinkState(byte device)
{
char scommand[16];
char scommand[33];
if ((device < 1) || (device > devices_present)) {
device = 1;
}
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"%s\":\"" D_BLINK " %s\"}"),
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"%s\":\"" D_JSON_BLINK " %s\"}"),
GetPowerDevice(scommand, device, sizeof(scommand)), GetStateText(bitRead(blink_mask, device -1)));
MqttPublishPrefixTopic_P(5, S_RSLT_POWER);
@ -467,17 +468,17 @@ void MqttConnected()
}
if (mqtt_connection_flag) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_MODULE "\":\"%s\",\"" D_VERSION "\":\"" VERSION_STRING "\",\"" D_FALLBACKTOPIC "\":\"%s\",\"" D_CMND_GROUPTOPIC "\":\"%s\"}"),
my_module.name, mqtt_client, Settings.mqtt_grptopic);
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_MODULE "\":\"%s\",\"" D_JSON_VERSION "\":\"%s\",\"" D_JSON_FALLBACKTOPIC "\":\"%s\",\"" D_CMND_GROUPTOPIC "\":\"%s\"}"),
my_module.name, my_version, mqtt_client, Settings.mqtt_grptopic);
MqttPublishPrefixTopic_P(2, PSTR(D_RSLT_INFO "1"));
#ifdef USE_WEBSERVER
if (Settings.webserver) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_WEBSERVER_MODE "\":\"%s\",\"" D_CMND_HOSTNAME "\":\"%s\",\"" D_CMND_IPADDRESS "\":\"%s\"}"),
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_WEBSERVER_MODE "\":\"%s\",\"" D_CMND_HOSTNAME "\":\"%s\",\"" D_CMND_IPADDRESS "\":\"%s\"}"),
(2 == Settings.webserver) ? D_ADMIN : D_USER, my_hostname, WiFi.localIP().toString().c_str());
MqttPublishPrefixTopic_P(2, PSTR(D_RSLT_INFO "2"));
}
#endif // USE_WEBSERVER
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_RESTARTREASON "\":\"%s\"}"),
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_RESTARTREASON "\":\"%s\"}"),
(GetResetReason() == "Exception") ? ESP.getResetInfo().c_str() : GetResetReason().c_str());
MqttPublishPrefixTopic_P(2, PSTR(D_RSLT_INFO "3"));
if (Settings.tele_period) {
@ -531,7 +532,6 @@ void MqttReconnect()
#ifndef USE_MQTT_TLS
#ifdef USE_DISCOVERY
#ifdef MQTT_HOST_DISCOVERY
// if (!strlen(MQTT_HOST)) {
if (!strlen(Settings.mqtt_host)) {
MdnsDiscoverMqttServer();
}
@ -838,7 +838,7 @@ void MqttDataCallback(char* topic, byte* data, unsigned int data_len)
AddLog(LOG_LEVEL_DEBUG);
if (type != NULL) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_COMMAND "\":\"" D_ERROR "\"}"));
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_COMMAND "\":\"" D_JSON_ERROR "\"}"));
if (Settings.ledstate &0x02) {
blinks++;
}
@ -889,11 +889,11 @@ void MqttDataCallback(char* topic, byte* data, unsigned int data_len)
backlog_index &= 0xF;
blcommand = strtok(NULL, ";");
}
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, D_APPENDED);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, D_JSON_APPENDED);
} else {
uint8_t blflag = (backlog_pointer == backlog_index);
backlog_pointer = backlog_index;
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, blflag ? D_EMPTY : D_ABORTED);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, blflag ? D_JSON_EMPTY : D_JSON_ABORTED);
}
}
else if (CMND_DELAY == command_code) {
@ -920,12 +920,13 @@ void MqttDataCallback(char* topic, byte* data, unsigned int data_len)
}
else if ((CMND_POWERONSTATE == command_code) && (Settings.module != MOTOR)) {
/* 0 = Keep relays off after power on
* 1 = Turn relays on after power on
* 1 = Turn relays on after power on, if PulseTime set wait for PulseTime seconds, and turn relays off
* 2 = Toggle relays after power on
* 3 = Set relays to last saved state after power on
* 4 = Turn relays on and disable any relay control (used for Sonoff Pow to always measure power)
* 5 = Keep relays off after power on, if PulseTime set wait for PulseTime seconds, and turn relays on
*/
if ((payload >= 0) && (payload <= 4)) {
if ((payload >= 0) && (payload <= 5)) {
Settings.poweronstate = payload;
if (4 == Settings.poweronstate) {
for (byte i = 1; i <= devices_present; i++) {
@ -960,9 +961,6 @@ void MqttDataCallback(char* topic, byte* data, unsigned int data_len)
}
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_NVALUE, command, Settings.blinkcount);
}
// else if (light_type && LightCommand(type, index, dataBuf, data_len, payload)) {
// Serviced
// }
else if (CMND_SAVEDATA == command_code) {
if ((payload >= 0) && (payload <= 3600)) {
Settings.save_data = payload;
@ -970,11 +968,11 @@ void MqttDataCallback(char* topic, byte* data, unsigned int data_len)
}
SettingsSaveAll();
if (Settings.save_data > 1) {
snprintf_P(stemp1, sizeof(stemp1), PSTR(D_EVERY " %d " D_UNIT_SECOND), Settings.save_data);
snprintf_P(stemp1, sizeof(stemp1), PSTR(D_JSON_EVERY " %d " D_UNIT_SECOND), Settings.save_data);
}
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, (Settings.save_data > 1) ? stemp1 : GetStateText(Settings.save_data));
}
else if ((CMND_SETOPTION == command_code) && ((index >= 0) && (index <= 18)) || ((index > 31) && (index <= P_MAX_PARAM8 +31))) {
else if ((CMND_SETOPTION == command_code) && ((index >= 0) && (index <= 19)) || ((index > 31) && (index <= P_MAX_PARAM8 +31))) {
if (index <= 31) {
ptype = 0; // SetOption0 .. 31
} else {
@ -987,6 +985,7 @@ void MqttDataCallback(char* topic, byte* data, unsigned int data_len)
switch (index) {
case 3: // mqtt
case 15: // pwm_control
case 19: // hass_discovery
restart_flag = 2;
case 0: // save_state
case 1: // button_restrict
@ -1132,7 +1131,7 @@ void MqttDataCallback(char* topic, byte* data, unsigned int data_len)
if (jsflg) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s}"), mqtt_data);
} else {
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, D_NOT_SUPPORTED);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, D_JSON_NOT_SUPPORTED);
}
}
else if (CMND_GPIOS == command_code) {
@ -1226,9 +1225,9 @@ void MqttDataCallback(char* topic, byte* data, unsigned int data_len)
// We also need at least 3 chars to make a valid version number string.
if (((1 == data_len) && (1 == payload)) || ((data_len >= 3) && NewerVersion(dataBuf))) {
ota_state_flag = 3;
snprintf_P(mqtt_data, sizeof(mqtt_data), "{\"%s\":\"" D_VERSION " " VERSION_STRING " " D_FROM " %s\"}", command, Settings.ota_url);
snprintf_P(mqtt_data, sizeof(mqtt_data), "{\"%s\":\"" D_JSON_VERSION " %s " D_JSON_FROM " %s\"}", command, my_version, Settings.ota_url);
} else {
snprintf_P(mqtt_data, sizeof(mqtt_data), "{\"%s\":\"" D_ONE_OR_GT "\"}", command, VERSION_STRING);
snprintf_P(mqtt_data, sizeof(mqtt_data), "{\"%s\":\"" D_JSON_ONE_OR_GT "\"}", command, my_version);
}
}
else if (CMND_OTAURL == command_code) {
@ -1329,7 +1328,7 @@ void MqttDataCallback(char* topic, byte* data, unsigned int data_len)
Settings.sta_config = payload;
wifi_state_flag = Settings.sta_config;
snprintf_P(stemp1, sizeof(stemp1), kWifiConfig[Settings.sta_config]);
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_WIFICONFIG "\":\"%s " D_SELECTED "\"}"), stemp1);
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_WIFICONFIG "\":\"%s " D_JSON_SELECTED "\"}"), stemp1);
if (WifiState() != WIFI_RESTART) {
// snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s after restart"), mqtt_data);
restart_flag = 2;
@ -1362,7 +1361,7 @@ void MqttDataCallback(char* topic, byte* data, unsigned int data_len)
Settings.webserver = payload;
}
if (Settings.webserver) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_WEBSERVER "\":\"" D_ACTIVE_FOR " %s " D_ON_DEVICE " %s " D_WITH_IP_ADDRESS " %s\"}"),
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_WEBSERVER "\":\"" D_JSON_ACTIVE_FOR " %s " D_JSON_ON_DEVICE " %s " D_JSON_WITH_IP_ADDRESS " %s\"}"),
(2 == Settings.webserver) ? D_ADMIN : D_USER, my_hostname, WiFi.localIP().toString().c_str());
} else {
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, GetStateText(0));
@ -1404,28 +1403,28 @@ void MqttDataCallback(char* topic, byte* data, unsigned int data_len)
switch (payload) {
case 1:
restart_flag = 2;
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, D_RESTARTING);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, D_JSON_RESTARTING);
break;
case 99:
AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_APPLICATION D_RESTARTING));
ESP.restart();
break;
default:
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, D_ONE_TO_RESTART);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, D_JSON_ONE_TO_RESTART);
}
}
else if (CMND_RESET == command_code) {
switch (payload) {
case 1:
restart_flag = 211;
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command , D_RESET_AND_RESTARTING);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command , D_JSON_RESET_AND_RESTARTING);
break;
case 2:
restart_flag = 212;
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_RESET "\":\"" D_ERASE ", " D_RESET_AND_RESTARTING "\"}"));
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_RESET "\":\"" D_JSON_ERASE ", " D_JSON_RESET_AND_RESTARTING "\"}"));
break;
default:
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, D_ONE_TO_RESET);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, D_JSON_ONE_TO_RESET);
}
}
else if (CMND_TIMEZONE == command_code) {
@ -1504,8 +1503,8 @@ void MqttDataCallback(char* topic, byte* data, unsigned int data_len)
}
if (type == NULL) {
blinks = 201;
snprintf_P(topicBuf, sizeof(topicBuf), PSTR(D_COMMAND));
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_COMMAND "\":\"" D_JSON_UNKNOWN "\"}"));
snprintf_P(topicBuf, sizeof(topicBuf), PSTR(D_JSON_COMMAND));
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_COMMAND "\":\"" D_JSON_UNKNOWN "\"}"));
type = (char*)topicBuf;
}
if (mqtt_data[0] != '\0') {
@ -1611,7 +1610,8 @@ void ExecuteCommandPower(byte device, byte state)
DomoticzUpdatePowerState(device);
#endif // USE_DOMOTICZ
if (device <= MAX_PULSETIMERS) {
pulse_timer[(device -1)] = (power & mask) ? Settings.pulse_timer[(device -1)] : 0;
// pulse_timer[(device -1)] = (power & mask) ? Settings.pulse_timer[(device -1)] : 0;
pulse_timer[(device -1)] = (((5 == Settings.poweronstate) ? ~power : power) & mask) ? Settings.pulse_timer[(device -1)] : 0;
}
}
else if (3 == state) { // Blink
@ -1691,20 +1691,20 @@ void PublishStatus(uint8_t payload)
}
if ((0 == payload) || (99 == payload)) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_STATUS "\":{\"" D_CMND_MODULE "\":%d,\"" D_CMND_FRIENDLYNAME "\":\"%s\",\"" D_CMND_TOPIC "\":\"%s\",\"" D_CMND_BUTTONTOPIC "\":\"%s\",\"" D_CMND_POWER "\":%d,\"" D_CMND_POWERONSTATE "\":%d,\"" D_CMND_LEDSTATE "\":%d,\"" D_CMND_SAVEDATA "\":%d,\"" D_SAVESTATE "\":%d,\"" D_CMND_BUTTONRETAIN "\":%d,\"" D_CMND_POWERRETAIN "\":%d}}"),
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_STATUS "\":{\"" D_CMND_MODULE "\":%d,\"" D_CMND_FRIENDLYNAME "\":\"%s\",\"" D_CMND_TOPIC "\":\"%s\",\"" D_CMND_BUTTONTOPIC "\":\"%s\",\"" D_CMND_POWER "\":%d,\"" D_CMND_POWERONSTATE "\":%d,\"" D_CMND_LEDSTATE "\":%d,\"" D_CMND_SAVEDATA "\":%d,\"" D_JSON_SAVESTATE "\":%d,\"" D_CMND_BUTTONRETAIN "\":%d,\"" D_CMND_POWERRETAIN "\":%d}}"),
Settings.module +1, Settings.friendlyname[0], Settings.mqtt_topic, Settings.button_topic, power, Settings.poweronstate, Settings.ledstate, Settings.save_data, Settings.flag.save_state, Settings.flag.mqtt_button_retain, Settings.flag.mqtt_power_retain);
MqttPublishPrefixTopic_P(option, PSTR(D_CMND_STATUS));
}
if ((0 == payload) || (1 == payload)) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_STATUS D_STATUS1_PARAMETER "\":{\"" D_BAUDRATE "\":%d,\"" D_CMND_GROUPTOPIC "\":\"%s\",\"" D_CMND_OTAURL "\":\"%s\",\"" D_UPTIME "\":%d,\"" D_CMND_SLEEP "\":%d,\"" D_BOOTCOUNT "\":%d,\"" D_SAVECOUNT "\":%d,\"" D_SAVEADDRESS "\":\"%X\"}}"),
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_STATUS D_STATUS1_PARAMETER "\":{\"" D_JSON_BAUDRATE "\":%d,\"" D_CMND_GROUPTOPIC "\":\"%s\",\"" D_CMND_OTAURL "\":\"%s\",\"" D_JSON_UPTIME "\":%d,\"" D_CMND_SLEEP "\":%d,\"" D_JSON_BOOTCOUNT "\":%d,\"" D_JSON_SAVECOUNT "\":%d,\"" D_JSON_SAVEADDRESS "\":\"%X\"}}"),
baudrate, Settings.mqtt_grptopic, Settings.ota_url, uptime, Settings.sleep, Settings.bootcount, Settings.save_flag, GetSettingsAddress());
MqttPublishPrefixTopic_P(option, PSTR(D_CMND_STATUS "1"));
}
if ((0 == payload) || (2 == payload)) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_STATUS D_STATUS2_FIRMWARE "\":{\"" D_VERSION "\":\"" VERSION_STRING "\",\"" D_BUILDDATETIME "\":\"%s\",\"" D_BOOTVERSION "\":%d,\"" D_COREVERSION "\":\"%s\",\"" D_SDKVERSION "\":\"%s\"}}"),
GetBuildDateAndTime().c_str(), ESP.getBootVersion(), ESP.getCoreVersion().c_str(), ESP.getSdkVersion());
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_STATUS D_STATUS2_FIRMWARE "\":{\"" D_JSON_VERSION "\":\"%s\",\"" D_JSON_BUILDDATETIME "\":\"%s\",\"" D_JSON_BOOTVERSION "\":%d,\"" D_JSON_COREVERSION "\":\"" ARDUINO_ESP8266_RELEASE "\",\"" D_JSON_SDKVERSION "\":\"%s\"}}"),
my_version, GetBuildDateAndTime().c_str(), ESP.getBootVersion(), ESP.getSdkVersion());
MqttPublishPrefixTopic_P(option, PSTR(D_CMND_STATUS "2"));
}
@ -1715,26 +1715,26 @@ void PublishStatus(uint8_t payload)
}
if ((0 == payload) || (4 == payload)) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_STATUS D_STATUS4_MEMORY "\":{\"" D_PROGRAMSIZE "\":%d,\"" D_FREEMEMORY "\":%d,\"" D_HEAPSIZE "\":%d,\"" D_PROGRAMFLASHSIZE "\":%d,\"" D_FLASHSIZE "\":%d,\"" D_FLASHMODE "\":%d}}"),
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_STATUS D_STATUS4_MEMORY "\":{\"" D_JSON_PROGRAMSIZE "\":%d,\"" D_JSON_FREEMEMORY "\":%d,\"" D_JSON_HEAPSIZE "\":%d,\"" D_JSON_PROGRAMFLASHSIZE "\":%d,\"" D_JSON_FLASHSIZE "\":%d,\"" D_JSON_FLASHMODE "\":%d}}"),
ESP.getSketchSize()/1024, ESP.getFreeSketchSpace()/1024, ESP.getFreeHeap()/1024, ESP.getFlashChipSize()/1024, ESP.getFlashChipRealSize()/1024, ESP.getFlashChipMode());
MqttPublishPrefixTopic_P(option, PSTR(D_CMND_STATUS "4"));
}
if ((0 == payload) || (5 == payload)) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_STATUS D_STATUS5_NETWORK "\":{\"" D_CMND_HOSTNAME "\":\"%s\",\"" D_CMND_IPADDRESS "\":\"%s\",\"" D_GATEWAY "\":\"%s\",\"" D_SUBNETMASK "\":\"%s\",\"" D_DNSSERVER "\":\"%s\",\"" D_MAC "\":\"%s\",\"" D_CMND_WEBSERVER "\":%d,\"" D_CMND_WIFICONFIG "\":%d}}"),
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_STATUS D_STATUS5_NETWORK "\":{\"" D_CMND_HOSTNAME "\":\"%s\",\"" D_CMND_IPADDRESS "\":\"%s\",\"" D_JSON_GATEWAY "\":\"%s\",\"" D_JSON_SUBNETMASK "\":\"%s\",\"" D_JSON_DNSSERVER "\":\"%s\",\"" D_JSON_MAC "\":\"%s\",\"" D_CMND_WEBSERVER "\":%d,\"" D_CMND_WIFICONFIG "\":%d}}"),
my_hostname, WiFi.localIP().toString().c_str(), IPAddress(Settings.ip_address[1]).toString().c_str(), IPAddress(Settings.ip_address[2]).toString().c_str(), IPAddress(Settings.ip_address[3]).toString().c_str(),
WiFi.macAddress().c_str(), Settings.webserver, Settings.sta_config);
MqttPublishPrefixTopic_P(option, PSTR(D_CMND_STATUS "5"));
}
if (((0 == payload) || (6 == payload)) && Settings.flag.mqtt_enabled) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_STATUS D_STATUS6_MQTT "\":{\"" D_CMND_MQTTHOST "\":\"%s\",\"" D_CMND_MQTTPORT "\":%d,\"" D_CMND_MQTTCLIENT D_MASK "\":\"%s\",\"" D_CMND_MQTTCLIENT "\":\"%s\",\"" D_CMND_MQTTUSER "\":\"%s\",\"MAX_PACKET_SIZE\":%d,\"KEEPALIVE\":%d}}"),
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_STATUS D_STATUS6_MQTT "\":{\"" D_CMND_MQTTHOST "\":\"%s\",\"" D_CMND_MQTTPORT "\":%d,\"" D_CMND_MQTTCLIENT D_JSON_MASK "\":\"%s\",\"" D_CMND_MQTTCLIENT "\":\"%s\",\"" D_CMND_MQTTUSER "\":\"%s\",\"MAX_PACKET_SIZE\":%d,\"KEEPALIVE\":%d}}"),
Settings.mqtt_host, Settings.mqtt_port, Settings.mqtt_client, mqtt_client, Settings.mqtt_user, MQTT_MAX_PACKET_SIZE, MQTT_KEEPALIVE);
MqttPublishPrefixTopic_P(option, PSTR(D_CMND_STATUS "6"));
}
if ((0 == payload) || (7 == payload)) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_STATUS D_STATUS7_TIME "\":{\"" D_UTC_TIME "\":\"%s\",\"" D_LOCAL_TIME "\":\"%s\",\"" D_STARTDST "\":\"%s\",\"" D_ENDDST "\":\"%s\",\"" D_CMND_TIMEZONE "\":%d}}"),
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_STATUS D_STATUS7_TIME "\":{\"" D_JSON_UTC_TIME "\":\"%s\",\"" D_JSON_LOCAL_TIME "\":\"%s\",\"" D_JSON_STARTDST "\":\"%s\",\"" D_JSON_ENDDST "\":\"%s\",\"" D_CMND_TIMEZONE "\":%d}}"),
GetTime(0).c_str(), GetTime(1).c_str(), GetTime(2).c_str(), GetTime(3).c_str(), Settings.timezone);
MqttPublishPrefixTopic_P(option, PSTR(D_CMND_STATUS "7"));
}
@ -1769,34 +1769,34 @@ void PublishStatus(uint8_t payload)
void MqttShowState()
{
char stemp1[16];
char stemp1[33];
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s{\"" D_TIME "\":\"%s\",\"" D_UPTIME "\":%d"), mqtt_data, GetDateAndTime().c_str(), uptime);
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s{\"" D_JSON_TIME "\":\"%s\",\"" D_JSON_UPTIME "\":%d"), mqtt_data, GetDateAndTime().c_str(), uptime);
#ifdef USE_ADC_VCC
dtostrfd((double)ESP.getVcc()/1000, 3, stemp1);
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"" D_VCC "\":%s"), mqtt_data, stemp1);
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"" D_JSON_VCC "\":%s"), mqtt_data, stemp1);
#endif
for (byte i = 0; i < devices_present; i++) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"%s\":\"%s\""), mqtt_data, GetPowerDevice(stemp1, i +1, sizeof(stemp1)), GetStateText(bitRead(power, i)));
}
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"" D_WIFI "\":{\"" D_AP "\":%d,\"" D_SSID "\":\"%s\",\"" D_RSSI "\":%d,\"" D_APMAC_ADDRESS "\":\"%s\"}}"),
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"" D_JSON_WIFI "\":{\"" D_JSON_AP "\":%d,\"" D_JSON_SSID "\":\"%s\",\"" D_JSON_RSSI "\":%d,\"" D_JSON_APMAC_ADDRESS "\":\"%s\"}}"),
mqtt_data, Settings.sta_active +1, Settings.sta_ssid[Settings.sta_active], WifiGetRssiAsQuality(WiFi.RSSI()), WiFi.BSSIDstr().c_str());
}
boolean MqttShowSensor()
{
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s{\"" D_TIME "\":\"%s\""), mqtt_data, GetDateAndTime().c_str());
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s{\"" D_JSON_TIME "\":\"%s\""), mqtt_data, GetDateAndTime().c_str());
int json_data_start = strlen(mqtt_data);
for (byte i = 0; i < MAX_SWITCHES; i++) {
if (pin[GPIO_SWT1 +i] < 99) {
boolean swm = ((FOLLOW_INV == Settings.switchmode[i]) || (PUSHBUTTON_INV == Settings.switchmode[i]) || (PUSHBUTTONHOLD_INV == Settings.switchmode[i]));
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"" D_SWITCH "%d\":\"%s\""), mqtt_data, i +1, GetStateText(swm ^ lastwallswitch[i]));
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"" D_JSON_SWITCH "%d\":\"%s\""), mqtt_data, i +1, GetStateText(swm ^ lastwallswitch[i]));
}
}
XsnsCall(FUNC_JSON_APPEND);
boolean json_data_available = (strlen(mqtt_data) - json_data_start);
if (strstr_P(mqtt_data, PSTR(D_TEMPERATURE))) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"" D_TEMPERATURE_UNIT "\":\"%c\""), mqtt_data, TempUnit());
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"" D_JSON_TEMPERATURE_UNIT "\":\"%c\""), mqtt_data, TempUnit());
}
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s}"), mqtt_data);
@ -1875,7 +1875,7 @@ void PerformEverySecond()
if ((2 == RtcTime.minute) && latest_uptime_flag) {
latest_uptime_flag = false;
uptime++;
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_TIME "\":\"%s\",\"" D_UPTIME "\":%d}"), GetDateAndTime().c_str(), uptime);
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_TIME "\":\"%s\",\"" D_JSON_UPTIME "\":%d}"), GetDateAndTime().c_str(), uptime);
MqttPublishPrefixTopic_P(2, PSTR(D_RSLT_UPTIME));
}
if ((3 == RtcTime.minute) && !latest_uptime_flag) {
@ -2140,7 +2140,8 @@ void StateLoop()
if ((pulse_timer[i] > 0) && (pulse_timer[i] < 112)) {
pulse_timer[i]--;
if (!pulse_timer[i]) {
ExecuteCommandPower(i +1, 0);
// ExecuteCommandPower(i +1, 0);
ExecuteCommandPower(i +1, (5 == Settings.poweronstate) ? 1: 0);
}
}
}
@ -2228,6 +2229,8 @@ void StateLoop()
if (ota_state_flag && (backlog_pointer == backlog_index)) {
ota_state_flag--;
if (2 == ota_state_flag) {
ota_url = Settings.ota_url;
RtcSettings.ota_loader = 0; // Try requested image first
ota_retry_counter = OTA_ATTEMPTS;
ESPhttpUpdate.rebootOnUpdate(false);
SettingsSave(1); // Free flash for OTA update
@ -2245,10 +2248,32 @@ void StateLoop()
ota_result = 0;
ota_retry_counter--;
if (ota_retry_counter) {
// snprintf_P(log_data, sizeof(log_data), PSTR("OTA: Attempt %d"), OTA_ATTEMPTS - ota_retry_counter);
// AddLog(LOG_LEVEL_INFO);
ota_result = (HTTP_UPDATE_FAILED != ESPhttpUpdate.update(Settings.ota_url));
#ifndef BE_MINIMAL
if (RtcSettings.ota_loader) {
char *pch = strrchr(Settings.ota_url, '-'); // Change from filename-DE.bin into filename-minimal.bin
char *ech = strrchr(Settings.ota_url, '.'); // Change from filename.bin into filename-minimal.bin
if (!pch) {
pch = ech;
}
if (pch) {
strlcpy(mqtt_data, Settings.ota_url, pch - Settings.ota_url +1);
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s-" D_JSON_MINIMAL "%s"), mqtt_data, ech); // Minimal filename must be filename-minimal
ota_url = mqtt_data; // Try minimal image
}
}
#endif // BE_MINIMAL
snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_UPLOAD "%s"), ota_url);
AddLog(LOG_LEVEL_DEBUG);
ota_result = (HTTP_UPDATE_FAILED != ESPhttpUpdate.update(ota_url));
if (!ota_result) {
#ifndef BE_MINIMAL
int ota_error = ESPhttpUpdate.getLastError();
// snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_UPLOAD "Ota error %d"), ota_error);
// AddLog(LOG_LEVEL_DEBUG);
if ((HTTP_UE_TOO_LESS_SPACE == ota_error) || (HTTP_UE_BIN_FOR_WRONG_FLASH == ota_error)) {
RtcSettings.ota_loader = 1; // Try minimal image next
}
#endif // BE_MINIMAL
ota_state_flag = 2; // Upgrade failed - retry
}
}
@ -2257,9 +2282,9 @@ void StateLoop()
ota_state_flag = 0;
if (ota_result) {
SetFlashModeDout(); // Force DOUT for both ESP8266 and ESP8285
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR(D_SUCCESSFUL ". " D_RESTARTING));
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR(D_JSON_SUCCESSFUL ". " D_JSON_RESTARTING));
} else {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR(D_FAILED " %s"), ESPhttpUpdate.getLastErrorString().c_str());
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR(D_JSON_FAILED " %s"), ESPhttpUpdate.getLastErrorString().c_str());
}
restart_flag = 2; // Restart anyway to keep memory clean webserver
MqttPublishPrefixTopic_P(1, PSTR(D_CMND_UPGRADE));
@ -2611,6 +2636,16 @@ void setup()
Serial.println();
seriallog_level = LOG_LEVEL_INFO; // Allow specific serial messages until config loaded
snprintf_P(my_version, sizeof(my_version), PSTR("%d.%d.%d"), VERSION >> 24 & 0xff, VERSION >> 16 & 0xff, VERSION >> 8 & 0xff);
if (VERSION & 0x1f) {
idx = strlen(my_version);
my_version[idx] = 96 + (VERSION & 0x1f);
my_version[idx +1] = 0;
}
#ifdef BE_MINIMAL
snprintf_P(my_version, sizeof(my_version), PSTR("%s-" D_JSON_MINIMAL), my_version);
#endif // BE_MINIMAL
SettingsLoad();
SettingsDelta();
@ -2653,6 +2688,7 @@ void setup()
if ((resetInfo.reason == REASON_DEFAULT_RST) || (resetInfo.reason == REASON_EXT_SYS_RST)) {
switch (Settings.poweronstate) {
case 0: // All off
case 5: // All off but on after PulseTime
power = 0;
SetDevicePower(power);
break;
@ -2686,16 +2722,21 @@ void setup()
if ((i < MAX_RELAYS) && (pin[GPIO_REL1 +i] < 99)) {
bitWrite(power, i, digitalRead(pin[GPIO_REL1 +i]) ^ bitRead(rel_inverted, i));
}
if ((i < MAX_PULSETIMERS) && bitRead(power, i)) {
// if ((i < MAX_PULSETIMERS) && bitRead(power, i)) {
if ((i < MAX_PULSETIMERS) && (bitRead(power, i) || (5 == Settings.poweronstate))) {
pulse_timer[i] = Settings.pulse_timer[i];
}
}
blink_powersave = power;
snprintf_P(log_data, sizeof(log_data), PSTR(D_PROJECT " %s %s (" D_CMND_TOPIC " %s, " D_FALLBACK " %s, " D_CMND_GROUPTOPIC " %s) " D_VERSION " " VERSION_STRING),
PROJECT, Settings.friendlyname[0], Settings.mqtt_topic, mqtt_client, Settings.mqtt_grptopic);
snprintf_P(log_data, sizeof(log_data), PSTR(D_PROJECT " %s %s (" D_CMND_TOPIC " %s, " D_FALLBACK " %s, " D_CMND_GROUPTOPIC " %s) " D_VERSION " %s"),
PROJECT, Settings.friendlyname[0], Settings.mqtt_topic, mqtt_client, Settings.mqtt_grptopic, my_version);
AddLog(LOG_LEVEL_INFO);
#ifdef BE_MINIMAL
snprintf_P(log_data, sizeof(log_data), PSTR(D_WARNING_MINIMAL_VERSION));
AddLog(LOG_LEVEL_INFO);
#endif // BE_MINIMAL
RtcInit();
XSnsInit();

View File

@ -103,5 +103,9 @@ void WifiWpsStatusCallback(wps_cb_status status);
#define MESSZ 405 // Max number of characters in JSON message string (6 x DS18x20 sensors)
#endif
#include <core_version.h> // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_3_0)
#ifndef ARDUINO_ESP8266_RELEASE
#define ARDUINO_ESP8266_RELEASE "STAGED"
#endif
#endif // _SONOFF_POST_H_

View File

@ -86,7 +86,8 @@ enum UserSelectablePins {
GPIO_SAIR_RX, // SenseAir Serial interface
GPIO_SPI_CS, // SPI Chip Select
GPIO_SPI_DC, // SPI Data Direction
GPIO_BACKLIGHT,
GPIO_BACKLIGHT, // Display backlight control
GPIO_PMS5003, // Plantower PMS5003 Serial interface
GPIO_SENSOR_END };
// Text in webpage Module Parameters and commands GPIOS and GPIO
@ -155,7 +156,8 @@ const char kSensors[GPIO_SENSOR_END][9] PROGMEM = {
D_SENSOR_SAIR_RX,
D_SENSOR_SPI_CS,
D_SENSOR_SPI_DC,
D_SENSOR_BACKLIGHT
D_SENSOR_BACKLIGHT,
D_SENSOR_PMS5003
};
// Programmer selectable GPIO functionality offset by user selectable GPIOs
@ -844,6 +846,21 @@ const mytmplt kModules[MAXMODULE] PROGMEM = {
GPIO_LED1, // GPIO15 Led (1 = On, 0 = Off)
0, 0
}
{ "Zengge WF017", // Zenggee ZJ-WF017-A (ESP12S)) - https://www.ebay.com/p/Smartphone-Android-IOS-WiFi-Music-Controller-for-RGB-5050-3528-LED-Strip-Light/534446632?_trksid=p2047675.l2644
GPIO_KEY1, // GPIO00 Optional Button
0,
GPIO_USER, // GPIO02 Empty pad
0,
GPIO_USER, // GPIO04 W2 - PWM5
0,
0, 0, 0, 0, 0, 0, // Flash connection
GPIO_PWM2, // GPIO12 RGB LED Green
GPIO_PWM1, // GPIO13 RGB LED Red
GPIO_PWM3, // GPIO14 RGB LED Blue
0, 0, 0
}
*/
#endif // _SONOFF_TEMPLATE_H_

View File

@ -26,7 +26,7 @@ unsigned long syslog_host_refresh = 0;
Ticker tickerOSWatch;
#define OSWATCH_RESET_TIME 30
#define OSWATCH_RESET_TIME 120
static unsigned long oswatch_last_loop_time;
byte oswatch_blocked_loop = 0;
@ -71,7 +71,7 @@ String GetResetReason()
{
char buff[32];
if (oswatch_blocked_loop) {
strncpy_P(buff, PSTR(D_BLOCKED_LOOP), sizeof(buff));
strncpy_P(buff, PSTR(D_JSON_BLOCKED_LOOP), sizeof(buff));
return String(buff);
} else {
return ESP.getResetReason();
@ -461,10 +461,12 @@ void WifiBegin(uint8_t flag)
#ifdef USE_EMULATION
UdpDisconnect();
#endif // USE_EMULATION
if (!strncmp_P(ESP.getSdkVersion(),PSTR("1.5.3"),5)) {
AddLog_P(LOG_LEVEL_DEBUG, S_LOG_WIFI, PSTR(D_PATCH_ISSUE_2186));
WiFi.mode(WIFI_OFF); // See https://github.com/esp8266/Arduino/issues/2186
}
#ifdef ARDUINO_ESP8266_RELEASE_2_3_0 // (!strncmp_P(ESP.getSdkVersion(),PSTR("1.5.3"),5))
AddLog_P(LOG_LEVEL_DEBUG, S_LOG_WIFI, PSTR(D_PATCH_ISSUE_2186));
WiFi.mode(WIFI_OFF); // See https://github.com/esp8266/Arduino/issues/2186
#endif
WiFi.disconnect();
WiFi.mode(WIFI_STA); // Disable AP mode
if (Settings.sleep) {
@ -610,6 +612,12 @@ void WifiCheck(uint8_t param)
WifiCheckIp();
}
if ((WL_CONNECTED == WiFi.status()) && (static_cast<uint32_t>(WiFi.localIP()) != 0) && !wifi_config_type) {
#ifdef BE_MINIMAL
if (1 == RtcSettings.ota_loader) {
RtcSettings.ota_loader = 0;
ota_state_flag = 3;
}
#endif // BE_MINIMAL
#ifdef USE_DISCOVERY
if (!mdns_begun) {
mdns_begun = MDNS.begin(my_hostname);
@ -840,7 +848,7 @@ void I2cScan(char *devs, unsigned int devs_len)
byte any = 0;
char tstr[10];
snprintf_P(devs, devs_len, PSTR("{\"" D_CMND_I2CSCAN "\":\"" D_I2CSCAN_DEVICES_FOUND_AT));
snprintf_P(devs, devs_len, PSTR("{\"" D_CMND_I2CSCAN "\":\"" D_JSON_I2CSCAN_DEVICES_FOUND_AT));
for (address = 1; address <= 127; address++) {
Wire.beginTransmission(address);
error = Wire.endTransmission();
@ -850,13 +858,13 @@ void I2cScan(char *devs, unsigned int devs_len)
any = 1;
}
else if (4 == error) {
snprintf_P(devs, devs_len, PSTR("{\"" D_CMND_I2CSCAN "\":\"" D_I2CSCAN_UNKNOWN_ERROR_AT " 0x%2x\"}"), address);
snprintf_P(devs, devs_len, PSTR("{\"" D_CMND_I2CSCAN "\":\"" D_JSON_I2CSCAN_UNKNOWN_ERROR_AT " 0x%2x\"}"), address);
}
}
if (any) {
strncat(devs, "\"}", devs_len);
} else {
snprintf_P(devs, devs_len, PSTR("{\"" D_CMND_I2CSCAN "\":\"" D_I2CSCAN_NO_DEVICES_FOUND "\"}"));
snprintf_P(devs, devs_len, PSTR("{\"" D_CMND_I2CSCAN "\":\"" D_JSON_I2CSCAN_NO_DEVICES_FOUND "\"}"));
}
}

View File

@ -29,11 +29,13 @@
\*********************************************************************************************/
// -- Localization --------------------------------
//#define MY_LANGUAGE en-GB // English in Great Britain. Enabled by Default
//#define MY_LANGUAGE nl-NL // Dutch in the Netherlands
//#define MY_LANGUAGE de-DE // German in Germany
//#define MY_LANGUAGE pl-PL // Polish in Poland
//#define MY_LANGUAGE en-GB // English in Great Britain. Enabled by Default
//#define MY_LANGUAGE fr-FR // French in France
//#define MY_LANGUAGE it-IT // Italian in Italy
//#define MY_LANGUAGE nl-NL // Dutch in the Netherlands
//#define MY_LANGUAGE pl-PL // Polish in Poland
//#define MY_LANGUAGE zh-CN // Chinese (Simplified) in China
// -- Project -------------------------------------
#define PROJECT "sonoff" // PROJECT is used as the default topic delimiter and OTA file name
@ -184,7 +186,7 @@
// #define USE_ADS1115 // Add I2C code for ADS1115 16 bit A/D converter based on Adafruit ADS1x15 library (no library needed) (+0k7 code)
// #define USE_ADS1115_I2CDEV // Add I2C code for ADS1115 16 bit A/D converter using library i2cdevlib-Core and i2cdevlib-ADS1115 (+2k code)
// #define USE_INA219 // Add I2C code for INA219 Low voltage and current sensor (+1k code)
// #define USE_DISPLAY // Add I2C Display Support for LCD, Oled and up to eigth Matrices
// #define USE_DISPLAY // Add I2C Display Support for LCD, Oled and up to eigth Matrices (+19k code)
#define MTX_ADDRESS1 0x71 // [DisplayAddress[1]] I2C address of first 8x8 matrix module
#define MTX_ADDRESS2 0x74 // [DisplayAddress[2]] I2C address of second 8x8 matrix module
#define MTX_ADDRESS3 0x75 // [DisplayAddress[3]] I2C address of third 8x8 matrix module
@ -195,7 +197,7 @@
#define MTX_ADDRESS8 0x00 // [DisplayAddress[8]] I2C address of eigth 8x8 matrix module
#endif // USE_I2C
//#define USE_SPI // SPI using library theo_TFT
//#define USE_SPI // SPI using library TasmotaTFT
#ifdef USE_SPI
#ifndef USE_DISPLAY
#define USE_DISPLAY // Add SPI Display support for 320x240 and 480x320 TFT

View File

@ -222,7 +222,7 @@ const char HTTP_FORM_LOG1[] PROGMEM =
"<fieldset><legend><b>&nbsp;" D_LOGGING_PARAMETERS "&nbsp;</b></legend><form method='get' action='sv'>"
"<input id='w' name='w' value='3' hidden><input id='r' name='r' value='0' hidden>";
const char HTTP_FORM_LOG2[] PROGMEM =
"<br/><b>{b0" D_LOG_LEVEL "</b> ({b1)<br/><select id='{b2' name='{b2'>"
"<br/><b>{b0</b> ({b1)<br/><select id='{b2' name='{b2'>"
"<option{a0value='0'>0 " D_NONE "</option>"
"<option{a1value='1'>1 " D_ERROR "</option>"
"<option{a2value='2'>2 " D_INFO "</option>"
@ -278,7 +278,7 @@ const char HTTP_COUNTER[] PROGMEM =
"<br/><div id='t' name='t' style='text-align:center;'></div>";
const char HTTP_END[] PROGMEM =
"<br/>"
"<div style='text-align:right;font-size:11px;'><hr/><a href='" D_WEBLINK "' target='_blank' style='color:#aaa;'>" D_PROGRAMNAME " " VERSION_STRING " " D_BY " " D_AUTHOR "</a></div>"
"<div style='text-align:right;font-size:11px;'><hr/><a href='" D_WEBLINK "' target='_blank' style='color:#aaa;'>" D_PROGRAMNAME " {mv " D_BY " " D_AUTHOR "</a></div>"
"</div>"
"</body>"
"</html>";
@ -407,6 +407,9 @@ void SetHeader()
WebServer->sendHeader(F("Cache-Control"), F("no-cache, no-store, must-revalidate"));
WebServer->sendHeader(F("Pragma"), F("no-cache"));
WebServer->sendHeader(F("Expires"), F("-1"));
#ifndef ARDUINO_ESP8266_RELEASE_2_3_0
WebServer->sendHeader(F("Access-Control-Allow-Origin"), F("*"));
#endif
}
void ShowPage(String &page)
@ -423,6 +426,7 @@ void ShowPage(String &page)
}
}
page += FPSTR(HTTP_END);
page.replace(F("{mv"), my_version);
SetHeader();
WebServer->send(200, FPSTR(HDR_CTYPE_HTML), page);
}
@ -837,7 +841,7 @@ void HandleLoggingConfiguration()
page += FPSTR(HTTP_FORM_LOG2);
switch (idx) {
case 0:
page.replace(F("{b0"), F(D_SERIAL " "));
page.replace(F("{b0"), F(D_SERIAL_LOG_LEVEL));
page.replace(F("{b1"), STR(SERIAL_LOG_LEVEL));
page.replace(F("{b2"), F("ls"));
for (byte i = LOG_LEVEL_NONE; i < LOG_LEVEL_ALL; i++) {
@ -845,7 +849,7 @@ void HandleLoggingConfiguration()
}
break;
case 1:
page.replace(F("{b0"), F(D_WEB " "));
page.replace(F("{b0"), F(D_WEB_LOG_LEVEL));
page.replace(F("{b1"), STR(WEB_LOG_LEVEL));
page.replace(F("{b2"), F("lw"));
for (byte i = LOG_LEVEL_NONE; i < LOG_LEVEL_ALL; i++) {
@ -853,7 +857,7 @@ void HandleLoggingConfiguration()
}
break;
case 2:
page.replace(F("{b0"), F(D_SYS));
page.replace(F("{b0"), F(D_SYS_LOG_LEVEL));
page.replace(F("{b1"), STR(SYS_LOG_LEVEL));
page.replace(F("{b2"), F("ll"));
for (byte i = LOG_LEVEL_NONE; i < LOG_LEVEL_ALL; i++) {
@ -884,10 +888,14 @@ void HandleOtherConfiguration()
page += FPSTR(HTTP_FORM_OTHER);
page.replace(F("{p1"), Settings.web_password);
page.replace(F("{r1"), (Settings.flag.mqtt_enabled) ? F(" checked") : F(""));
page += FPSTR(HTTP_FORM_OTHER2);
page.replace(F("{1"), F("1"));
page.replace(F("{2"), FRIENDLY_NAME);
page.replace(F("{3"), Settings.friendlyname[0]);
uint8_t maxfn = (devices_present > MAX_FRIENDLYNAMES) ? MAX_FRIENDLYNAMES : devices_present;
for (byte i = 0; i < maxfn; i++) {
page += FPSTR(HTTP_FORM_OTHER2);
page.replace(F("{1"), String(i +1));
snprintf_P(stemp, sizeof(stemp), PSTR(FRIENDLY_NAME"%d"), i +1);
page.replace(F("{2"), (i) ? stemp : FRIENDLY_NAME);
page.replace(F("{3"), Settings.friendlyname[i]);
}
#ifdef USE_EMULATION
page += FPSTR(HTTP_FORM_OTHER3a);
for (byte i = 0; i < EMUL_MAX; i++) {
@ -897,15 +905,7 @@ void HandleOtherConfiguration()
page.replace(F("{3"), (i == EMUL_NONE) ? F(D_NONE) : (i == EMUL_WEMO) ? F(D_BELKIN_WEMO) : F(D_HUE_BRIDGE));
page.replace(F("{4"), (i == EMUL_NONE) ? F("") : (i == EMUL_WEMO) ? F(" " D_SINGLE_DEVICE) : F(" " D_MULTI_DEVICE));
}
page += F("<br/>");
uint8_t maxfn = (devices_present > MAX_FRIENDLYNAMES) ? MAX_FRIENDLYNAMES : devices_present;
for (byte i = 1; i < maxfn; i++) {
page += FPSTR(HTTP_FORM_OTHER2);
page.replace(F("{1"), String(i +1));
snprintf_P(stemp, sizeof(stemp), PSTR(FRIENDLY_NAME"%d"), i +1);
page.replace(F("{2"), stemp);
page.replace(F("{3"), Settings.friendlyname[i]);
}
// page += F("<br/>");
page += F("<br/></fieldset>");
#endif // USE_EMULATION
page += FPSTR(HTTP_FORM_END);
@ -926,8 +926,7 @@ void HandleBackupConfiguration()
WebServer->setContentLength(sizeof(buffer));
char attachment[100];
snprintf_P(attachment, sizeof(attachment), PSTR("attachment; filename=Config_%s_" VERSION_STRING ".dmp"),
Settings.friendlyname[0]);
snprintf_P(attachment, sizeof(attachment), PSTR("attachment; filename=Config_%s_%s.dmp"), Settings.friendlyname[0], my_version);
WebServer->sendHeader(F("Content-Disposition"), attachment);
WebServer->send(200, FPSTR(HDR_CTYPE_STREAM), "");
memcpy(buffer, &Settings, sizeof(buffer));
@ -1079,7 +1078,7 @@ void HandleResetConfiguration()
return;
}
char svalue[16];
char svalue[33];
AddLog_P(LOG_LEVEL_DEBUG, S_LOG_HTTP, S_RESET_CONFIGURATION);
@ -1375,6 +1374,7 @@ void HandleHttpCommand()
} else {
message += F(D_NEED_USER_AND_PASSWORD "\"}");
}
SetHeader();
WebServer->send(200, FPSTR(HDR_CTYPE_JSON), message);
}
@ -1479,9 +1479,9 @@ void HandleInformation()
// }2 = </th><td>
String func = FPSTR(HTTP_SCRIPT_INFO_BEGIN);
func += F("<table width='100%'><tr><th>");
func += F(D_PROGRAM_VERSION "}2" VERSION_STRING);
func += F(D_PROGRAM_VERSION "}2"); func += my_version;
func += F("}1" D_BUILD_DATE_AND_TIME "}2"); func += GetBuildDateAndTime();
func += F("}1" D_CORE_AND_SDK_VERSION "}2"); func += ESP.getCoreVersion(); func += F("/"); func += String(ESP.getSdkVersion());
func += F("}1" D_CORE_AND_SDK_VERSION "}2" ARDUINO_ESP8266_RELEASE "/"); func += String(ESP.getSdkVersion());
func += F("}1" D_UPTIME "}2"); func += String(uptime); func += F(" Hours");
snprintf_P(stopic, sizeof(stopic), PSTR(" at %X"), GetSettingsAddress());
func += F("}1" D_FLASH_WRITE_COUNT "}2"); func += String(Settings.save_flag); func += stopic;

View File

@ -188,7 +188,7 @@ void AriluxRfHandler()
AddLog(LOG_LEVEL_DEBUG);
if (hostcode == stored_hostcode) {
char command[16];
char command[33];
char value = '-';
command[0] = '\0';
uint8_t keycode = arilux_rf_received_value & 0xFF;
@ -533,7 +533,7 @@ void LightPowerOn()
void LightPreparePower()
{
char scolor[25];
char scommand[16];
char scommand[33];
if (Settings.light_dimmer && !(light_power)) {
ExecuteCommandPower(devices_present, 7); // No publishPowerState
@ -1096,7 +1096,7 @@ boolean LightCommand()
light_wakeup_active = 3;
Settings.light_scheme = LS_WAKEUP;
LightPowerOn();
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, D_STARTED);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, D_JSON_STARTED);
}
else if ((CMND_COLORTEMPERATURE == command_code) && ((LST_COLDWARM == light_subtype) || (LST_RGBWC == light_subtype))) { // ColorTemp
if (option != '\0') {

View File

@ -339,7 +339,7 @@ boolean IrSendCommand()
error = true;
}
if (error) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_IRSEND "\":\"" D_NO " " D_JSON_IR_PROTOCOL ", " D_JSON_IR_BITS " " D_JSON_OR " " D_JSON_IR_DATA "\"}"));
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_IRSEND "\":\"" D_JSON_NO " " D_JSON_IR_PROTOCOL ", " D_JSON_IR_BITS " " D_JSON_OR " " D_JSON_IR_DATA "\"}"));
}
}
#ifdef USE_IR_HVAC

View File

@ -1,5 +1,5 @@
/*
xsns_03_energy.ino - HLW8012 (Sonoff Pow) and PZEM004T energy sensor support for Sonoff-Tasmota
xdrv_03_energy.ino - HLW8012 (Sonoff Pow) and PZEM004T energy sensor support for Sonoff-Tasmota
Copyright (C) 2018 Theo Arends
@ -304,6 +304,7 @@ void PzemSend(uint8_t cmd)
uint8_t *bytes = (uint8_t*)&pzem;
pzem.crc = PzemCrc(bytes);
PzemSerial->flush();
PzemSerial->write(bytes, sizeof(pzem));
}
@ -569,7 +570,7 @@ void EnergyMarginCheck()
} else {
energy_mplh_counter--;
if (!energy_mplh_counter) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_MAXPOWERREACHED "\":\"%d%s\"}"), energy_power_u, (Settings.flag.value_units) ? " " D_UNIT_WATT : "");
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_MAXPOWERREACHED "\":\"%d%s\"}"), energy_power_u, (Settings.flag.value_units) ? " " D_UNIT_WATT : "");
MqttPublishPrefixTopic_P(1, S_RSLT_WARNING);
EnergyMqttShow();
ExecuteCommandPower(1, 0);
@ -592,11 +593,11 @@ void EnergyMarginCheck()
if (energy_mplr_counter) {
energy_mplr_counter--;
if (energy_mplr_counter) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_POWERMONITOR "\":\"%s\"}"), GetStateText(1));
MqttPublishPrefixTopic_P(5, PSTR(D_POWERMONITOR));
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_POWERMONITOR "\":\"%s\"}"), GetStateText(1));
MqttPublishPrefixTopic_P(5, PSTR(D_JSON_POWERMONITOR));
ExecuteCommandPower(1, 1);
} else {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_MAXPOWERREACHEDRETRY "\":\"%s\"}"), GetStateText(0));
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_MAXPOWERREACHEDRETRY "\":\"%s\"}"), GetStateText(0));
MqttPublishPrefixTopic_P(1, S_RSLT_WARNING);
EnergyMqttShow();
}
@ -610,14 +611,14 @@ void EnergyMarginCheck()
energy_daily_u = (uint16_t)(energy_daily * 1000);
if (!energy_max_energy_state && (RtcTime.hour == Settings.energy_max_energy_start)) {
energy_max_energy_state = 1;
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_ENERGYMONITOR "\":\"%s\"}"), GetStateText(1));
MqttPublishPrefixTopic_P(5, PSTR(D_ENERGYMONITOR));
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_ENERGYMONITOR "\":\"%s\"}"), GetStateText(1));
MqttPublishPrefixTopic_P(5, PSTR(D_JSON_ENERGYMONITOR));
ExecuteCommandPower(1, 1);
}
else if ((1 == energy_max_energy_state) && (energy_daily_u >= Settings.energy_max_energy)) {
energy_max_energy_state = 2;
dtostrfd(energy_daily, 3, mqtt_data);
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_MAXENERGYREACHED "\":\"%s%s\"}"), mqtt_data, (Settings.flag.value_units) ? " " D_UNIT_KILOWATTHOUR : "");
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_MAXENERGYREACHED "\":\"%s%s\"}"), mqtt_data, (Settings.flag.value_units) ? " " D_UNIT_KILOWATTHOUR : "");
MqttPublishPrefixTopic_P(1, S_RSLT_WARNING);
EnergyMqttShow();
ExecuteCommandPower(1, 0);
@ -629,7 +630,7 @@ void EnergyMarginCheck()
void EnergyMqttShow()
{
// {"Time":"2017-12-16T11:48:55","ENERGY":{"Total":0.212,"Yesterday":0.000,"Today":0.014,"Period":2.0,"Power":22.0,"Factor":1.00,"Voltage":213.6,"Current":0.100}}
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_TIME "\":\"%s\""), GetDateAndTime().c_str());
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_TIME "\":\"%s\""), GetDateAndTime().c_str());
EnergyShow(1);
MqttPublishPrefixTopic_P(2, PSTR(D_RSLT_ENERGY), Settings.flag.mqtt_sensor_retain);
}

View File

@ -40,7 +40,7 @@ unsigned long sonoff_bridge_last_learn_time = 0;
void SonoffBridgeLearnFailed()
{
sonoff_bridge_learn_active = 0;
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, D_CMND_RFKEY, sonoff_bridge_learn_key, D_LEARN_FAILED);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, D_CMND_RFKEY, sonoff_bridge_learn_key, D_JSON_LEARN_FAILED);
MqttPublishPrefixTopic_P(5, PSTR(D_CMND_RFKEY));
}
@ -71,7 +71,7 @@ void SonoffBridgeReceived()
for (byte i = 0; i < 9; i++) {
Settings.rf_code[sonoff_bridge_learn_key][i] = serial_in_buffer[i +1];
}
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, D_CMND_RFKEY, sonoff_bridge_learn_key, D_LEARNED);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, D_CMND_RFKEY, sonoff_bridge_learn_key, D_JSON_LEARNED);
MqttPublishPrefixTopic_P(5, PSTR(D_CMND_RFKEY));
} else {
SonoffBridgeLearnFailed();
@ -90,7 +90,7 @@ void SonoffBridgeReceived()
if (!((received_id == sonoff_bridge_last_received_id) && (now - sonoff_bridge_last_time < SFB_TIME_AVOID_DUPLICATE))) {
sonoff_bridge_last_received_id = received_id;
sonoff_bridge_last_time = now;
strncpy_P(rfkey, PSTR("\"" D_NONE "\""), sizeof(rfkey));
strncpy_P(rfkey, PSTR("\"" D_JSON_NONE "\""), sizeof(rfkey));
for (byte i = 1; i <= 16; i++) {
if (Settings.rf_code[i][0]) {
uint32_t send_id = Settings.rf_code[i][6] << 16 | Settings.rf_code[i][7] << 8 | Settings.rf_code[i][8];
@ -100,9 +100,9 @@ void SonoffBridgeReceived()
}
}
}
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_RFRECEIVED "\":{\"" D_JSON_SYNC "\":%d,\"" D_JSON_LOW "\":%d,\"" D_JSON_HIGH "\":%d,\"" D_JSON_DATA "\":\"%06X\",\"" D_CMND_RFKEY "\":%s}}"),
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_RFRECEIVED "\":{\"" D_JSON_SYNC "\":%d,\"" D_JSON_LOW "\":%d,\"" D_JSON_HIGH "\":%d,\"" D_JSON_DATA "\":\"%06X\",\"" D_CMND_RFKEY "\":%s}}"),
sync_time, low_time, high_time, received_id, rfkey);
MqttPublishPrefixTopic_P(6, PSTR(D_RFRECEIVED));
MqttPublishPrefixTopic_P(6, PSTR(D_JSON_RFRECEIVED));
#ifdef USE_DOMOTICZ
DomoticzSensor(DZ_COUNT, received_id); // Send rid as Domoticz Counter value
#endif // USE_DOMOTICZ
@ -255,11 +255,11 @@ boolean SonoffBridgeCommand()
sonoff_bridge_learn_active = 0;
if (2 == XdrvMailbox.payload) { // Learn RF data
SonoffBridgeLearn(XdrvMailbox.index);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, command, XdrvMailbox.index, D_START_LEARNING);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, command, XdrvMailbox.index, D_JSON_START_LEARNING);
}
else if (3 == XdrvMailbox.payload) { // Unlearn RF data
Settings.rf_code[XdrvMailbox.index][0] = 0;
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, command, XdrvMailbox.index, D_SET_TO_DEFAULT);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, command, XdrvMailbox.index, D_JSON_SET_TO_DEFAULT);
}
else if (4 == XdrvMailbox.payload) { // Save RF data provided by RFSync, RfLow, RfHigh and last RfCode
for (byte i = 0; i < 6; i++) {
@ -268,18 +268,18 @@ boolean SonoffBridgeCommand()
Settings.rf_code[XdrvMailbox.index][6] = (sonoff_bridge_last_send_code >> 16) & 0xff;
Settings.rf_code[XdrvMailbox.index][7] = (sonoff_bridge_last_send_code >> 8) & 0xff;
Settings.rf_code[XdrvMailbox.index][8] = sonoff_bridge_last_send_code & 0xff;
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, command, XdrvMailbox.index, D_SAVED);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, command, XdrvMailbox.index, D_JSON_SAVED);
} else {
if ((1 == XdrvMailbox.payload) || (0 == Settings.rf_code[XdrvMailbox.index][0])) {
SonoffBridgeSend(0, XdrvMailbox.index); // Send default RF data
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, command, XdrvMailbox.index, D_DEFAULT_SENT);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, command, XdrvMailbox.index, D_JSON_DEFAULT_SENT);
} else {
SonoffBridgeSend(XdrvMailbox.index, 0); // Send learned RF data
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, command, XdrvMailbox.index, D_LEARNED_SENT);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, command, XdrvMailbox.index, D_JSON_LEARNED_SENT);
}
}
} else {
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, command, sonoff_bridge_learn_key, D_LEARNING_ACTIVE);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, command, sonoff_bridge_learn_key, D_JSON_LEARNING_ACTIVE);
}
} else serviced = false;
return serviced;

View File

@ -224,7 +224,7 @@ boolean DomoticzCommand()
if (XdrvMailbox.payload >= 0) {
Settings.domoticz_switch_idx[XdrvMailbox.index -1] = XdrvMailbox.payload;
}
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_DOMOTICZ_COMMAND_INDEX_NVALUE, command, XdrvMailbox.index, Settings.domoticz_key_idx[XdrvMailbox.index -1]);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_DOMOTICZ_COMMAND_INDEX_NVALUE, command, XdrvMailbox.index, Settings.domoticz_switch_idx[XdrvMailbox.index -1]);
}
else if ((CMND_SENSORIDX == command_code) && (XdrvMailbox.index > 0) && (XdrvMailbox.index <= DZ_MAX_SENSORS)) {
if (XdrvMailbox.payload >= 0) {
@ -398,6 +398,7 @@ void DomoticzSaveSettings()
ssensor_indices, Settings.domoticz_update_timer);
AddLog(LOG_LEVEL_INFO);
}
#endif // USE_WEBSERVER
/*********************************************************************************************\
* Interface
@ -431,5 +432,4 @@ boolean Xdrv05(byte function)
return result;
}
#endif // USE_WEBSERVER
#endif // USE_DOMOTICZ

View File

@ -105,7 +105,7 @@ void SonoffScSerialInput(char *rcvstat)
#ifdef USE_WEBSERVER
const char HTTP_SNS_SCPLUS[] PROGMEM =
"%s{s}" D_LIGHT "{m}%d%{e}{s}" D_NOISE "{m}%d%{e}{s}" D_AIR_QUALITY "{m}%d%{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
"%s{s}" D_LIGHT "{m}%d%%{e}{s}" D_NOISE "{m}%d%%{e}{s}" D_AIR_QUALITY "{m}%d%%{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
#endif // USE_WEBSERVER
void SonoffScShow(boolean json)

View File

@ -372,7 +372,7 @@ void Ds18x20Show(boolean json)
for (byte j = 0; j < 6; j++) {
sprintf(address+2*j, "%02X", ds18x20_address[ds18x20_index[i]][6-j]); // Skip sensor type and crc
}
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"%s\":{\"" D_ID "\":\"%s\",\"" D_JSON_TEMPERATURE "\":%s}"), mqtt_data, stemp, address, temperature);
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"%s\":{\"" D_JSON_ID "\":\"%s\",\"" D_JSON_TEMPERATURE "\":%s}"), mqtt_data, stemp, address, temperature);
}
#ifdef USE_DOMOTICZ
if (domoticz_flag) {

View File

@ -460,7 +460,7 @@ void BmpShow(boolean json)
snprintf_P(json_sealevel, sizeof(json_sealevel), PSTR(",\"" D_JSON_PRESSUREATSEALEVEL "\":%s"), sea_pressure);
#ifdef USE_BME680
char json_gas[40];
snprintf_P(json_gas, sizeof(json_gas), PSTR(",\"" D_GAS "\":%s"), gas_resistance);
snprintf_P(json_gas, sizeof(json_gas), PSTR(",\"" D_JSON_GAS "\":%s"), gas_resistance);
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"%s\":{\"" D_JSON_TEMPERATURE "\":%s%s,\"" D_JSON_PRESSURE "\":%s%s%s}"),
mqtt_data, bmp_name, temperature, (bmp_model >= 2) ? json_humidity : "", pressure, (Settings.altitude != 0) ? json_sealevel : "", (bmp_model >= 3) ? json_gas : "");
#else

View File

@ -134,6 +134,7 @@ void Mhz50ms()
if (6 == mhz_timer) { // MH-Z19 measuring cycle takes 1005 +5% ms
mhz_timer = 0;
MhzSerial->flush();
MhzSerial->write(mhz_cmnd_read_ppm, 9);
}

View File

@ -74,6 +74,7 @@ void ModbusSend(uint8_t function_code, uint16_t start_address, uint16_t register
frame[7] = (uint8_t)((crc >> 8) & 0xFF);
frame[6] = (uint8_t)(crc & 0xFF);
SensairSerial->flush();
SensairSerial->write(frame, sizeof(frame));
}