Merge branch 'development' into release

This commit is contained in:
Theo Arends 2020-03-17 16:52:28 +01:00
commit a3cc81bb8a
66 changed files with 1050 additions and 1415 deletions

1
.gitignore vendored
View File

@ -10,6 +10,7 @@
.cache
tasmota/user_config_override.h
build
build_output
firmware.map
firmware.asm
tasmota*.bin

View File

@ -6,7 +6,7 @@ UDP multicasts, followed by UDP unicasts if necessary, are used to send updates
To include device groups support in the build, define USE_DEVICE_GROUPS in your user_config_override. This adds 3.5K to the code size. All devices in a group must be running firmware with device group support and have device groups enabled.
To enable device groups, set Option85 to 1.
To enable device groups, execute the command SetOption85 1.
## Device Groups Operation
@ -29,17 +29,15 @@ The items that are sent to the group and the items that are received from the gr
<tr>
<td>DevGroupShare
</td>
<td><in>,&lt;out> = set incoming and outgoing shared item mask (default = 0xffffffff,0xffffffff)
<p>
1 = Power, 2 = Light brightness, 4 = Light fade/speed, 8 = Light scheme, 16 = Light color, 32 = Minimum brightness
<td>&lt;in>,&lt;out> = set incoming and outgoing shared item mask (default = 0xffffffff,0xffffffff)<br>
1 = Power, 2 = Light brightness, 4 = Light fade/speed, 8 = Light scheme, 16 = Light color, 32 = Dimmer settings (presets)
</td>
</tr>
<tr>
<td>GroupTopic&lt;x>
</td>
<td>1 = reset device group &lt;x> MQTT group topic to firmware default (MQTT_GRPTOPIC) and restart
<p>
<value> = set device group &lt;x> MQTT group topic (32 chars max) and restart
<td>1 = reset device group &lt;x> MQTT group topic to firmware default (MQTT_GRPTOPIC) and restart<br>
&lt;value> = set device group &lt;x> MQTT group topic (32 chars max) and restart
</td>
</tr>
</table>

View File

@ -11,100 +11,28 @@ To enable PWM dimmer operation, select the PWM Dimmer module.
Pressing and releasing the power button toggles the power on/off. If the toggle turns the power on, the load is returned to the last brightness it was adjusted to. If Fade is enabled, the load is faded on/off at the rate defined by the Speed setting.
When the power is on, holding the down or up button decreases/increases the brightness (PWM value). The brightness is changed faster at higher brightnesses. The DimmerRange command sets the minimum and maximum PWM values. Brightness values (0 through 255) are scaled to dimmerMin through dimmerMax. Typically, dimmerMin would be set to the lowest value at which the lights show visible light and dimmerMax would be set 1023. If you want to increase the lowest brightness level and/or decrease the highest brightness level, set higher dimmerMin and/or lower dimmerMax values.
When the power is on, holding the down or up button decreases/increases the brightness. The brightness can also be changed using just the power button. When the power is on, holding the power button alternately increases or decreases the brightness. Initially, holding the power button increases the brightness. Releasing and then holding the power button again decreases the brightness.
The brightness can also be changed using just the power button. When the power is on, holding the power button alternately increases or decreases the brightness. Initially, holding the power button increases the brightness. Releasing and then holding the power button again decreases the brightness.
When the power is off, pressing and releasing the down or up button turns the power on at a temporary brightness of the low/high levels set by the DimmerPreset command. Turning the power on at the low preset can also be accomplished by holding the power button while the power is off. The dimmer presets are intended to enable quickly turning on a light to a dim or bright level without changing the normal desired brightness. Turning the power on to a preset does not change the brightness the load will be set to when the switch is turned on the next time. For example, if the light is on and you adjust the brightness to 80 and then turn the light off, when you turn it back on, the brightness will return to 80. If you turn the power off again and then press the down button, the light will be turned on with a brightness of the low preset. If you then turn the light off and on again, the brightness will return to 80.
When the power is off, pressing the down or up button turns the power on at a temporary brightness of the low/high levels set by the BriPreset command (default =10,255). Turning the power on at the low preset can also be accomplished by holding the power button while the power is off. The brightness presets are intended to enable quickly turning on a light to a dim or bright level without changing the normal desired brightness. Turning the power on to a preset does not change the brightness the load will be set to when the switch is turned on the next time. For example, if the light is on and you adjust the brightness to 80 and then turn the light off, when you turn it back on, the brightness will return to 80. If you turn the power off again and then press the down button, the light will be turned on with a brightness of the low preset. If you then turn the light off and on again, the brightness will return to 80.
When the power is off, holding the down or up button publishes an MQTT EVENT command. The topic follows the format of the Full Topic with a prefix of Event (ex. cmnd/LightSwitch1/EVENT). The MQTT payload is Trigger#, where # is 1 if the down button is held or 2 if the up button is held. These triggers can be used in rules on remote devices (ON Event#Trigger1) or by automation software to trigger automations such as scene changes. For example, the Event topic Trigger1 payload could trigger the automation software to turn on the previous scene in a list and the Trigger2 payload could trigger the automation software to turn on the next scene in a list.
If there are LEDs defined in the template, they are turned on to indicate the current brightness. More LEDs are turned on at higher brightnesses. The LedTimeout command enables/disables an LED timeout. If LED timeout is enabled, the LEDs turn off five seconds after the last change in brightness. Note that the lowest LED and the blue power LED are always on when the power is on.
If there are LEDs defined in the template, they are turned on to indicate the current brightness. More LEDs are turned on at higher brightnesses. The LedTimeout command enables/disables an LED timeout. If LED timeout is enabled, the LEDs turn off five seconds after the last change in brightness. Note that the lowest LED and the blue power LED are always on when the power is on. The LED timeout can also be enabled/disabled by holding the power button while tapping (pressing and releasing quickly) the down button.
The LEDLink LED can be used as a nightlight/powered-off indicator. The PoweredOffLed command enables/disables turning the LEDLink LED on when the power is off.
The LEDLink LED can be used as a nightlight/powered-off indicator. The PoweredOffLed command enables/disables turning the LEDLink LED on when the power is off. The powered-off indicator can also be enabled/disabled by holding the power button and tapping the up button.
When the power is on, tapping (pressing and releasing quickly) the down or up buttons a given number of times and then holding the down or up button decreases or increases settings according to the table below. For example, tapping the down button once and then holding the up button sets all RGB lights in the device group to the next fixed color. Tapping the up button three times and then holding the down button decreases the high brightness preset.
Holding the power button, tapping the down button and then tapping or holding the down or up button sends a device group message to set RGB lights in the device group to the previous/next fixed color. The command is sent/value is adjusted once every .5 seconds for as long as the button is held. The color sequence as defined by the Light module is red, green, blue, orange, light green, light blue, amber, cyan, purple, yellow, pink, white using RGB channels, white using CT channels.
Holding the power button, tapping the up button and then tapping or holding the down or up button publishes an MQTT Event command. The command is sent/value is adjusted once every .5 seconds for as long as the button is held. The MQTT topic is as described above. The MQTT payload is Trigger#, where # is 3 if the down button is held or 4 if the up button is held.
<table>
<tr>
<td>Taps
</td>
<td>Down Button
</td>
<td>Up Button
</td>
</tr>
<tr>
<td>1
</td>
<td>Set fixed color<sup>1</sup>
</td>
<td>Publish MQTT event<sup>2</sup>
</td>
</tr>
<tr>
<td>2
</td>
<td>Adjust minimum brightness
</td>
<td>Adjust fade speed
</td>
</tr>
<tr>
<td>3
</td>
<td>Adjust low brightness preset
</td>
<td>Adjust high brightness preset
</td>
</tr>
</table>
Holding the down or up button alone for over 10 seconds executes the WiFiConfig 2 command.
Pressing and releasing any button publishes an MQTT TOGGLE command for the button. Holding a button publishes an MQTT HOLD command followed by an MQTT OFF command when the button is released.
1. Setting the previous/next color only functions when remote device mode is enabled (see below) and only when the switch is in a device group with an RGB light. The color sequence as defined by the Light module is red, green, blue, orange, light green, light blue, amber, cyan, purple, yellow, pink, white using RGB channels, white using CT channels.
2. The MQTT topic has the format %group-topic%/cmnd/Event, where %group-topic% is the group topic set by the GroupTopic command. The MQTT payload is SwitchTrigger#, where # is 1 if the down button is held or 2 if the up button is held. These triggers can be used in rules on remote devices (ON Event#SwitchTrigger1) or by automation software to trigger automations such as scene changes. For example, the Event topic SwitchTrigger1 payload could trigger the automation software to turn on the previous scene in a list and the SwitchTrigger2 payload could trigger the automation software to turn on the next scene in a list.
Holding the power button, pressing the down/up buttons a given number of times and then releasing the power button toggles options according to the table below. Note that you must press a down or up button within 0.5 seconds to prevent the power button hold action from taking place.
<table>
<tr>
<td>Presses
</td>
<td>Down Button
</td>
<td>Up Button
</td>
</tr>
<tr>
<td>1
</td>
<td>Toggle powered-off LED
</td>
<td>Toggle brightness LED timeout
</td>
</tr>
<tr>
<td>2
</td>
<td>Toggle fading
</td>
<td>
</td>
</tr>
</table>
Holding any button for over 10 seconds executes the WiFiConfig 2 command.
Pressing and releasing a button publishes an MQTT TOGGLE command. Holding a button publishes an MQTT HOLD command followed by an MQTT OFF command when the button is released.
When Device Groups are enabled, the PWM Dimmer brightness presets, dimmer minimum and maximum values, fade and speed settings are kept in sync across all switches in the group. The powered-off LED and LED timeout settings are specific to each switch. Changing them does not replicate the change to the other switches in the group.
When Device Groups are enabled, the PWM Dimmer brightness presets are kept in sync across all switches in the group. The powered-off LED and LED timeout settings are specific to each switch. Changing them does not replicate the change to the other switches in the group.
### Commands
<table>
<tr>
<td><strong>Command</strong>
@ -121,13 +49,6 @@ When Device Groups are enabled, the PWM Dimmer brightness presets, dimmer minimu
- = decrease brightness preset
</td>
</tr>
<tr>
<td>DimmerRange
</td>
<td>Change dimming range<br>
<dimmerMin>,<DimmerMax> = set minimum and maximum PWM values. Dimmer/brightness is scaled to this range.<br>
</td>
</tr>
<tr>
<td>SetOption86
</td>
@ -162,12 +83,12 @@ Remote device mode allows PWM Dimmer switches to control remote devices. With re
To include remote device mode support in the build, define USE_PWM_DIMMER_REMOTE in your user_config_override. Remote device mode support requires device group support so USE_DEVICE_GROUPS is automatically defined if USE_PWM_DIMMER_REMOTE is defined. Remote device mode support adds 0.7K to the code size in addition to the code size required for device groups support.
To enable remote device mode, set Option88 to 1. Each remote device must be running firmware with device group support and have remote device support enabled. The remote devices do not need to be built with PWM dimmer support nor do they need to be switches.
To enable remote device mode, execute the command SetOption88 1 (the device will restart). Each remote device must be running firmware with device group support and have remote device support enabled. The remote devices do not need to be built with PWM dimmer support nor do they need to be switches.
If a remote device is a PWM dimmer, the device acts like a 3-way dimmer switch would and may or may not have a load connected to it. Its also possible to use a PWM dimmer switch without a load to act as a wall switch to control the power, brightness and color of one or more smart lights with Tasmota with device group support loaded on them.
With remote device mode enabled, button 1 is the power button for the local device while buttons 2 and 3 are the power buttons for remote devices. Group names for buttons 2 and 3 are set by the GroupTopic2 and GroupTopic3 commands respectively. Note that the button numbers are defined by the module template and can be in any physical order on the switch (button 1 can be defined as the top button, the middle button or the bottom button).
With remote device mode is enabled, button 1 is the power button for the local device while buttons 2 and 3 are the power buttons for remote devices. Group names for buttons 2 and 3 are set by the GroupTopic2 and GroupTopic3 commands respectively. Note that the button numbers are defined by the module template and can be in any physical order on the switch (button 1 can be defined as the top button, the middle button or the bottom button). Button combinations that publish MQTT Event commands use a topic in the format cmnd/%group-topic%/EVENT.
Pressing and releasing a power button toggles the power on all devices in the group assigned to the button. When the power is on, holding the button alternately increases or decreases the brightness. When the power is off, holding the button turns the power on at a temporary brightness of the low level set by the BriPreset command (default =10).
Pressing and releasing a power button toggles the power on all devices in the group assigned to the button. When the power is on, holding the button alternately increases or decreases the brightness. When the power is off, holding the button turns the power on at a temporary brightness of the low level set by the BriPreset command.
While holding a power button, the other two buttons act like the down and up buttons for the remote device. All the functions performed by the down and up buttons in non-remote device mode are available in remote device mode. While holding button 1, button 2 performs the functions of the down button and button 3 performs the functions of the up button. While holding button 2, button 1 performs the functions of the down button and button 3 performs the functions of the up button. While holding button 3, button 1 performs the functions of the down button and button 2 performs the functions of the up button.

View File

@ -89,6 +89,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
- Add commands ``SwitchMode 11`` PushHoldMulti and ``SwitchMode 12`` PushHoldInverted (#7603)
- Add commands ``SwitchMode 13`` PushOn and ``SwitchMode 14`` PushOnInverted (#7912)
- Add command ``Buzzer -1`` for infinite mode and command ``Buzzer -2`` for following led mode (#7623)
- Add command ``HumOffset -10.0 .. 10.0`` to set global humidity sensor offset (#7934)
- Add support for ``AdcParam`` parameters to control ADC0 Current Transformer Apparent Power formula by Jodi Dillon (#7100)
- Add optional parameter ``<startcolor>`` to command ``Scheme <scheme>, <startcolor>`` to control initial start color
- Add web page sliders when ``SetOption37 128`` is active allowing control of white(s)
@ -105,6 +106,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
- Add Zigbee features and improvements
- Add Zigbee support for Hue emulation by Stefan Hadinger
- Add HAss Discovery support for Button and Switch triggers by Federico Leoni (#7901)
- Add Dew Point to Temperature and Humidity sensors
- Add optional support for Prometheus using file xsns_91_prometheus.ino (#7216)
- Add support for gzipped binaries
- Add support for Romanian language translations by Augustin Marti
@ -116,6 +118,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
- Add support for FiF LE-01MR energy meter by saper-2 (#7584)
- Add support for Sensors AHT10 and AHT15 by Martin Wagner (#7596)
- Add support for Wemos Motor Shield V1 by Denis Sborets (#7764)
- Add support for La Crosse TX23 Anemometer by Norbert Richter (#3146, #7765)
- Add support for Martin Jerry/acenx/Tessan/NTONPOWER SD0x PWM dimmer switches by Paul Diem (#7791)
- Add support for UDP Group control without MQTT by Paul Diem (#7790)
- Add support for Jarolift rollers by Keeloq algorithm

View File

@ -11,7 +11,9 @@
- Add HAss Discovery support for Button and Switch triggers by Federico Leoni (#7901)
- Add support for HDC1080 Temperature and Humidity sensor by Luis Teixeira (#7888)
- Add commands ``SwitchMode 13`` PushOn and ``SwitchMode 14`` PushOnInverted (#7912)
- Add command ``HumOffset -10.0 .. 10.0`` to set global humidity sensor offset (#7934)
- Add Zigbee support for Hue emulation by Stefan Hadinger
- Add Dew Point to Temperature and Humidity sensors
### 8.1.0.10 20200227
@ -22,6 +24,7 @@
- Add Zigbee features and improvements and remove support for Zigbee commands starting with ``Zigbee...``
- Add support for MaxBotix HRXL-MaxSonar ultrasonic range finders by Jon Little (#7814)
- Add support for Romanian language translations by Augustin Marti
- Add support for La Crosse TX23 Anemometer by Norbert Richter (#3146, #7765)
- Add command ``SetOption89 0/1`` for Zigbee distinct MQTT topics per device for SENSOR, allowing retained messages (#7835)
- Change Hue emulation code optimization

View File

@ -52,6 +52,7 @@
#define D_JSON_CURRENT "Current" // As in Voltage and Current
#define D_JSON_DARKNESS "Darkness"
#define D_JSON_DATA "Data"
#define D_JSON_DEWPOINT "DewPoint"
#define D_JSON_DISTANCE "Distance"
#define D_JSON_DNSSERVER "DNSServer"
#define D_JSON_DONE "Done"
@ -303,6 +304,7 @@
#define D_JSON_FLAG "FLAG"
#define D_JSON_BASE "BASE"
#define D_CMND_TEMPOFFSET "TempOffset"
#define D_CMND_HUMOFFSET "HumOffset"
// Commands xdrv_01_mqtt.ino
#define D_CMND_MQTTLOG "MqttLog"
@ -551,7 +553,6 @@
// Commands xdrv_34_pwm_dimmer.ino
#ifdef USE_PWM_DIMMER
#define D_CMND_BRI_MIN "BriMin"
#define D_CMND_BRI_PRESET "BriPreset"
#endif
@ -631,7 +632,6 @@ const char S_JSON_DRIVER_INDEX_NVALUE[] PROGMEM = "{\"" D_CMND_DRIVE
const char S_JSON_DRIVER_INDEX_SVALUE[] PROGMEM = "{\"" D_CMND_DRIVER "%d\":\"%s\"}";
const char JSON_SNS_TEMP[] PROGMEM = ",\"%s\":{\"" D_JSON_TEMPERATURE "\":%s}";
const char JSON_SNS_TEMPHUM[] PROGMEM = ",\"%s\":{\"" D_JSON_TEMPERATURE "\":%s,\"" D_JSON_HUMIDITY "\":%s}";
const char JSON_SNS_ILLUMINANCE[] PROGMEM = ",\"%s\":{\"" D_JSON_ILLUMINANCE "\":%d}";
const char JSON_SNS_MOISTURE[] PROGMEM = ",\"%s\":{\"" D_JSON_MOISTURE "\":%d}";
@ -668,6 +668,7 @@ const float kSpeedConversionFactor[] = {1, // none
// {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
const char HTTP_SNS_TEMP[] PROGMEM = "{s}%s " D_TEMPERATURE "{m}%s&deg;%c{e}";
const char HTTP_SNS_HUM[] PROGMEM = "{s}%s " D_HUMIDITY "{m}%s%%{e}";
const char HTTP_SNS_DEW[] PROGMEM = "{s}%s " D_DEWPOINT "{m}%s&deg;%c{e}";
const char HTTP_SNS_PRESSURE[] PROGMEM = "{s}%s " D_PRESSURE "{m}%s %s{e}";
const char HTTP_SNS_SEAPRESSURE[] PROGMEM = "{s}%s " D_PRESSUREATSEALEVEL "{m}%s %s{e}";
const char HTTP_SNS_ANALOG[] PROGMEM = "{s}%s " D_ANALOG_INPUT "%d{m}%d{e}";

View File

@ -79,6 +79,7 @@
#define D_DATA "Данни"
#define D_DARKLIGHT "Тъмна"
#define D_DEBUG "Дебъгване"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "Забранен"
#define D_DISTANCE "Разстояние"
#define D_DNS_SERVER "DNS Сървър"
@ -513,12 +514,12 @@
#define D_TX20_WEST "З"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -79,6 +79,7 @@
#define D_DATA "Data"
#define D_DARKLIGHT "Tmavý"
#define D_DEBUG "Debug"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "Zablokováno"
#define D_DISTANCE "Distance"
#define D_DNS_SERVER "Server DNS"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "J"
#define D_TX20_WEST "Z"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -79,6 +79,7 @@
#define D_DATA "Daten"
#define D_DARKLIGHT "dunkel"
#define D_DEBUG "debug"
#define D_DEWPOINT "Taupunkt"
#define D_DISABLED "deaktiviert"
#define D_DISTANCE "Abstand"
#define D_DNS_SERVER "DNS-Server"
@ -512,7 +513,7 @@
#define D_TX20_SOUTH "S"
#define D_TX20_WEST "W"
// xsns_53_sml.ino
// xsns_53_sml.ino
#define D_TPWRIN "Verbrauch"
#define D_TPWROUT "Einspeisung"
#define D_TPWRCURR "Aktueller Verbrauch"

View File

@ -79,6 +79,7 @@
#define D_DATA "Δεδομένα"
#define D_DARKLIGHT "Σκοτεινό"
#define D_DEBUG "Debug"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "Ανενεργό"
#define D_DISTANCE "Απόσταση"
#define D_DNS_SERVER "Διακομιστής DNS"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "Ν"
#define D_TX20_WEST "Δ"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -79,6 +79,7 @@
#define D_DATA "Data"
#define D_DARKLIGHT "Dark"
#define D_DEBUG "Debug"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "Disabled"
#define D_DISTANCE "Distance"
#define D_DNS_SERVER "DNS Server"
@ -512,7 +513,7 @@
#define D_TX20_SOUTH "S"
#define D_TX20_WEST "W"
// xsns_53_sml.ino
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"

View File

@ -79,6 +79,7 @@
#define D_DATA "Datos"
#define D_DARKLIGHT "Oscuro"
#define D_DEBUG "Debug"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "Deshabilitado"
#define D_DISTANCE "Distancia"
#define D_DNS_SERVER "Servidor DNS"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "S"
#define D_TX20_WEST "O"
// xsns_53_sml.ino
#define D_TPWRIN "Total de Entrada"
#define D_TPWROUT "Total de Salida"
#define D_TPWRCURR "Corriente-En/Sal"
#define D_TPWRCURR1 "Corriente-Entr p1"
#define D_TPWRCURR2 "Corriente-Entr p2"
#define D_TPWRCURR3 "Corriente-Entr p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energía Total-Entrada"
#define D_TPWROUT "Energía Total-Salida"
#define D_TPWRCURR "Potencia-En/Sal"
#define D_TPWRCURR1 "Potencia-Entr p1"
#define D_TPWRCURR2 "Potencia-Entr p2"
#define D_TPWRCURR3 "Potencia-Entr p3"
#define D_Strom_L1 "Corriente L1"
#define D_Strom_L2 "Corriente L2"
#define D_Strom_L3 "Corriente L3"
@ -530,7 +531,7 @@
#define D_GasIN "Contador"
#define D_H2oIN "Contador"
#define D_StL1L2L3 "Corriente L1+L2+L3"
#define D_SpL1L2L3 "Voltage L1+L2+L3/3"
#define D_SpL1L2L3 "Voltaje L1+L2+L3/3"
// tasmota_template.h - keep them as short as possible to be able to fit them in GUI drop down box
#define D_SENSOR_NONE "Ninguno"

View File

@ -79,6 +79,7 @@
#define D_DATA "Donnée"
#define D_DARKLIGHT "Sombre"
#define D_DEBUG "Debug"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "Désactivé"
#define D_DISTANCE "Distance"
#define D_DNS_SERVER "Serveur DNS"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "S"
#define D_TX20_WEST "O"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -79,6 +79,7 @@
#define D_DATA "נתונים"
#define D_DARKLIGHT "חושך"
#define D_DEBUG "באגים"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "מבוטל"
#define D_DISTANCE "מרחק"
#define D_DNS_SERVER "DNS שרת"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "S"
#define D_TX20_WEST "W"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -79,6 +79,7 @@
#define D_DATA "Adat"
#define D_DARKLIGHT "Min. fényerő"
#define D_DEBUG "Debug"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "Letiltva"
#define D_DISTANCE "Távolság"
#define D_DNS_SERVER "DNS szerver"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "D"
#define D_TX20_WEST "NY"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -79,6 +79,7 @@
#define D_DATA "Dati"
#define D_DARKLIGHT "Scuro"
#define D_DEBUG "Debug"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "Disabilitato"
#define D_DISTANCE "Distanza"
#define D_DNS_SERVER "DNS Server"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "S"
#define D_TX20_WEST "O"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -79,6 +79,7 @@
#define D_DATA "Data"
#define D_DARKLIGHT "어둡게"
#define D_DEBUG "디버그"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "사용안함"
#define D_DISTANCE "거리"
#define D_DNS_SERVER "DNS 서버"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "S"
#define D_TX20_WEST "W"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -79,6 +79,7 @@
#define D_DATA "Data"
#define D_DARKLIGHT "Donker"
#define D_DEBUG "Debug"
#define D_DEWPOINT "Dauwpunt"
#define D_DISABLED "Uitgeschakeld"
#define D_DISTANCE "Afstand"
#define D_DNS_SERVER "DNS Server"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "S"
#define D_TX20_WEST "W"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -79,6 +79,7 @@
#define D_DATA "Data"
#define D_DARKLIGHT "Ciemny"
#define D_DEBUG "Debug"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "Wyłączony"
#define D_DISTANCE "Odległość"
#define D_DNS_SERVER "Serwer DNS"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "S"
#define D_TX20_WEST "W"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -79,6 +79,7 @@
#define D_DATA "Dados"
#define D_DARKLIGHT "Luz escura"
#define D_DEBUG "Depurar"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "Desabilitado"
#define D_DISTANCE "Distância"
#define D_DNS_SERVER "Servidor DNS"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "S"
#define D_TX20_WEST "O"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -79,6 +79,7 @@
#define D_DATA "Dados"
#define D_DARKLIGHT "Luz Escura"
#define D_DEBUG "Depurar"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "Disabilitado"
#define D_DISTANCE "Distância"
#define D_DNS_SERVER "Servidor DNS"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "S"
#define D_TX20_WEST "O"
//xsns_53_sml.ino
#define D_TPWRIN "Total-Consumo"
#define D_TPWROUT "Total-Geração"
#define D_TPWRCURR "Corrente-Consumo/Geração"
#define D_TPWRCURR1 "Corrente-Consumo F1"
#define D_TPWRCURR2 "Corrente-Consumo F2"
#define D_TPWRCURR3 "Corrente-Consumo F3"
//xsns_53_sml.ino
#define D_TPWRIN "Energia-Consumo"
#define D_TPWROUT "Energia-Geração"
#define D_TPWRCURR "Potência Ativa-Consumo/Geração"
#define D_TPWRCURR1 "Potência Ativa-Consumo F1"
#define D_TPWRCURR2 "Potência Ativa-Consumo F2"
#define D_TPWRCURR3 "Potência Ativa-Consumo F3"
#define D_Strom_L1 "Corrente F1"
#define D_Strom_L2 "Corrente F2"
#define D_Strom_L3 "Corrente F3"
@ -527,8 +528,8 @@
#define D_Spannung_L3 "Tensão F3"
#define D_METERNR "Número_Contador"
#define D_METERSID "ID Serviço"
#define D_GasIN "Contador"
#define D_H2oIN "Contador"
#define D_GasIN "Contagem"
#define D_H2oIN "Contagem"
#define D_StL1L2L3 "Corrente F1+F2+F3"
#define D_SpL1L2L3 "Tensão F1+F2+F3/3"

View File

@ -79,6 +79,7 @@
#define D_DATA "Date"
#define D_DARKLIGHT "Întunecat"
#define D_DEBUG "Depanare"
#define D_DEWPOINT "Punct de rouă"
#define D_DISABLED "Dezactivat"
#define D_DISTANCE "Distanță"
#define D_DNS_SERVER "Server DNS"
@ -86,7 +87,7 @@
#define D_DST_TIME "DST"
#define D_ECO2 "eCO₂"
#define D_EMULATION "Emulație"
#define D_ENABLED "Abilitat"
#define D_ENABLED "Activat"
#define D_ERASE "Șterge"
#define D_ERROR "Eroare"
#define D_FAHRENHEIT "Fahrenheit"
@ -166,7 +167,7 @@
#define D_TRUE "Adevărat"
#define D_TVOC "TVOC"
#define D_UPGRADE "actualizare"
#define D_UPLOAD "Încarcare"
#define D_UPLOAD "Încărcăre"
#define D_UPTIME "Folosință"
#define D_USER "Utilizator"
#define D_UTC_TIME "UTC"
@ -208,12 +209,12 @@
#define D_CONNECTING_TO_AP "Conectare la AP"
#define D_IN_MODE "in mode"
#define D_CONNECT_FAILED_NO_IP_ADDRESS "Conexiune eșuată, lipsă primire adresă IP"
#define D_CONNECT_FAILED_AP_NOT_REACHED "Conexiune eșuată,nu s-a găsit AP"
#define D_CONNECT_FAILED_WRONG_PASSWORD "Conexiune eșuată,parolă greșită AP"
#define D_CONNECT_FAILED_AP_TIMEOUT "Conexiune eșuată,expirare timp AP"
#define D_CONNECT_FAILED_AP_NOT_REACHED "Conexiune eșuată, nu s-a găsit AP"
#define D_CONNECT_FAILED_WRONG_PASSWORD "Conexiune eșuată, parolă greșită AP"
#define D_CONNECT_FAILED_AP_TIMEOUT "Conexiune eșuată, expirare timp AP"
#define D_ATTEMPTING_CONNECTION "Conectare in curs ..."
#define D_CHECKING_CONNECTION "Verificare conexiune..."
#define D_QUERY_DONE "Query terminat. Servicii MQTT găsite"
#define D_QUERY_DONE "Căutare terminată. Servicii MQTT găsite"
#define D_MQTT_SERVICE_FOUND "Servicii MQTT găsite"
#define D_FOUND_AT "Găsite la"
#define D_SYSLOG_HOST_NOT_FOUND "Lipsă gazdă Syslog"
@ -221,11 +222,11 @@
// settings.ino
#define D_SAVED_TO_FLASH_AT "Salvat pe flash la"
#define D_LOADED_FROM_FLASH_AT "Încărcat din flash la"
#define D_USE_DEFAULTS "Folosește setari fabrica"
#define D_USE_DEFAULTS "Folosește setari fabrică"
#define D_ERASED_SECTOR "Sector șters"
// xdrv_02_webserver.ino
#define D_NOSCRIPT "Pentru a folosi Tasmota, vă rugăm abilitați JavaScript"
#define D_NOSCRIPT "Pentru a folosi Tasmota, vă rugăm activați JavaScript"
#define D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "firmware MINIMAL<br>vă rugăm actualizați"
#define D_WEBSERVER_ACTIVE_ON "Server Web activ"
#define D_WITH_IP_ADDRESS "cu adresa IP "
@ -251,9 +252,9 @@
#define D_CONFIGURE_MQTT "Configurare MQTT"
#define D_CONFIGURE_DOMOTICZ "Configurare Domoticz"
#define D_CONFIGURE_LOGGING "Configurare Logging"
#define D_CONFIGURE_OTHER "Altă configurare"
#define D_CONFIGURE_OTHER "Alte configurări"
#define D_CONFIRM_RESET_CONFIGURATION "Confirmă Reset Configurare"
#define D_RESET_CONFIGURATION "Reseteaza Configurare"
#define D_RESET_CONFIGURATION "Resetează Configurare"
#define D_BACKUP_CONFIGURATION "Backup Configurare"
#define D_RESTORE_CONFIGURATION "Restaurează Configurație"
#define D_MAIN_MENU "Meniu Principal"
@ -300,7 +301,7 @@
#define D_TEMPLATE "Template"
#define D_ACTIVATE "Activare"
#define D_WEB_ADMIN_PASSWORD "Parolă Web Admin"
#define D_MQTT_ENABLE "Abilitare MQTT"
#define D_MQTT_ENABLE "Activare MQTT"
#define D_FRIENDLY_NAME "Friendly Name"
#define D_BELKIN_WEMO "Belkin WeMo"
#define D_HUE_BRIDGE "Hue Bridge"
@ -317,18 +318,18 @@
#define D_CONFIGURATION_SAVED "Configurația salvată"
#define D_CONFIGURATION_RESET "Configurația resetată"
#define D_PROGRAM_VERSION "Versiunea Program"
#define D_BUILD_DATE_AND_TIME "Creare Data & Timp"
#define D_CORE_AND_SDK_VERSION "Versiunea Core/SDK"
#define D_PROGRAM_VERSION "Versiune Program"
#define D_BUILD_DATE_AND_TIME "Data & Timp creare"
#define D_CORE_AND_SDK_VERSION "Versiune Core/SDK"
#define D_FLASH_WRITE_COUNT "Spațiu Flash scris"
#define D_MAC_ADDRESS "Adresă MAC"
#define D_MQTT_HOST "Gazdă MQTT"
#define D_MQTT_PORT "Port MQTT"
#define D_MQTT_CLIENT "Client MQTT"
#define D_MQTT_USER "Uilizator MQTT"
#define D_MQTT_TOPIC "Listă MQTT"
#define D_MQTT_GROUP_TOPIC "Listă Grup MQTT"
#define D_MQTT_FULL_TOPIC "Listă Întreagă MQTT"
#define D_MQTT_TOPIC "Subiect MQTT"
#define D_MQTT_GROUP_TOPIC "Subiect Grup MQTT"
#define D_MQTT_FULL_TOPIC "Subiect Întreg MQTT"
#define D_MDNS_DISCOVERY "Descoperă mDNS"
#define D_MDNS_ADVERTISE "Publică mDNS"
#define D_ESP_CHIP_ID "ESP Chip Id"
@ -336,10 +337,10 @@
#define D_FLASH_CHIP_SIZE "Mărime Flash"
#define D_FREE_PROGRAM_SPACE "Spațiu Disponibil Program"
#define D_UPGRADE_BY_WEBSERVER "Actualizat de web server"
#define D_UPGRADE_BY_WEBSERVER "Actualizare prin server web"
#define D_OTA_URL "OTA Url"
#define D_START_UPGRADE "Porneste actualizare"
#define D_UPGRADE_BY_FILE_UPLOAD "Actualizare cu încărcare fișier"
#define D_UPGRADE_BY_FILE_UPLOAD "Actualizare prin încărcare fișier"
#define D_UPLOAD_STARTED "Încărcare începută"
#define D_UPGRADE_STARTED "Actualizare începută"
#define D_UPLOAD_DONE "Încărcare terminată"
@ -348,8 +349,8 @@
#define D_UPLOAD_ERR_3 "Magic byte nu este 0xE9"
#define D_UPLOAD_ERR_4 "Dimensiunea programului este mai mare decât mărimea memoriei"
#define D_UPLOAD_ERR_5 "Încărcare buffer necomparabil"
#define D_UPLOAD_ERR_6 "Încărcare eșuată. Abilitează logging 3"
#define D_UPLOAD_ERR_7 "Încărcare aulată"
#define D_UPLOAD_ERR_6 "Încărcare eșuată. Activează logging 3"
#define D_UPLOAD_ERR_7 "Încărcare anulată"
#define D_UPLOAD_ERR_8 "Fișier invalid"
#define D_UPLOAD_ERR_9 "Fișier prea mare"
#define D_UPLOAD_ERR_10 "Inițiere chip RF eșuată"
@ -360,19 +361,19 @@
#define D_UPLOAD_ERROR_CODE "Încărcare cod eroare"
#define D_ENTER_COMMAND "Introdu comandă"
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Abilitează weblog 2 dacă există răspunsul așteptat"
#define D_ENABLE_WEBLOG_FOR_RESPONSE "Activează weblog 2 dacă există răspunsul așteptat"
#define D_NEED_USER_AND_PASSWORD "Necesită utilizator=<nume utilizator>&parolă=<parolă>"
// xdrv_01_mqtt.ino
#define D_FINGERPRINT "Verifică amprenta TLS..."
#define D_FINGERPRINT "Verificare amprentă TLS..."
#define D_TLS_CONNECT_FAILED_TO "Conexiune TLS eșuată"
#define D_RETRY_IN "Reâncearcă în"
#define D_RETRY_IN "Reîncearcă în"
#define D_VERIFIED "Verificat folosind amprenta"
#define D_INSECURE "Conexiune nesigură din cauza amprentei eșuate"
#define D_CONNECT_FAILED_TO "Eșuare conectare la"
// xplg_wemohue.ino
#define D_MULTICAST_DISABLED "Multicast dezabilitat"
#define D_MULTICAST_DISABLED "Multicast dezactivat"
#define D_MULTICAST_REJOINED "Multicast (re)conectat"
#define D_MULTICAST_JOIN_FAILED "Multicast conectare eșuată"
#define D_FAILED_TO_SEND_RESPONSE "Trimitere răspuns eșuată"
@ -407,12 +408,12 @@
#define D_DOMOTICZ_CURRENT "Curent/PM10"
#define D_DOMOTICZ_AIRQUALITY "Calitatea Aerului"
#define D_DOMOTICZ_P1_SMART_METER "P1SmartMeter"
#define D_DOMOTICZ_UPDATE_TIMER "Actualizare Cronometrare"
#define D_DOMOTICZ_UPDATE_TIMER "Actualizare Temporizare"
// xdrv_09_timers.ino
#define D_CONFIGURE_TIMER "Configurare Cronometrare"
#define D_TIMER_PARAMETERS "Parameteri Cronometrare"
#define D_TIMER_ENABLE "Abilitează Cronometrare"
#define D_CONFIGURE_TIMER "Configurare Temporizare"
#define D_TIMER_PARAMETERS "Parameteri Temporizare"
#define D_TIMER_ENABLE "Activează Temporizare"
#define D_TIMER_ARM "Arm"
#define D_TIMER_TIME "Timp"
#define D_TIMER_DAYS "Zile"
@ -426,7 +427,7 @@
#define D_KNX_GENERAL_CONFIG "General"
#define D_KNX_PHYSICAL_ADDRESS "Adresă fizică"
#define D_KNX_PHYSICAL_ADDRESS_NOTE "(Trebuie să fie unică în rețeaua KNX)"
#define D_KNX_ENABLE "Abilitează KNX"
#define D_KNX_ENABLE "Activează KNX"
#define D_KNX_GROUP_ADDRESS_TO_WRITE "Data de trimis la adresele grupului"
#define D_ADD "Adaugă"
#define D_DELETE "Șterge"
@ -474,7 +475,7 @@
// xsns_07_sht1x.ino
#define D_SENSOR_DID_NOT_ACK_COMMAND "Senzorul nu a primit comanda ACK"
#define D_SHT1X_FOUND " Descoperit SHT1X"
#define D_SHT1X_FOUND "Descoperit SHT1X"
// xsns_18_pms5003.ino
#define D_STANDARD_CONCENTRATION "CF-1 PM" // Standard Particle CF-1 Particle Matter
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "S"
#define D_TX20_WEST "V"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"
@ -741,7 +742,7 @@
#define D_SCRIPT_CHARS_LEFT "caractere rămase"
#define D_SCRIPT_CHARS_NO_MORE "caractere terminate"
#define D_SCRIPT_DOWNLOAD "Descarcă"
#define D_SCRIPT_ENABLE "abilitează script"
#define D_SCRIPT_ENABLE "activează script"
#define D_SCRIPT_UPLOAD "Încarcă"
#define D_SCRIPT_UPLOAD_FILES "Încarcă fișiere"

View File

@ -79,6 +79,7 @@
#define D_DATA "Данные"
#define D_DARKLIGHT "Темный"
#define D_DEBUG "Отладка"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "Блокирован"
#define D_DISTANCE "Distance"
#define D_DNS_SERVER "DNS Сервер"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "S"
#define D_TX20_WEST "W"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -80,6 +80,7 @@
#define D_FLOW_RATE "Flow rate"
#define D_DARKLIGHT "Tmavý"
#define D_DEBUG "Debug"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "Zablokované"
#define D_DISTANCE "Vzdialenosť"
#define D_DNS_SERVER "Server DNS"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "J"
#define D_TX20_WEST "Z"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -79,6 +79,7 @@
#define D_DATA "Data"
#define D_DARKLIGHT "Mörkt"
#define D_DEBUG "Debug"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "Inaktiverad"
#define D_DISTANCE "Distans"
#define D_DNS_SERVER "DNS-server"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "S"
#define D_TX20_WEST "V"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -79,6 +79,7 @@
#define D_DATA "Data"
#define D_DARKLIGHT "Karanlık"
#define D_DEBUG "Hata Ayıklama"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "Etkin Değil"
#define D_DISTANCE "Mesage"
#define D_DNS_SERVER "DNS Sunucu"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "S"
#define D_TX20_WEST "W"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -79,6 +79,7 @@
#define D_DATA "Дані"
#define D_DARKLIGHT "Темний"
#define D_DEBUG "Налагодження"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "Вимкнено"
#define D_DISTANCE "Відстань"
#define D_DNS_SERVER "Сервер DNS"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "Пд"
#define D_TX20_WEST "Зх"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -79,6 +79,7 @@
#define D_DATA "数据:"
#define D_DARKLIGHT "暗"
#define D_DEBUG "调试"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "禁用"
#define D_DISTANCE "距离"
#define D_DNS_SERVER "DNS服务器"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "南"
#define D_TX20_WEST "西"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -79,6 +79,7 @@
#define D_DATA "數據:"
#define D_DARKLIGHT "Dark"
#define D_DEBUG "除錯"
#define D_DEWPOINT "Dew point"
#define D_DISABLED "停用"
#define D_DISTANCE "Distance"
#define D_DNS_SERVER "DNS伺服器"
@ -512,13 +513,13 @@
#define D_TX20_SOUTH "S"
#define D_TX20_WEST "W"
// xsns_53_sml.ino
#define D_TPWRIN "Total-In"
#define D_TPWROUT "Total-Out"
#define D_TPWRCURR "Current-In/Out"
#define D_TPWRCURR1 "Current-In p1"
#define D_TPWRCURR2 "Current-In p2"
#define D_TPWRCURR3 "Current-In p3"
// xsns_53_sml.ino
#define D_TPWRIN "Energy Total-In"
#define D_TPWROUT "Energy Total-Out"
#define D_TPWRCURR "Active Power-In/Out"
#define D_TPWRCURR1 "Active Power-In p1"
#define D_TPWRCURR2 "Active Power-In p2"
#define D_TPWRCURR3 "Active Power-In p3"
#define D_Strom_L1 "Current L1"
#define D_Strom_L2 "Current L2"
#define D_Strom_L3 "Current L3"

View File

@ -417,8 +417,8 @@
// #define EXS_MCU_CMNDS // Add command to send MCU commands (+0k8 code)
//#define USE_HOTPLUG // Add support for sensor HotPlug
#define USE_DEVICE_GROUPS // Add support for device groups (+5k6 code)
#define USE_PWM_DIMMER // Add support for MJ-SD01/acenx/NTONPOWER PWM dimmers (+4k5 code)
#define USE_PWM_DIMMER_REMOTE // Add support for remote switches to PWM Dimmer, also adds device groups support (+0k7 code, also includes device groups)
#define USE_PWM_DIMMER // Add support for MJ-SD01/acenx/NTONPOWER PWM dimmers (+2k5 code)
#define USE_PWM_DIMMER_REMOTE // Add support for remote switches to PWM Dimmer, also adds device groups support (+1k1 code plus device groups size)
//#define USE_KEELOQ // Add support for Jarolift rollers by Keeloq algorithm (+4k5 code)
#define USE_SONOFF_D1 // Add support for Sonoff D1 Dimmer (+0k7 code)

View File

@ -467,8 +467,9 @@ struct SYSCFG {
uint8_t bri_min; // F05
uint8_t bri_preset_low; // F06
uint8_t bri_preset_high; // F07
int8_t hum_comp; // F08
uint8_t free_f08[180]; // F08
uint8_t free_f09[179]; // F09
uint32_t keeloq_master_msb; // FBC
uint32_t keeloq_master_lsb; // FC0

View File

@ -617,10 +617,32 @@ char TempUnit(void)
float ConvertHumidity(float h)
{
float result = h;
global_update = uptime;
global_humidity = h;
return h;
result = result + (0.1 * Settings.hum_comp);
return result;
}
float CalcTempHumToDew(float t, float h)
{
if (isnan(h) || isnan(t)) { return 0.0; }
if (Settings.flag.temperature_conversion) { // SetOption8 - Switch between Celsius or Fahrenheit
t = (t - 32) / 1.8; // Celsius
}
// float gamma = log(h / 100) + 17.62 * t / (243.5 + t);
float gamma = TaylorLog(h / 100) + 17.62 * t / (243.5 + t);
float result = (243.5 * gamma / (17.62 - gamma));
if (Settings.flag.temperature_conversion) { // SetOption8 - Switch between Celsius or Fahrenheit
result = result * 1.8 + 32; // Fahrenheit
}
return result;
}
float ConvertPressure(float p)
@ -1018,6 +1040,18 @@ int ResponseAppendTime(void)
return ResponseAppendTimeFormat(Settings.flag2.time_format);
}
int ResponseAppendTHD(float f_temperature, float f_humidity)
{
char temperature[FLOATSZ];
dtostrfd(f_temperature, Settings.flag2.temperature_resolution, temperature);
char humidity[FLOATSZ];
dtostrfd(f_humidity, Settings.flag2.humidity_resolution, humidity);
char dewpoint[FLOATSZ];
dtostrfd(CalcTempHumToDew(f_temperature, f_humidity), Settings.flag2.temperature_resolution, dewpoint);
return ResponseAppend_P(PSTR("\"" D_JSON_TEMPERATURE "\":%s,\"" D_JSON_HUMIDITY "\":%s,\"" D_JSON_DEWPOINT "\":%s"), temperature, humidity, dewpoint);
}
int ResponseJsonEnd(void)
{
return ResponseAppend_P(PSTR("}"));

View File

@ -26,7 +26,7 @@ const char kTasmotaCommands[] PROGMEM = "|" // No prefix
D_CMND_BUTTONDEBOUNCE "|" D_CMND_SWITCHDEBOUNCE "|" D_CMND_SYSLOG "|" D_CMND_LOGHOST "|" D_CMND_LOGPORT "|" D_CMND_SERIALSEND "|" D_CMND_BAUDRATE "|" D_CMND_SERIALCONFIG "|"
D_CMND_SERIALDELIMITER "|" D_CMND_IPADDRESS "|" D_CMND_NTPSERVER "|" D_CMND_AP "|" D_CMND_SSID "|" D_CMND_PASSWORD "|" D_CMND_HOSTNAME "|" D_CMND_WIFICONFIG "|"
D_CMND_FRIENDLYNAME "|" D_CMND_SWITCHMODE "|" D_CMND_INTERLOCK "|" D_CMND_TELEPERIOD "|" D_CMND_RESET "|" D_CMND_TIME "|" D_CMND_TIMEZONE "|" D_CMND_TIMESTD "|"
D_CMND_TIMEDST "|" D_CMND_ALTITUDE "|" D_CMND_LEDPOWER "|" D_CMND_LEDSTATE "|" D_CMND_LEDMASK "|" D_CMND_WIFIPOWER "|" D_CMND_TEMPOFFSET "|"
D_CMND_TIMEDST "|" D_CMND_ALTITUDE "|" D_CMND_LEDPOWER "|" D_CMND_LEDSTATE "|" D_CMND_LEDMASK "|" D_CMND_WIFIPOWER "|" D_CMND_TEMPOFFSET "|" D_CMND_HUMOFFSET "|"
D_CMND_SPEEDUNIT "|"
#ifdef USE_I2C
D_CMND_I2CSCAN "|" D_CMND_I2CDRIVER "|"
@ -45,7 +45,7 @@ void (* const TasmotaCommand[])(void) PROGMEM = {
&CmndButtonDebounce, &CmndSwitchDebounce, &CmndSyslog, &CmndLoghost, &CmndLogport, &CmndSerialSend, &CmndBaudrate, &CmndSerialConfig,
&CmndSerialDelimiter, &CmndIpAddress, &CmndNtpServer, &CmndAp, &CmndSsid, &CmndPassword, &CmndHostname, &CmndWifiConfig,
&CmndFriendlyname, &CmndSwitchMode, &CmndInterlock, &CmndTeleperiod, &CmndReset, &CmndTime, &CmndTimezone, &CmndTimeStd,
&CmndTimeDst, &CmndAltitude, &CmndLedPower, &CmndLedState, &CmndLedMask, &CmndWifiPower, &CmndTempOffset,
&CmndTimeDst, &CmndAltitude, &CmndLedPower, &CmndLedState, &CmndLedMask, &CmndWifiPower, &CmndTempOffset, &CmndHumOffset,
&CmndSpeedUnit,
#ifdef USE_I2C
&CmndI2cScan, CmndI2cDriver,
@ -77,6 +77,14 @@ void ResponseCmndIdxNumber(int value)
Response_P(S_JSON_COMMAND_INDEX_NVALUE, XdrvMailbox.command, XdrvMailbox.index, value);
}
void ResponseCmndChar_P(const char* value)
{
size_t buf_size = strlen_P(value);
char buf[buf_size + 1];
strcpy_P(buf, value);
Response_P(S_JSON_COMMAND_SVALUE, XdrvMailbox.command, buf);
}
void ResponseCmndChar(const char* value)
{
Response_P(S_JSON_COMMAND_SVALUE, XdrvMailbox.command, value);
@ -538,6 +546,17 @@ void CmndTempOffset(void)
ResponseCmndFloat((float)(Settings.temp_comp) / 10, 1);
}
void CmndHumOffset(void)
{
if (XdrvMailbox.data_len > 0) {
int value = (int)(CharToFloat(XdrvMailbox.data) * 10);
if ((value > -101) && (value < 101)) {
Settings.hum_comp = value;
}
}
ResponseCmndFloat((float)(Settings.hum_comp) / 10, 1);
}
void CmndSleep(void)
{
if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload < 251)) {
@ -602,7 +621,7 @@ void CmndRestart(void)
EspRestart();
break;
default:
ResponseCmndChar(D_JSON_ONE_TO_RESTART);
ResponseCmndChar_P(PSTR(D_JSON_ONE_TO_RESTART));
}
}
@ -783,6 +802,11 @@ void CmndSetoption(void)
}
else if (4 == ptype) { // SetOption82 .. 113
bitWrite(Settings.flag4.data, pindex, XdrvMailbox.payload);
switch (pindex) {
case 6: // SetOption88 - PWM Dimmer Buttons control remote devices
restart_flag = 2;
break;
}
}
} else {
ptype = 99; // Command Error
@ -1054,7 +1078,7 @@ void CmndTemplate(void)
if (JsonTemplate(XdrvMailbox.data)) { // Free 336 bytes StaticJsonBuffer stack space by moving code to function
if (USER_MODULE == Settings.module) { restart_flag = 2; }
} else {
ResponseCmndChar(D_JSON_INVALID_JSON);
ResponseCmndChar_P(PSTR(D_JSON_INVALID_JSON));
error = true;
}
}

View File

@ -111,6 +111,7 @@ bool DeviceGroupItemShared(bool incoming, uint8_t item)
uint8_t mask = 0;
switch (item) {
case DGR_ITEM_LIGHT_BRI:
case DGR_ITEM_BRI_POWER_ON:
mask = DGR_SHARE_LIGHT_BRI;
break;
case DGR_ITEM_POWER:
@ -127,8 +128,9 @@ bool DeviceGroupItemShared(bool incoming, uint8_t item)
case DGR_ITEM_LIGHT_SPEED:
mask = DGR_SHARE_LIGHT_FADE;
break;
case DGR_ITEM_DIMMER_RANGE:
mask = DGR_SHARE_DIMMER_RANGE;
case DGR_ITEM_BRI_PRESET_LOW:
case DGR_ITEM_BRI_PRESET_HIGH:
mask = DGR_SHARE_DIMMER_SETTINGS;
break;
}
return (!mask || ((incoming ? Settings.device_group_share_in : Settings.device_group_share_out) & mask));
@ -544,7 +546,6 @@ void ProcessDeviceGroupMessage(char * packet, int packet_length)
case DGR_ITEM_BRI_POWER_ON:
case DGR_ITEM_POWER:
case DGR_ITEM_LIGHT_CHANNELS:
case DGR_ITEM_DIMMER_RANGE:
break;
default:
AddLog_P2(LOG_LEVEL_ERROR, PSTR("DGR: ********** invalid item=%u received from device group %s member %s"), item, device_group->group_name, IPAddressToString(remote_ip));
@ -590,12 +591,14 @@ void ProcessDeviceGroupMessage(char * packet, int packet_length)
if (DeviceGroupItemShared(true, item)) {
if (item == DGR_ITEM_POWER) {
uint8_t mask_devices = value >> 24;
if (mask_devices > devices_present) mask_devices = devices_present;
for (uint32_t i = 0; i < devices_present; i++) {
uint32_t mask = 1 << i;
bool on = (value & mask);
if (on != (power & mask)) ExecuteCommandPower(i + 1, (on ? POWER_ON : POWER_OFF), SRC_REMOTE);
if (device_group->local) {
uint8_t mask_devices = value >> 24;
if (mask_devices > devices_present) mask_devices = devices_present;
for (uint32_t i = 0; i < devices_present; i++) {
uint32_t mask = 1 << i;
bool on = (value & mask);
if (on != (power & mask)) ExecuteCommandPower(i + 1, (on ? POWER_ON : POWER_OFF), SRC_REMOTE);
}
}
}
else {

View File

@ -641,12 +641,6 @@ void MqttShowState(void)
break;
}
#endif // USE_SONOFF_IFAN
#ifdef USE_PWM_DIMMER
if (PWM_DIMMER == my_module_type) {
ResponseAppend_P(PSTR(",\"" D_CMND_DIMMER "\":%d,\"" D_CMND_FADE "\":\"%s\",\"" D_CMND_SPEED "\":%d"),
Settings.light_dimmer, GetStateText(Settings.light_fade), Settings.light_speed);
}
#endif // USE_PWM_DIMMER
#ifdef USE_LIGHT
}
#endif
@ -673,6 +667,30 @@ void MqttPublishTeleState(void)
#endif // USE_SCRIPT
}
void TempHumDewShow(bool json, bool pass_on, const char *types, float f_temperature, float f_humidity)
{
if (json) {
ResponseAppend_P(PSTR(",\"%s\":{"), types);
ResponseAppendTHD(f_temperature, f_humidity);
ResponseJsonEnd();
#ifdef USE_DOMOTICZ
if (pass_on) {
DomoticzTempHumPressureSensor(f_temperature, f_humidity);
}
#endif // USE_DOMOTICZ
#ifdef USE_KNX
if (pass_on) {
KnxSensor(KNX_TEMPERATURE, f_temperature);
KnxSensor(KNX_HUMIDITY, f_humidity);
}
#endif // USE_KNX
#ifdef USE_WEBSERVER
} else {
WSContentSend_THD(types, f_temperature, f_humidity);
#endif // USE_WEBSERVER
}
}
bool MqttShowSensor(void)
{
ResponseAppendTime();
@ -1478,6 +1496,10 @@ void GpioInit(void)
digitalWrite(pin[GPIO_LEDLNK], ledlnk_inverted);
}
#ifdef USE_PWM_DIMMER
if (PWM_DIMMER == my_module_type && pin[GPIO_REL1] < 99) devices_present--;
#endif // USE_PWM_DIMMER
ButtonInit();
SwitchInit();
#ifdef ROTARY_V1

View File

@ -323,7 +323,7 @@ enum DeviceGroupItem { DGR_ITEM_EOL, DGR_ITEM_STATUS,
DGR_ITEM_LIGHT_CHANNELS };
enum DeviceGroupShareItem { DGR_SHARE_POWER = 1, DGR_SHARE_LIGHT_BRI = 2, DGR_SHARE_LIGHT_FADE = 4, DGR_SHARE_LIGHT_SCHEME = 8,
DGR_SHARE_LIGHT_COLOR = 16, DGR_SHARE_DIMMER_RANGE = 32 };
DGR_SHARE_LIGHT_COLOR = 16, DGR_SHARE_DIMMER_SETTINGS = 32 };
enum CommandSource { SRC_IGNORE, SRC_MQTT, SRC_RESTART, SRC_BUTTON, SRC_SWITCH, SRC_BACKLOG, SRC_SERIAL, SRC_WEBGUI, SRC_WEBCOMMAND, SRC_WEBCONSOLE, SRC_PULSETIMER,
SRC_TIMER, SRC_RULE, SRC_MAXPOWER, SRC_MAXENERGY, SRC_OVERTEMP, SRC_LIGHT, SRC_KNX, SRC_DISPLAY, SRC_WEMO, SRC_HUE, SRC_RETRY, SRC_REMOTE, SRC_SHUTTER,

View File

@ -38,6 +38,7 @@ extern "C" {
void KNX_CB_Action(message_t const &msg, void *arg);
//#endif // USE_KNX
void DomoticzTempHumPressureSensor(float temp, float hum, float baro = -1);
char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, char inbetween = '\0');
extern "C" void custom_crash_callback(struct rst_info * rst_info, uint32_t stack, uint32_t stack_end);

View File

@ -922,6 +922,17 @@ void WSContentSpaceButton(uint32_t title_index)
WSContentButton(title_index);
}
void WSContentSend_THD(const char *types, float f_temperature, float f_humidity)
{
char parameter[FLOATSZ];
dtostrfd(f_temperature, Settings.flag2.temperature_resolution, parameter);
WSContentSend_PD(HTTP_SNS_TEMP, types, parameter, TempUnit());
dtostrfd(f_humidity, Settings.flag2.humidity_resolution, parameter);
WSContentSend_PD(HTTP_SNS_HUM, types, parameter);
dtostrfd(CalcTempHumToDew(f_temperature, f_humidity), Settings.flag2.temperature_resolution, parameter);
WSContentSend_PD(HTTP_SNS_DEW, types, parameter, TempUnit());
}
void WSContentEnd(void)
{
WSContentFlush(); // Flush chunk buffer
@ -1125,17 +1136,6 @@ void HandleRoot(void)
} // Settings.flag3.pwm_multi_channels
}
#endif // USE_LIGHT
#ifdef USE_PWM_DIMMER
if (PWM_DIMMER == my_module_type) {
WSContentSend_P(HTTP_MSG_SLIDER_GRADIENT, // Brightness - Black to White
"c", // c - Unique HTML id
"#000", "#fff", // Black to White
4, // sl4 - Unique range HTML id - Used as source for Saturation begin color
Settings.flag3.slider_dimmer_stay_on, 100, // Range 0/1 to 100%
Settings.light_dimmer,
'd', 0); // d0 - Value id is related to lc("d0", value) and WebGetArg("d0", tmp, sizeof(tmp));
}
#endif // USE_PWM_DIMMER
#ifdef USE_SHUTTER
if (Settings.flag3.shutter_mode) { // SetOption80 - Enable shutter support
for (uint32_t i = 0; i < shutters_present; i++) {

View File

@ -882,7 +882,8 @@ void CmndPublish(void)
void CmndGroupTopic(void)
{
#ifdef USE_DEVICE_GROUPS
uint32_t settings_text_index = (XdrvMailbox.index <= 1 ? SET_MQTT_GRP_TOPIC : SET_MQTT_GRP_TOPIC2 + XdrvMailbox.index - 2);
if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= 4)) {
uint32_t settings_text_index = (XdrvMailbox.index <= 1 ? SET_MQTT_GRP_TOPIC : SET_MQTT_GRP_TOPIC2 + XdrvMailbox.index - 2);
#endif // USE_DEVICE_GROUPS
if (XdrvMailbox.data_len > 0) {
MakeValidMqtt(0, XdrvMailbox.data);
@ -894,7 +895,12 @@ void CmndGroupTopic(void)
#endif // USE_DEVICE_GROUPS
restart_flag = 2;
}
#ifdef USE_DEVICE_GROUPS
ResponseCmndChar(SettingsText(settings_text_index));
}
#else // USE_DEVICE_GROUPS
ResponseCmndChar(SettingsText(SET_MQTT_GRP_TOPIC));
#endif // USE_DEVICE_GROUPS
}
void CmndTopic(void)

View File

@ -545,6 +545,9 @@ class LightStateClass {
#ifdef DEBUG_LIGHT
AddLog_P2(LOG_LEVEL_DEBUG_MORE, "LightStateClass::setBri RGB raw (%d %d %d) HS (%d %d) bri (%d)", _r, _g, _b, _hue, _sat, _briRGB);
#endif
#ifdef USE_PWM_DIMMER
if (PWM_DIMMER == my_module_type) PWMDimmerSetBrightnessLeds(0);
#endif // USE_PWM_DIMMER
}
// changes the RGB brightness alone
@ -1820,9 +1823,13 @@ void LightAnimate(void)
}
// final adjusments for PMW, post-gamma correction
uint16_t min = 1;
#ifdef USE_PWM_DIMMER
if (PWM_DIMMER == my_module_type) min = Settings.dimmer_hw_min;
#endif // USE_PWM_DIMMER
for (uint32_t i = 0; i < LST_MAX; i++) {
// scale from 0..1023 to 0..pwm_range, but keep any non-zero value to at least 1
cur_col_10[i] = (cur_col_10[i] > 0) ? changeUIntScale(cur_col_10[i], 1, 1023, 1, Settings.pwm_range) : 0;
cur_col_10[i] = (cur_col_10[i] > 0) ? changeUIntScale(cur_col_10[i], 1, 1023, min, Settings.pwm_range) : 0;
}
// apply port remapping on both 8 bits and 10 bits versions
@ -1858,6 +1865,10 @@ void LightAnimate(void)
LightSetOutputs(Light.fade_cur_10);
}
}
#ifdef USE_PWM_DIMMER
// If the power is off and the fade is done, turn the relay off.
if (PWM_DIMMER == my_module_type && !Light.power && !Light.fade_running) PWMDimmerSetPower();
#endif // USE_PWM_DIMMER
}
}
@ -2084,20 +2095,35 @@ void calcGammaBulbs(uint16_t cur_col_10[5]) {
#ifdef USE_DEVICE_GROUPS
void LightSendDeviceGroupStatus()
{
uint8_t channels[LST_MAX];
light_state.getChannels(channels);
SendLocalDeviceGroupMessage(DGR_MSGTYP_UPDATE, DGR_ITEM_LIGHT_SCHEME, Settings.light_scheme, DGR_ITEM_LIGHT_CHANNELS, channels,
DGR_ITEM_LIGHT_BRI, (power ? light_state.getBri() : 0));
if (Light.subtype > LST_SINGLE) {
uint8_t channels[LST_MAX];
light_state.getChannels(channels);
SendLocalDeviceGroupMessage(DGR_MSGTYP_PARTIAL_UPDATE, DGR_ITEM_LIGHT_CHANNELS, channels);
}
SendLocalDeviceGroupMessage(DGR_MSGTYP_UPDATE, DGR_ITEM_LIGHT_SCHEME, Settings.light_scheme,
DGR_ITEM_LIGHT_BRI, light_state.getBri());
}
void LightHandleDeviceGroupItem()
{
static bool send_state = false;
static bool restore_power = false;
bool more_to_come;
uint32_t value = XdrvMailbox.payload;
#ifdef USE_PWM_DIMMER_REMOTE
if (XdrvMailbox.index & 0xff00) return; // Ignore updates from other device groups
#endif // USE_PWM_DIMMER_REMOTE
switch (XdrvMailbox.command_code) {
case DGR_ITEM_EOL:
more_to_come = (XdrvMailbox.index & DGR_FLAG_MORE_TO_COME);
if (restore_power && !more_to_come) {
restore_power = false;
Light.power = Light.old_power;
}
LightAnimate();
if (send_state && !(XdrvMailbox.index & DGR_FLAG_MORE_TO_COME)) {
if (send_state && !more_to_come) {
light_controller.saveSettings();
if (Settings.flag3.hass_tele_on_power) { // SetOption59 - Send tele/%topic%/STATE in addition to stat/%topic%/RESULT
MqttPublishTeleState();
@ -2107,7 +2133,7 @@ void LightHandleDeviceGroupItem()
break;
case DGR_ITEM_LIGHT_BRI:
if (light_state.getBri() != value) {
light_controller.changeBri(value);
light_state.setBri(value);
send_state = true;
}
break;
@ -2122,30 +2148,25 @@ void LightHandleDeviceGroupItem()
send_state = true;
break;
case DGR_ITEM_LIGHT_FIXED_COLOR:
{
struct XDRVMAILBOX save_XdrvMailbox;
power_t save_power = Light.power;
if (Light.subtype >= LST_RGBW) {
if (value) {
bool save_decimal_text = Settings.flag.decimal_text;
char str[16];
XdrvMailbox.index = 2;
XdrvMailbox.data_len = sprintf_P(str, PSTR("%u"), value);
XdrvMailbox.data = str;
CmndSupportColor();
LightColorEntry(str, sprintf_P(str, PSTR("%u"), value));
Settings.flag.decimal_text = save_decimal_text;
uint32_t old_bri = light_state.getBri();
light_controller.changeChannels(Light.entry_color);
light_controller.changeBri(old_bri);
Settings.light_scheme = 0;
}
else {
Light.fixed_color_index = 0;
XdrvMailbox.index = 1;
XdrvMailbox.payload = light_state.BriToDimmer(light_state.getBri());
CmndWhite();
light_state.setColorMode(LCM_CT);
}
if (Light.power != save_power) {
XdrvMailbox.index = save_power;
LightSetPower();
if (!restore_power && !Light.power) {
Light.old_power = Light.power;
Light.power = 0xff;
restore_power = true;
}
XdrvMailbox = save_XdrvMailbox;
send_state = true;
}
break;
@ -2536,6 +2557,10 @@ void CmndDimmer(void)
LightPreparePower();
}
}
#if defined(USE_PWM_DIMMER) && defined(USE_DEVICE_GROUPS)
Settings.bri_power_on = light_state.getBri();;
SendLocalDeviceGroupMessage(DGR_MSGTYP_UPDATE, DGR_ITEM_BRI_POWER_ON, Settings.bri_power_on);
#endif // USE_PWM_DIMMER && USE_DEVICE_GROUPS
Light.update = true;
if (skip_light_fade) LightAnimate();
} else {
@ -2544,8 +2569,6 @@ void CmndDimmer(void)
skip_light_fade = false;
}
#endif // USE_LIGHT
#if defined(USE_LIGHT) || defined(USE_PWM_DIMMER)
void CmndDimmerRange(void)
{
// DimmerRange - Show current dimmer range as used by Tuya and PS16DZ Dimmers
@ -2562,15 +2585,10 @@ void CmndDimmerRange(void)
Settings.dimmer_hw_min = parm[1];
Settings.dimmer_hw_max = parm[0];
}
#ifdef USE_DEVICE_GROUPS
SendLocalDeviceGroupMessage(DGR_MSGTYP_UPDATE, DGR_ITEM_DIMMER_RANGE, Settings.dimmer_hw_min | Settings.dimmer_hw_max << 16);
#endif // USE_DEVICE_GROUPS
if (PWM_DIMMER != my_module_type) restart_flag = 2;
}
Response_P(PSTR("{\"" D_CMND_DIMMER_RANGE "\":{\"Min\":%d,\"Max\":%d}}"), Settings.dimmer_hw_min, Settings.dimmer_hw_max);
}
#endif // #if defined(USE_LIGHT) || defined(USE_PWM_DIMMER)
#ifdef USE_LIGHT
void CmndLedTable(void)
{
@ -2613,8 +2631,6 @@ void CmndRgbwwTable(void)
ResponseCmndChar(scolor);
}
#endif // USE_LIGHT
#if defined(USE_LIGHT) || defined(USE_PWM_DIMMER)
void CmndFade(void)
{
// Fade - Show current Fade state
@ -2661,8 +2677,6 @@ void CmndSpeed(void)
}
ResponseCmndNumber(Settings.light_speed);
}
#endif // #if defined(USE_LIGHT) || defined(USE_PWM_DIMMER)
#ifdef USE_LIGHT
void CmndWakeupDuration(void)
{
@ -2695,9 +2709,6 @@ bool Xdrv04(uint8_t function)
bool result = false;
if (FUNC_MODULE_INIT == function) {
#ifdef USE_PWM_DIMMER
if (PWM_DIMMER != my_module_type)
#endif // USE_PWM_DIMMER
return LightModuleInit();
}
else if (light_type) {

View File

@ -258,10 +258,10 @@ void IrRemoteCmndResponse(uint32_t error)
{
switch (error) {
case IE_INVALID_RAWDATA:
ResponseCmndChar(D_JSON_INVALID_RAWDATA);
ResponseCmndChar_P(PSTR(D_JSON_INVALID_RAWDATA));
break;
case IE_INVALID_JSON:
ResponseCmndChar(D_JSON_INVALID_JSON);
ResponseCmndChar_P(PSTR(D_JSON_INVALID_JSON));
break;
case IE_SYNTAX_IRSEND:
Response_P(PSTR("{\"" D_CMND_IRSEND "\":\"" D_JSON_NO " " D_JSON_IR_PROTOCOL ", " D_JSON_IR_BITS " " D_JSON_OR " " D_JSON_IR_DATA "\"}"));

View File

@ -605,10 +605,10 @@ void IrRemoteCmndResponse(uint32_t error)
{
switch (error) {
case IE_INVALID_RAWDATA:
ResponseCmndChar(D_JSON_INVALID_RAWDATA);
ResponseCmndChar_P(PSTR(D_JSON_INVALID_RAWDATA));
break;
case IE_INVALID_JSON:
ResponseCmndChar(D_JSON_INVALID_JSON);
ResponseCmndChar_P(PSTR(D_JSON_INVALID_JSON));
break;
case IE_SYNTAX_IRSEND:
Response_P(PSTR("{\"" D_CMND_IRSEND "\":\"" D_JSON_NO " " D_JSON_IR_BITS " " D_JSON_OR " " D_JSON_IR_DATA "\"}"));

View File

@ -390,9 +390,8 @@ bool DomoticzSendKey(uint8_t key, uint8_t device, uint8_t state, uint8_t svalflg
*
\*********************************************************************************************/
uint8_t DomoticzHumidityState(char *hum)
uint8_t DomoticzHumidityState(float h)
{
uint8_t h = atoi(hum);
return (!h) ? 0 : (h < 40) ? 2 : (h > 70) ? 3 : 1;
}
@ -428,18 +427,25 @@ void DomoticzSensor(uint8_t idx, uint32_t value)
DomoticzSensor(idx, data);
}
void DomoticzTempHumSensor(char *temp, char *hum)
//void DomoticzTempHumPressureSensor(float temp, float hum, float baro = -1);
void DomoticzTempHumPressureSensor(float temp, float hum, float baro)
{
char data[16];
snprintf_P(data, sizeof(data), PSTR("%s;%s;%d"), temp, hum, DomoticzHumidityState(hum));
DomoticzSensor(DZ_TEMP_HUM, data);
}
char temperature[FLOATSZ];
dtostrfd(temp, 2, temperature);
char humidity[FLOATSZ];
dtostrfd(hum, 2, humidity);
void DomoticzTempHumPressureSensor(char *temp, char *hum, char *baro)
{
char data[32];
snprintf_P(data, sizeof(data), PSTR("%s;%s;%d;%s;5"), temp, hum, DomoticzHumidityState(hum), baro);
DomoticzSensor(DZ_TEMP_HUM_BARO, data);
if (baro > -1) {
char pressure[FLOATSZ];
dtostrfd(baro, 2, pressure);
snprintf_P(data, sizeof(data), PSTR("%s;%s;%d;%s;5"), temperature, humidity, DomoticzHumidityState(hum), pressure);
DomoticzSensor(DZ_TEMP_HUM_BARO, data);
} else {
snprintf_P(data, sizeof(data), PSTR("%s;%s;%d"), temperature, humidity, DomoticzHumidityState(hum));
DomoticzSensor(DZ_TEMP_HUM, data);
}
}
void DomoticzSensorPowerEnergy(int power, char *energy)

View File

@ -211,7 +211,7 @@ void HAssAnnounceRelayLight(void)
TryResponseAppend_P(HASS_DISCOVER_RELAY, command_topic, value_template, SettingsText(SET_STATE_TXT1), SettingsText(SET_STATE_TXT2));
TryResponseAppend_P(HASS_DISCOVER_DEVICE_INFO_SHORT, unique_id, ESP.getChipId());
#if defined(USE_LIGHT) || defined(USE_PWM_DIMMER)
#ifdef USE_LIGHT
if (is_light || PWM_DIMMER == my_module_type)
{
char *brightness_command_topic = stemp1;
@ -220,7 +220,6 @@ void HAssAnnounceRelayLight(void)
strncpy_P(stemp3, Settings.flag.not_power_linked ? PSTR("last") : PSTR("brightness"), sizeof(stemp3)); // SetOption20 - Control power in relation to Dimmer/Color/Ct changes
TryResponseAppend_P(HASS_DISCOVER_LIGHT_DIMMER, brightness_command_topic, state_topic, stemp3);
#ifdef USE_LIGHT
if (Light.subtype >= LST_RGB)
{
char *rgb_command_topic = stemp1;
@ -246,9 +245,8 @@ void HAssAnnounceRelayLight(void)
GetTopic_P(color_temp_command_topic, CMND, mqtt_topic, D_CMND_COLORTEMPERATURE);
TryResponseAppend_P(HASS_DISCOVER_LIGHT_CT, color_temp_command_topic, state_topic);
}
#endif // USE_LIGHT
}
#endif // defined(USE_LIGHT) || defined(USE_PWM_DIMMER)
#endif // USE_LIGHT
TryResponseAppend_P(PSTR("}"));
}
MqttPublish(stopic, true);

View File

@ -461,7 +461,7 @@ uint32_t findEchoGeneration(void) {
gen = 1; // if no user-agent, also revert to gen v1
}
AddLog_P2(LOG_LEVEL_DEBUG_MORE, D_LOG_HTTP D_HUE " User-Agent: %s, gen=%d", user_agent.c_str(), gen); // Header collection is set in xdrv_01_webserver.ino, in StartWebserver()
AddLog_P2(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_HTTP D_HUE " User-Agent: %s, gen=%d"), user_agent.c_str(), gen); // Header collection is set in xdrv_01_webserver.ino, in StartWebserver()
return gen;
}
@ -705,8 +705,8 @@ void HueLights(String *path)
uint32_t device_id; // the raw device_id used by Hue emulation
uint8_t maxhue = (devices_present > MAX_HUE_DEVICES) ? MAX_HUE_DEVICES : devices_present;
path->remove(0,path->indexOf("/lights")); // Remove until /lights
if (path->endsWith("/lights")) { // Got /lights
path->remove(0,path->indexOf(F("/lights"))); // Remove until /lights
if (path->endsWith(F("/lights"))) { // Got /lights
response = "{";
bool appending = false;
CheckHue(&response, appending);
@ -718,9 +718,9 @@ void HueLights(String *path)
#endif
response += "}";
}
else if (path->endsWith("/state")) { // Got ID/state
else if (path->endsWith(F("/state"))) { // Got ID/state
path->remove(0,8); // Remove /lights/
path->remove(path->indexOf("/state")); // Remove /state
path->remove(path->indexOf(F("/state"))); // Remove /state
device_id = atoi(path->c_str());
device = DecodeLightId(device_id);
#ifdef USE_ZIGBEE
@ -741,8 +741,8 @@ void HueLights(String *path)
}
}
else if(path->indexOf("/lights/") >= 0) { // Got /lights/ID
AddLog_P2(LOG_LEVEL_DEBUG_MORE, "/lights path=%s", path->c_str());
else if(path->indexOf(F("/lights/")) >= 0) { // Got /lights/ID
AddLog_P2(LOG_LEVEL_DEBUG_MORE, PSTR("/lights path=%s"), path->c_str());
path->remove(0,8); // Remove /lights/
device_id = atoi(path->c_str());
device = DecodeLightId(device_id);

View File

@ -305,6 +305,15 @@ ZBM(ZBS_PERMITJOINREQ_CLOSE, Z_SREQ | Z_ZDO, ZDO_MGMT_PERMIT_JOIN_REQ, 0x02 /* A
ZBM(ZBR_PERMITJOINREQ, Z_SRSP | Z_ZDO, ZDO_MGMT_PERMIT_JOIN_REQ, Z_SUCCESS) // 653600
ZBM(ZBR_PERMITJOIN_AREQ_RSP, Z_AREQ | Z_ZDO, ZDO_MGMT_PERMIT_JOIN_RSP, 0x00, 0x00 /* srcAddr*/, Z_SUCCESS ) // 45B6000000
const char kCheckingDeviceConfiguration[] PROGMEM = D_LOG_ZIGBEE "checking device configuration";
const char kConfigured[] PROGMEM = "Configured, starting coordinator";
const char kStarted[] PROGMEM = "Started";
const char kZigbeeStarted[] PROGMEM = D_LOG_ZIGBEE "Zigbee started";
const char kResetting[] PROGMEM = "Resetting configuration";
const char kZNP12[] PROGMEM = "Only ZNP 1.2 is currently supported";
const char kAbort[] PROGMEM = "Abort";
const char kZigbeeAbort[] PROGMEM = D_LOG_ZIGBEE "Abort";
static const Zigbee_Instruction zb_prog[] PROGMEM = {
ZI_LABEL(0)
ZI_NOOP()
@ -319,7 +328,7 @@ static const Zigbee_Instruction zb_prog[] PROGMEM = {
ZI_SEND(ZBS_RESET) // reboot cc2530 just in case we rebooted ESP8266 but not cc2530
ZI_WAIT_RECV_FUNC(5000, ZBR_RESET, &Z_Reboot) // timeout 5s
ZI_WAIT(100)
ZI_LOG(LOG_LEVEL_DEBUG, D_LOG_ZIGBEE "checking device configuration")
ZI_LOG(LOG_LEVEL_DEBUG, kCheckingDeviceConfiguration)
ZI_SEND(ZBS_ZNPHC) // check value of ZNP Has Configured
ZI_WAIT_RECV(2000, ZBR_ZNPHC)
ZI_SEND(ZBS_VERSION) // check ZNP software version
@ -338,7 +347,7 @@ static const Zigbee_Instruction zb_prog[] PROGMEM = {
// all is good, we can start
ZI_LABEL(ZIGBEE_LABEL_START) // START ZNP App
ZI_MQTT_STATE(ZIGBEE_STATUS_STARTING, "Configured, starting coordinator")
ZI_MQTT_STATE(ZIGBEE_STATUS_STARTING, kConfigured)
ZI_ON_ERROR_GOTO(ZIGBEE_LABEL_ABORT)
// Z_ZDO:startupFromApp
//ZI_LOG(LOG_LEVEL_INFO, D_LOG_ZIGBEE "starting zigbee coordinator")
@ -367,8 +376,8 @@ ZI_SEND(ZBS_STARTUPFROMAPP) // start coordinator
ZI_WAIT_UNTIL(1000, ZBR_PERMITJOIN_AREQ_RSP)
ZI_LABEL(ZIGBEE_LABEL_READY)
ZI_MQTT_STATE(ZIGBEE_STATUS_OK, "Started")
ZI_LOG(LOG_LEVEL_INFO, D_LOG_ZIGBEE "Zigbee started")
ZI_MQTT_STATE(ZIGBEE_STATUS_OK, kStarted)
ZI_LOG(LOG_LEVEL_INFO, kZigbeeStarted)
ZI_CALL(&Z_State_Ready, 1) // Now accept incoming messages
ZI_CALL(&Z_Load_Devices, 0)
ZI_CALL(&Z_Query_Bulbs, 0)
@ -377,7 +386,7 @@ ZI_SEND(ZBS_STARTUPFROMAPP) // start coordinator
ZI_GOTO(ZIGBEE_LABEL_READY)
ZI_LABEL(50) // reformat device
ZI_MQTT_STATE(ZIGBEE_STATUS_RESET_CONF, "Reseting configuration")
ZI_MQTT_STATE(ZIGBEE_STATUS_RESET_CONF, kResetting)
//ZI_LOG(LOG_LEVEL_INFO, D_LOG_ZIGBEE "zigbee bad configuration of device, doing a factory reset")
ZI_ON_ERROR_GOTO(ZIGBEE_LABEL_ABORT)
ZI_SEND(ZBS_FACTRES) // factory reset
@ -410,12 +419,12 @@ ZI_SEND(ZBS_STARTUPFROMAPP) // start coordinator
ZI_GOTO(ZIGBEE_LABEL_START)
ZI_LABEL(ZIGBEE_LABEL_UNSUPPORTED_VERSION)
ZI_MQTT_STATE(ZIGBEE_STATUS_UNSUPPORTED_VERSION, "Only ZNP 1.2 is currently supported")
ZI_MQTT_STATE(ZIGBEE_STATUS_UNSUPPORTED_VERSION, kZNP12)
ZI_GOTO(ZIGBEE_LABEL_ABORT)
ZI_LABEL(ZIGBEE_LABEL_ABORT) // Label 99: abort
ZI_MQTT_STATE(ZIGBEE_STATUS_ABORT, "Abort")
ZI_LOG(LOG_LEVEL_ERROR, D_LOG_ZIGBEE "Abort")
ZI_MQTT_STATE(ZIGBEE_STATUS_ABORT, kAbort)
ZI_LOG(LOG_LEVEL_ERROR, kZigbeeAbort)
ZI_STOP(ZIGBEE_LABEL_ABORT)
};
@ -573,10 +582,15 @@ void ZigbeeStateMachine_Run(void) {
AddLog_P(cur_d8, (char*) cur_ptr1);
break;
case ZGB_INSTR_MQTT_STATE:
{
const char *f_msg = (const char*) cur_ptr1;
char buf[strlen_P(f_msg) + 1];
strcpy_P(buf, f_msg);
Response_P(PSTR("{\"" D_JSON_ZIGBEE_STATE "\":{\"Status\":%d,\"Message\":\"%s\"}}"),
cur_d8, (char*) cur_ptr1);
cur_d8, buf);
MqttPublishPrefixTopic_P(RESULT_OR_TELE, PSTR(D_JSON_ZIGBEE_STATE));
XdrvRulesProcess();
}
break;
case ZGB_INSTR_SEND:
ZigbeeZNPSend((uint8_t*) cur_ptr1, cur_d8 /* len */);

View File

@ -94,9 +94,9 @@ int32_t Z_Reboot(int32_t res, class SBuffer &buf) {
GetTextIndexed(reason_str, sizeof(reason_str), reason, Z_RebootReason);
Response_P(PSTR("{\"" D_JSON_ZIGBEE_STATE "\":{"
"\"Status\":%d,\"Message\":\"%s\",\"RestartReason\":\"%s\""
"\"Status\":%d,\"Message\":\"CC2530 booted\",\"RestartReason\":\"%s\""
",\"MajorRel\":%d,\"MinorRel\":%d}}"),
ZIGBEE_STATUS_BOOT, "CC2530 booted", reason_str,
ZIGBEE_STATUS_BOOT, reason_str,
major_rel, minor_rel);
MqttPublishPrefixTopic_P(RESULT_OR_TELE, PSTR(D_JSON_ZIGBEE_STATE));

View File

@ -271,10 +271,10 @@ void CmndZbReset(void) {
ZigbeeZNPSend(ZIGBEE_FACTORY_RESET, sizeof(ZIGBEE_FACTORY_RESET));
eraseZigbeeDevices();
restart_flag = 2;
ResponseCmndChar(D_JSON_ZIGBEE_CC2530 " " D_JSON_RESET_AND_RESTARTING);
ResponseCmndChar_P(PSTR(D_JSON_ZIGBEE_CC2530 " " D_JSON_RESET_AND_RESTARTING));
break;
default:
ResponseCmndChar(D_JSON_ONE_TO_RESET);
ResponseCmndChar_P(PSTR(D_JSON_ONE_TO_RESET));
}
}
}
@ -425,10 +425,10 @@ void CmndZbSend(void) {
// ZigbeeSend { "devicse":"0x1234", "endpoint":"0x03", "send":{"Power":1} }
// ZigbeeSend { "device":"0x1234", "endpoint":"0x03", "send":{"Color":"1,2"} }
// ZigbeeSend { "device":"0x1234", "endpoint":"0x03", "send":{"Color":"0x1122,0xFFEE"} }
if (zigbee.init_phase) { ResponseCmndChar(D_ZIGBEE_NOT_STARTED); return; }
if (zigbee.init_phase) { ResponseCmndChar_P(PSTR(D_ZIGBEE_NOT_STARTED)); return; }
DynamicJsonBuffer jsonBuf;
JsonObject &json = jsonBuf.parseObject(XdrvMailbox.data);
if (!json.success()) { ResponseCmndChar(D_JSON_INVALID_JSON); return; }
if (!json.success()) { ResponseCmndChar_P(PSTR(D_JSON_INVALID_JSON)); return; }
// params
static char delim[] = ", "; // delimiters for parameters
@ -449,9 +449,9 @@ void CmndZbSend(void) {
const JsonVariant &val_device = getCaseInsensitive(json, PSTR("Device"));
if (nullptr != &val_device) {
device = zigbee_devices.parseDeviceParam(val_device.as<char*>());
if (0xFFFF == device) { ResponseCmndChar("Invalid parameter"); return; }
if (0xFFFF == device) { ResponseCmndChar_P(PSTR("Invalid parameter")); return; }
}
if ((nullptr == &val_device) || (0x0000 == device)) { ResponseCmndChar("Unknown device"); return; }
if ((nullptr == &val_device) || (0x0000 == device)) { ResponseCmndChar_P(PSTR("Unknown device")); return; }
}
const JsonVariant &val_endpoint = getCaseInsensitive(json, PSTR("Endpoint"));
@ -541,7 +541,7 @@ void CmndZbSend(void) {
if ('_' == *data) { clusterSpecific = false; }
data++;
} else {
ResponseCmndChar("Wrong delimiter for payload");
ResponseCmndChar_P(PSTR("Wrong delimiter for payload"));
return;
}
// parse cmd number
@ -571,10 +571,10 @@ void CmndZbBind(void) {
// ZbBind { "device":"0x1234", "endpoint":1, "cluster":6 }
// local endpoint is always 1, IEEE addresses are calculated
if (zigbee.init_phase) { ResponseCmndChar(D_ZIGBEE_NOT_STARTED); return; }
if (zigbee.init_phase) { ResponseCmndChar_P(PSTR(D_ZIGBEE_NOT_STARTED)); return; }
DynamicJsonBuffer jsonBuf;
JsonObject &json = jsonBuf.parseObject(XdrvMailbox.data);
if (!json.success()) { ResponseCmndChar(D_JSON_INVALID_JSON); return; }
if (!json.success()) { ResponseCmndChar_P(PSTR(D_JSON_INVALID_JSON)); return; }
// params
// static char delim[] = ", "; // delimiters for parameters
@ -592,12 +592,12 @@ void CmndZbBind(void) {
const JsonVariant &val_device = getCaseInsensitive(json, PSTR("Device"));
if (nullptr != &val_device) {
srcDevice = zigbee_devices.parseDeviceParam(val_device.as<char*>());
if (0xFFFF == srcDevice) { ResponseCmndChar("Invalid parameter"); return; }
if (0xFFFF == srcDevice) { ResponseCmndChar_P(PSTR("Invalid parameter")); return; }
}
if ((nullptr == &val_device) || (0x0000 == srcDevice)) { ResponseCmndChar("Unknown source device"); return; }
if ((nullptr == &val_device) || (0x0000 == srcDevice)) { ResponseCmndChar_P(PSTR("Unknown source device")); return; }
// check if IEEE address is known
uint64_t srcLongAddr = zigbee_devices.getDeviceLongAddr(srcDevice);
if (0 == srcLongAddr) { ResponseCmndChar("Unknown source IEEE address"); return; }
if (0 == srcLongAddr) { ResponseCmndChar_P(PSTR("Unknown source IEEE address")); return; }
// look for source endpoint
const JsonVariant &val_endpoint = getCaseInsensitive(json, PSTR("Endpoint"));
if (nullptr != &val_endpoint) { endpoint = strToUInt(val_endpoint); }
@ -612,13 +612,13 @@ void CmndZbBind(void) {
const JsonVariant &dst_device = getCaseInsensitive(json, PSTR("ToDevice"));
if (nullptr != &dst_device) {
dstDevice = zigbee_devices.parseDeviceParam(dst_device.as<char*>());
if (0xFFFF == dstDevice) { ResponseCmndChar("Invalid parameter"); return; }
if (0xFFFF == dstDevice) { ResponseCmndChar_P(PSTR("Invalid parameter")); return; }
if (0x0000 == dstDevice) {
dstLongAddr = localIEEEAddr;
} else {
dstLongAddr = zigbee_devices.getDeviceLongAddr(dstDevice);
}
if (0 == dstLongAddr) { ResponseCmndChar("Unknown dest IEEE address"); return; }
if (0 == dstLongAddr) { ResponseCmndChar_P(PSTR("Unknown dest IEEE address")); return; }
const JsonVariant &val_toendpoint = getCaseInsensitive(json, PSTR("ToEndpoint"));
if (nullptr != &val_toendpoint) { toendpoint = strToUInt(val_endpoint); } else { toendpoint = endpoint; }
@ -629,8 +629,8 @@ void CmndZbBind(void) {
if (nullptr != &to_group) { toGroup = strToUInt(to_group); }
// make sure we don't have conflicting parameters
if (toGroup && dstLongAddr) { ResponseCmndChar("Cannot have both \"ToDevice\" and \"ToGroup\""); return; }
if (!toGroup && !dstLongAddr) { ResponseCmndChar("Missing \"ToDevice\" or \"ToGroup\""); return; }
if (toGroup && dstLongAddr) { ResponseCmndChar_P(PSTR("Cannot have both \"ToDevice\" and \"ToGroup\"")); return; }
if (!toGroup && !dstLongAddr) { ResponseCmndChar_P(PSTR("Missing \"ToDevice\" or \"ToGroup\"")); return; }
SBuffer buf(34);
buf.add8(Z_SREQ | Z_ZDO);
@ -659,10 +659,10 @@ void CmndZbProbe(void) {
}
void CmndZbProbeOrPing(boolean probe) {
if (zigbee.init_phase) { ResponseCmndChar(D_ZIGBEE_NOT_STARTED); return; }
if (zigbee.init_phase) { ResponseCmndChar_P(PSTR(D_ZIGBEE_NOT_STARTED)); return; }
uint16_t shortaddr = zigbee_devices.parseDeviceParam(XdrvMailbox.data);
if (0x0000 == shortaddr) { ResponseCmndChar("Unknown device"); return; }
if (0xFFFF == shortaddr) { ResponseCmndChar("Invalid parameter"); return; }
if (0x0000 == shortaddr) { ResponseCmndChar_P(PSTR("Unknown device")); return; }
if (0xFFFF == shortaddr) { ResponseCmndChar_P(PSTR("Invalid parameter")); return; }
// everything is good, we can send the command
Z_SendIEEEAddrReq(shortaddr);
@ -686,7 +686,7 @@ void CmndZbName(void) {
//
// Where <device_id> can be: short_addr, long_addr, device_index, friendly_name
if (zigbee.init_phase) { ResponseCmndChar(D_ZIGBEE_NOT_STARTED); return; }
if (zigbee.init_phase) { ResponseCmndChar_P(PSTR(D_ZIGBEE_NOT_STARTED)); return; }
// check if parameters contain a comma ','
char *p;
@ -694,8 +694,8 @@ void CmndZbName(void) {
// parse first part, <device_id>
uint16_t shortaddr = zigbee_devices.parseDeviceParam(XdrvMailbox.data, true); // in case of short_addr, it must be already registered
if (0x0000 == shortaddr) { ResponseCmndChar("Unknown device"); return; }
if (0xFFFF == shortaddr) { ResponseCmndChar("Invalid parameter"); return; }
if (0x0000 == shortaddr) { ResponseCmndChar_P(PSTR("Unknown device")); return; }
if (0xFFFF == shortaddr) { ResponseCmndChar_P(PSTR("Invalid parameter")); return; }
if (p == nullptr) {
const char * friendlyName = zigbee_devices.getFriendlyName(shortaddr);
@ -715,7 +715,7 @@ void CmndZbModelId(void) {
//
// Where <device_id> can be: short_addr, long_addr, device_index, friendly_name
if (zigbee.init_phase) { ResponseCmndChar(D_ZIGBEE_NOT_STARTED); return; }
if (zigbee.init_phase) { ResponseCmndChar_P(PSTR(D_ZIGBEE_NOT_STARTED)); return; }
// check if parameters contain a comma ','
char *p;
@ -723,8 +723,8 @@ void CmndZbModelId(void) {
// parse first part, <device_id>
uint16_t shortaddr = zigbee_devices.parseDeviceParam(XdrvMailbox.data, true); // in case of short_addr, it must be already registered
if (0x0000 == shortaddr) { ResponseCmndChar("Unknown device"); return; }
if (0xFFFF == shortaddr) { ResponseCmndChar("Invalid parameter"); return; }
if (0x0000 == shortaddr) { ResponseCmndChar_P(PSTR("Unknown device")); return; }
if (0xFFFF == shortaddr) { ResponseCmndChar_P(PSTR("Invalid parameter")); return; }
if (p == nullptr) {
const char * modelId = zigbee_devices.getModelId(shortaddr);
@ -743,7 +743,7 @@ void CmndZbLight(void) {
//
// Where <device_id> can be: short_addr, long_addr, device_index, friendly_name
if (zigbee.init_phase) { ResponseCmndChar(D_ZIGBEE_NOT_STARTED); return; }
if (zigbee.init_phase) { ResponseCmndChar_P(PSTR(D_ZIGBEE_NOT_STARTED)); return; }
// check if parameters contain a comma ','
char *p;
@ -751,8 +751,8 @@ void CmndZbLight(void) {
// parse first part, <device_id>
uint16_t shortaddr = zigbee_devices.parseDeviceParam(XdrvMailbox.data, true); // in case of short_addr, it must be already registered
if (0x0000 == shortaddr) { ResponseCmndChar("Unknown device"); return; }
if (0xFFFF == shortaddr) { ResponseCmndChar("Invalid parameter"); return; }
if (0x0000 == shortaddr) { ResponseCmndChar_P(PSTR("Unknown device")); return; }
if (0xFFFF == shortaddr) { ResponseCmndChar_P(PSTR("Invalid parameter")); return; }
if (p) {
int8_t bulbtype = strtol(p, nullptr, 10);
@ -768,22 +768,22 @@ void CmndZbLight(void) {
// Remove an old Zigbee device from the list of known devices, use ZigbeeStatus to know all registered devices
void CmndZbForget(void) {
if (zigbee.init_phase) { ResponseCmndChar(D_ZIGBEE_NOT_STARTED); return; }
if (zigbee.init_phase) { ResponseCmndChar_P(PSTR(D_ZIGBEE_NOT_STARTED)); return; }
uint16_t shortaddr = zigbee_devices.parseDeviceParam(XdrvMailbox.data);
if (0x0000 == shortaddr) { ResponseCmndChar("Unknown device"); return; }
if (0xFFFF == shortaddr) { ResponseCmndChar("Invalid parameter"); return; }
if (0x0000 == shortaddr) { ResponseCmndChar_P(PSTR("Unknown device")); return; }
if (0xFFFF == shortaddr) { ResponseCmndChar_P(PSTR("Invalid parameter")); return; }
// everything is good, we can send the command
if (zigbee_devices.removeDevice(shortaddr)) {
ResponseCmndDone();
} else {
ResponseCmndChar("Unknown device");
ResponseCmndChar_P(PSTR("Unknown device"));
}
}
// Save Zigbee information to flash
void CmndZbSave(void) {
if (zigbee.init_phase) { ResponseCmndChar(D_ZIGBEE_NOT_STARTED); return; }
if (zigbee.init_phase) { ResponseCmndChar_P(PSTR(D_ZIGBEE_NOT_STARTED)); return; }
saveZigbeeDevices();
@ -795,10 +795,10 @@ void CmndZbRead(void) {
// ZigbeeRead {"Device":"0xF289","Cluster":0,"Endpoint":3,"Attr":5}
// ZigbeeRead {"Device":"0xF289","Cluster":"0x0000","Endpoint":"0x0003","Attr":"0x0005"}
// ZigbeeRead {"Device":"0xF289","Cluster":0,"Endpoint":3,"Attr":[5,6,7,4]}
if (zigbee.init_phase) { ResponseCmndChar(D_ZIGBEE_NOT_STARTED); return; }
if (zigbee.init_phase) { ResponseCmndChar_P(PSTR(D_ZIGBEE_NOT_STARTED)); return; }
DynamicJsonBuffer jsonBuf;
JsonObject &json = jsonBuf.parseObject(XdrvMailbox.data);
if (!json.success()) { ResponseCmndChar(D_JSON_INVALID_JSON); return; }
if (!json.success()) { ResponseCmndChar_P(PSTR(D_JSON_INVALID_JSON)); return; }
// params
uint16_t device = 0xFFFF; // 0xFFFF is braodcast, so considered valid
@ -814,9 +814,9 @@ void CmndZbRead(void) {
const JsonVariant &val_device = getCaseInsensitive(json, PSTR("Device"));
if (nullptr != &val_device) {
device = zigbee_devices.parseDeviceParam(val_device.as<char*>());
if (0xFFFF == device) { ResponseCmndChar("Invalid parameter"); return; }
if (0xFFFF == device) { ResponseCmndChar_P(PSTR("Invalid parameter")); return; }
}
if ((nullptr == &val_device) || (0x0000 == device)) { ResponseCmndChar("Unknown device"); return; }
if ((nullptr == &val_device) || (0x0000 == device)) { ResponseCmndChar_P(PSTR("Unknown device")); return; }
}
const JsonVariant &val_cluster = getCaseInsensitive(json, PSTR("Cluster"));
@ -858,7 +858,7 @@ void CmndZbRead(void) {
ZigbeeZCLSend_Raw(device, groupaddr, cluster, endpoint, ZCL_READ_ATTRIBUTES, false, attrs, attrs_len, true /* we do want a response */, zigbee_devices.getNextSeqNumber(device));
ResponseCmndDone();
} else {
ResponseCmndChar("Missing parameters");
ResponseCmndChar_P(PSTR("Missing parameters"));
}
if (attrs) { delete[] attrs; }
@ -866,7 +866,7 @@ void CmndZbRead(void) {
// Allow or Deny pairing of new Zigbee devices
void CmndZbPermitJoin(void) {
if (zigbee.init_phase) { ResponseCmndChar(D_ZIGBEE_NOT_STARTED); return; }
if (zigbee.init_phase) { ResponseCmndChar_P(PSTR(D_ZIGBEE_NOT_STARTED)); return; }
uint32_t payload = XdrvMailbox.payload;
uint16_t dstAddr = 0xFFFC; // default addr
uint8_t duration = 60; // default 60s
@ -892,11 +892,11 @@ void CmndZbPermitJoin(void) {
void CmndZbStatus(void) {
if (ZigbeeSerial) {
if (zigbee.init_phase) { ResponseCmndChar(D_ZIGBEE_NOT_STARTED); return; }
if (zigbee.init_phase) { ResponseCmndChar_P(PSTR(D_ZIGBEE_NOT_STARTED)); return; }
uint16_t shortaddr = zigbee_devices.parseDeviceParam(XdrvMailbox.data);
if (0xFFFF == shortaddr) { ResponseCmndChar("Invalid parameter"); return; }
if (0xFFFF == shortaddr) { ResponseCmndChar_P(PSTR("Invalid parameter")); return; }
if (XdrvMailbox.payload > 0) {
if (0x0000 == shortaddr) { ResponseCmndChar("Unknown device"); return; }
if (0x0000 == shortaddr) { ResponseCmndChar_P(PSTR("Unknown device")); return; }
}
String dump = zigbee_devices.dump(XdrvMailbox.index, shortaddr);

File diff suppressed because it is too large Load Diff

View File

@ -115,17 +115,13 @@ void SonoffScShow(bool json)
float t = ConvertTemp(sc_value[1]);
float h = ConvertHumidity(sc_value[0]);
char temperature[33];
dtostrfd(t, Settings.flag2.temperature_resolution, temperature);
char humidity[33];
dtostrfd(h, Settings.flag2.humidity_resolution, humidity);
if (json) {
ResponseAppend_P(PSTR(",\"SonoffSC\":{\"" D_JSON_TEMPERATURE "\":%s,\"" D_JSON_HUMIDITY "\":%s,\"" D_JSON_LIGHT "\":%d,\"" D_JSON_NOISE "\":%d,\"" D_JSON_AIRQUALITY "\":%d}"),
temperature, humidity, sc_value[2], sc_value[3], sc_value[4]);
ResponseAppend_P(PSTR(",\"SonoffSC\":{"));
ResponseAppendTHD(t, h);
ResponseAppend_P(PSTR(",\"" D_JSON_LIGHT "\":%d,\"" D_JSON_NOISE "\":%d,\"" D_JSON_AIRQUALITY "\":%d}"), sc_value[2], sc_value[3], sc_value[4]);
#ifdef USE_DOMOTICZ
if (0 == tele_period) {
DomoticzTempHumSensor(temperature, humidity);
DomoticzTempHumPressureSensor(t, h);
DomoticzSensor(DZ_ILLUMINANCE, sc_value[2]);
DomoticzSensor(DZ_COUNT, sc_value[3]);
DomoticzSensor(DZ_AIRQUALITY, 500 + ((100 - sc_value[4]) * 20));
@ -141,8 +137,7 @@ void SonoffScShow(bool json)
#ifdef USE_WEBSERVER
} else {
WSContentSend_PD(HTTP_SNS_TEMP, "", temperature, TempUnit());
WSContentSend_PD(HTTP_SNS_HUM, "", humidity);
WSContentSend_THD("", t, h);
WSContentSend_PD(HTTP_SNS_SCPLUS, sc_value[2], sc_value[3], sc_value[4]);
#endif // USE_WEBSERVER
}

View File

@ -244,30 +244,7 @@ void DhtEverySecond(void)
void DhtShow(bool json)
{
for (uint32_t i = 0; i < dht_sensors; i++) {
char temperature[33];
dtostrfd(Dht[i].t, Settings.flag2.temperature_resolution, temperature);
char humidity[33];
dtostrfd(Dht[i].h, Settings.flag2.humidity_resolution, humidity);
if (json) {
ResponseAppend_P(JSON_SNS_TEMPHUM, Dht[i].stype, temperature, humidity);
#ifdef USE_DOMOTICZ
if ((0 == tele_period) && (0 == i)) {
DomoticzTempHumSensor(temperature, humidity);
}
#endif // USE_DOMOTICZ
#ifdef USE_KNX
if ((0 == tele_period) && (0 == i)) {
KnxSensor(KNX_TEMPERATURE, Dht[i].t);
KnxSensor(KNX_HUMIDITY, Dht[i].h);
}
#endif // USE_KNX
#ifdef USE_WEBSERVER
} else {
WSContentSend_PD(HTTP_SNS_TEMP, Dht[i].stype, temperature, TempUnit());
WSContentSend_PD(HTTP_SNS_HUM, Dht[i].stype, humidity);
#endif // USE_WEBSERVER
}
TempHumDewShow(json, ((0 == tele_period) && (0 == i)), Dht[i].stype, Dht[i].t, Dht[i].h);
}
}

View File

@ -183,30 +183,7 @@ void ShtEverySecond(void)
void ShtShow(bool json)
{
if (sht_valid) {
char temperature[33];
dtostrfd(sht_temperature, Settings.flag2.temperature_resolution, temperature);
char humidity[33];
dtostrfd(sht_humidity, Settings.flag2.humidity_resolution, humidity);
if (json) {
ResponseAppend_P(JSON_SNS_TEMPHUM, sht_types, temperature, humidity);
#ifdef USE_DOMOTICZ
if (0 == tele_period) {
DomoticzTempHumSensor(temperature, humidity);
}
#endif // USE_DOMOTICZ
#ifdef USE_KNX
if (0 == tele_period) {
KnxSensor(KNX_TEMPERATURE, sht_temperature);
KnxSensor(KNX_HUMIDITY, sht_humidity);
}
#endif // USE_KNX
#ifdef USE_WEBSERVER
} else {
WSContentSend_PD(HTTP_SNS_TEMP, sht_types, temperature, TempUnit());
WSContentSend_PD(HTTP_SNS_HUM, sht_types, humidity);
#endif // USE_WEBSERVER
}
TempHumDewShow(json, (0 == tele_period), sht_types, sht_temperature, sht_humidity);
}
}

View File

@ -241,30 +241,7 @@ void HtuEverySecond(void)
void HtuShow(bool json)
{
if (htu_valid) {
char temperature[33];
dtostrfd(htu_temperature, Settings.flag2.temperature_resolution, temperature);
char humidity[33];
dtostrfd(htu_humidity, Settings.flag2.humidity_resolution, humidity);
if (json) {
ResponseAppend_P(JSON_SNS_TEMPHUM, htu_types, temperature, humidity);
#ifdef USE_DOMOTICZ
if (0 == tele_period) {
DomoticzTempHumSensor(temperature, humidity);
}
#endif // USE_DOMOTICZ
#ifdef USE_KNX
if (0 == tele_period) {
KnxSensor(KNX_TEMPERATURE, htu_temperature);
KnxSensor(KNX_HUMIDITY, htu_humidity);
}
#endif // USE_KNX
#ifdef USE_WEBSERVER
} else {
WSContentSend_PD(HTTP_SNS_TEMP, htu_types, temperature, TempUnit());
WSContentSend_PD(HTTP_SNS_HUM, htu_types, humidity);
#endif // USE_WEBSERVER
}
TempHumDewShow(json, (0 == tele_period), htu_types, htu_temperature, htu_humidity);
}
}

View File

@ -541,14 +541,17 @@ void BmpShow(bool json)
dtostrfd(bmp_sealevel, Settings.flag2.pressure_resolution, sea_pressure);
char humidity[33];
dtostrfd(bmp_sensors[bmp_idx].bmp_humidity, Settings.flag2.humidity_resolution, humidity);
float f_dewpoint = CalcTempHumToDew(bmp_temperature, bmp_sensors[bmp_idx].bmp_humidity);
char dewpoint[33];
dtostrfd(f_dewpoint, Settings.flag2.temperature_resolution, dewpoint);
#ifdef USE_BME680
char gas_resistance[33];
dtostrfd(bmp_sensors[bmp_idx].bmp_gas_resistance, 2, gas_resistance);
#endif // USE_BME680
if (json) {
char json_humidity[40];
snprintf_P(json_humidity, sizeof(json_humidity), PSTR(",\"" D_JSON_HUMIDITY "\":%s"), humidity);
char json_humidity[80];
snprintf_P(json_humidity, sizeof(json_humidity), PSTR(",\"" D_JSON_HUMIDITY "\":%s,\"" D_JSON_DEWPOINT "\":%s"), humidity, dewpoint);
char json_sealevel[40];
snprintf_P(json_sealevel, sizeof(json_sealevel), PSTR(",\"" D_JSON_PRESSUREATSEALEVEL "\":%s"), sea_pressure);
#ifdef USE_BME680
@ -569,7 +572,7 @@ void BmpShow(bool json)
#ifdef USE_DOMOTICZ
if ((0 == tele_period) && (0 == bmp_idx)) { // We want the same first sensor to report to Domoticz in case a read is missed
DomoticzTempHumPressureSensor(temperature, humidity, pressure);
DomoticzTempHumPressureSensor(bmp_temperature, bmp_sensors[bmp_idx].bmp_humidity, bmp_pressure);
#ifdef USE_BME680
if (bmp_sensors[bmp_idx].bmp_model >= 3) { DomoticzSensor(DZ_AIRQUALITY, (uint32_t)bmp_sensors[bmp_idx].bmp_gas_resistance); }
#endif // USE_BME680
@ -588,6 +591,7 @@ void BmpShow(bool json)
WSContentSend_PD(HTTP_SNS_TEMP, name, temperature, TempUnit());
if (bmp_sensors[bmp_idx].bmp_model >= 2) {
WSContentSend_PD(HTTP_SNS_HUM, name, humidity);
WSContentSend_PD(HTTP_SNS_DEW, name, dewpoint, TempUnit());
}
WSContentSend_PD(HTTP_SNS_PRESSURE, name, pressure, PressureUnit().c_str());
if (Settings.altitude != 0) {

View File

@ -98,34 +98,9 @@ void Sht3xShow(bool json)
float t;
float h;
if (Sht3xRead(t, h, sht3x_sensors[i].address)) {
char temperature[33];
dtostrfd(t, Settings.flag2.temperature_resolution, temperature);
char humidity[33];
dtostrfd(h, Settings.flag2.humidity_resolution, humidity);
char types[11];
snprintf_P(types, sizeof(types), PSTR("%s%c0x%02X"), sht3x_sensors[i].types, IndexSeparator(), sht3x_sensors[i].address); // "SHT3X-0xXX"
if (json) {
ResponseAppend_P(JSON_SNS_TEMPHUM, types, temperature, humidity);
#ifdef USE_DOMOTICZ
if ((0 == tele_period) && (0 == i)) { // We want the same first sensor to report to Domoticz in case a read is missed
DomoticzTempHumSensor(temperature, humidity);
}
#endif // USE_DOMOTICZ
#ifdef USE_KNX
if (0 == tele_period) {
KnxSensor(KNX_TEMPERATURE, t);
KnxSensor(KNX_HUMIDITY, h);
}
#endif // USE_KNX
#ifdef USE_WEBSERVER
} else {
WSContentSend_PD(HTTP_SNS_TEMP, types, temperature, TempUnit());
WSContentSend_PD(HTTP_SNS_HUM, types, humidity);
#endif // USE_WEBSERVER
}
TempHumDewShow(json, ((0 == tele_period) && (0 == i)), types, t, h);
}
}
}

View File

@ -142,27 +142,25 @@ void SenseairInit(void)
void SenseairShow(bool json)
{
char temperature[33];
dtostrfd(senseair_temperature, Settings.flag2.temperature_resolution, temperature);
char humidity[33];
dtostrfd(senseair_humidity, Settings.flag2.temperature_resolution, humidity);
GetTextIndexed(senseair_types, sizeof(senseair_types), senseair_type -1, kSenseairTypes);
if (json) {
ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_CO2 "\":%d"), senseair_types, senseair_co2);
if (senseair_type != 2) {
ResponseAppend_P(PSTR(",\"" D_JSON_TEMPERATURE "\":%s,\"" D_JSON_HUMIDITY "\":%s"), temperature, humidity);
ResponseAppend_P(PSTR(","));
ResponseAppendTHD(senseair_temperature, senseair_humidity);
}
ResponseJsonEnd();
#ifdef USE_DOMOTICZ
if (0 == tele_period) DomoticzSensor(DZ_AIRQUALITY, senseair_co2);
if (0 == tele_period) {
DomoticzSensor(DZ_AIRQUALITY, senseair_co2);
}
#endif // USE_DOMOTICZ
#ifdef USE_WEBSERVER
} else {
WSContentSend_PD(HTTP_SNS_CO2, senseair_types, senseair_co2);
if (senseair_type != 2) {
WSContentSend_PD(HTTP_SNS_TEMP, senseair_types, temperature, TempUnit());
WSContentSend_PD(HTTP_SNS_HUM, senseair_types, humidity);
WSContentSend_THD(senseair_types, senseair_temperature, senseair_humidity);
}
#endif // USE_WEBSERVER
}

View File

@ -237,7 +237,11 @@ void TX2xStartRead(void)
// check checksum, start frame,non-inverted==inverted values and max. speed
;
#ifdef USE_TX23_WIND_SENSOR
if ((chk == tx2x_sd) && (0x1b==tx2x_sa) && (tx2x_sb==tx2x_se) && (tx2x_sc==tx2x_sf) && (tx2x_sc < 511)) {
#else
if ((chk == tx2x_sd) && (tx2x_sb==tx2x_se) && (tx2x_sc==tx2x_sf) && (tx2x_sc < 511)) {
#endif
tx2x_last_available = uptime;
// Wind speed spec: 0 to 180 km/h (0 to 50 m/s)
tx2x_wind_speed = tx2x_sc;

View File

@ -311,17 +311,15 @@ void RfSnsTheoV2Show(bool json)
} else {
float temp = ConvertTemp((float)rfsns_theo_v2_t2[i].temp / 100);
float humi = ConvertHumidity((float)rfsns_theo_v2_t2[i].hum / 100);
char temperature[33];
dtostrfd(temp, Settings.flag2.temperature_resolution, temperature);
char humidity[33];
dtostrfd(humi, Settings.flag2.humidity_resolution, humidity);
if (json) {
ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_TEMPERATURE "\":%s,\"" D_JSON_HUMIDITY "\":%s,\"" D_JSON_VOLTAGE "\":%s}"),
sensor, temperature, humidity, voltage);
ResponseAppend_P(PSTR(",\"%s\":{"), sensor);
ResponseAppendTHD(temp, humi);
ResponseAppend_P(PSTR(",\"" D_JSON_VOLTAGE "\":%s}"), voltage);
if ((0 == tele_period) && !sensor_once) {
#ifdef USE_DOMOTICZ
DomoticzTempHumSensor(temperature, humidity); //
DomoticzTempHumPressureSensor(temp, humi); //
#endif // USE_DOMOTICZ
#ifdef USE_KNX
KnxSensor(KNX_TEMPERATURE, temp);
@ -331,8 +329,7 @@ void RfSnsTheoV2Show(bool json)
}
#ifdef USE_WEBSERVER
} else {
WSContentSend_PD(HTTP_SNS_TEMP, sensor, temperature, TempUnit());
WSContentSend_PD(HTTP_SNS_HUM, sensor, humidity);
WSContentSend_THD(sensor, temp, humi);
#endif // USE_WEBSERVER
}
}
@ -556,11 +553,8 @@ void RfSnsAlectoV2Show(bool json)
}
} else {
float temp = ConvertTemp(rfsns_alecto_v2->temp);
char temperature[33];
dtostrfd(temp, Settings.flag2.temperature_resolution, temperature);
float humi = ConvertHumidity((float)rfsns_alecto_v2->humi);
char humidity[33];
dtostrfd(humi, Settings.flag2.humidity_resolution, humidity);
char rain[33];
dtostrfd(rfsns_alecto_v2->rain, 2, rain);
char wind[33];
@ -575,8 +569,10 @@ void RfSnsAlectoV2Show(bool json)
}
if (json) {
ResponseAppend_P(PSTR(",\"" D_ALECTOV2 "\":{\"" D_JSON_TEMPERATURE "\":%s,\"" D_JSON_HUMIDITY "\":%s,\"Rain\":%s,\"Wind\":%s,\"Gust\":%s%s}"),
temperature, humidity, rain, wind, gust, (rfsns_alecto_v2->type) ? direction : "");
ResponseAppend_P(PSTR(",\"" D_ALECTOV2 "\":{"));
ResponseAppendTHD(temp, humi);
ResponseAppend_P(PSTR(",\"Rain\":%s,\"Wind\":%s,\"Gust\":%s%s}"), rain, wind, gust, (rfsns_alecto_v2->type) ? direction : "");
if (0 == tele_period) {
#ifdef USE_DOMOTICZ
// Use a rules to send data to Domoticz where also a local BMP280 is connected:
@ -587,8 +583,7 @@ void RfSnsAlectoV2Show(bool json)
}
#ifdef USE_WEBSERVER
} else {
WSContentSend_PD(HTTP_SNS_TEMP, D_ALECTOV2, temperature, TempUnit());
WSContentSend_PD(HTTP_SNS_HUM, D_ALECTOV2, humidity);
WSContentSend_THD(D_ALECTOV2, temp, humi);
WSContentSend_PD(HTTP_SNS_ALECTOV2, rain, wind, gust);
if (rfsns_alecto_v2->type) {
WSContentSend_PD(HTTP_SNS_ALECTOV2_WDIR, wdir);

View File

@ -276,21 +276,17 @@ void AzInit(void)
void AzShow(bool json)
{
char temperature[33];
dtostrfd(az_temperature, Settings.flag2.temperature_resolution, temperature);
char humidity[33];
dtostrfd(az_humidity, Settings.flag2.humidity_resolution, humidity);
if (json) {
ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_CO2 "\":%d,\"" D_JSON_TEMPERATURE "\":%s,\"" D_JSON_HUMIDITY "\":%s}"), ktype, az_co2, temperature, humidity);
ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_CO2 "\":%d,"), ktype, az_co2);
ResponseAppendTHD(az_temperature, az_humidity);
ResponseJsonEnd();
#ifdef USE_DOMOTICZ
if (0 == tele_period) DomoticzSensor(DZ_AIRQUALITY, az_co2);
#endif // USE_DOMOTICZ
#ifdef USE_WEBSERVER
} else {
WSContentSend_PD(HTTP_SNS_CO2, ktype, az_co2);
WSContentSend_PD(HTTP_SNS_TEMP, ktype, temperature, TempUnit());
WSContentSend_PD(HTTP_SNS_HUM, ktype, humidity);
WSContentSend_THD(ktype, az_temperature, az_humidity);
#endif // USE_WEBSERVER
}
}

View File

@ -362,28 +362,24 @@ void Scd30Show(bool json)
{
if (scd30IsDataValid)
{
char humidity[10];
dtostrfd(ConvertHumidity(scd30_Humid), Settings.flag2.humidity_resolution, humidity);
char temperature[10];
dtostrfd(ConvertTemp(scd30_Temp), Settings.flag2.temperature_resolution, temperature);
float t = ConvertTemp(scd30_Temp);
float h = ConvertHumidity(scd30_Humid);
if (json) {
//ResponseAppend_P(PSTR(",\"SCD30\":{\"" D_JSON_CO2 "\":%d,\"" D_JSON_TEMPERATURE "\":%s,\"" D_JSON_HUMIDITY "\":%s}"), scd30_CO2, temperature, humidity);
ResponseAppend_P(PSTR(",\"SCD30\":{\"" D_JSON_CO2 "\":%d,\"" D_JSON_ECO2 "\":%d,\"" D_JSON_TEMPERATURE "\":%s,\"" D_JSON_HUMIDITY "\":%s}"),
scd30_CO2, scd30_CO2EAvg, temperature, humidity);
ResponseAppend_P(PSTR(",\"SCD30\":{\"" D_JSON_CO2 "\":%d,\"" D_JSON_ECO2 "\":%d,"), scd30_CO2, scd30_CO2EAvg);
ResponseAppendTHD(t, h);
ResponseJsonEnd();
#ifdef USE_DOMOTICZ
if (0 == tele_period)
{
if (0 == tele_period) {
DomoticzSensor(DZ_AIRQUALITY, scd30_CO2);
DomoticzTempHumSensor(temperature, humidity);
DomoticzTempHumPressureSensor(t, h);
}
#endif // USE_DOMOTICZ
#ifdef USE_WEBSERVER
} else {
WSContentSend_PD(HTTP_SNS_CO2EAVG, "SCD30", scd30_CO2EAvg);
WSContentSend_PD(HTTP_SNS_CO2, "SCD30", scd30_CO2);
WSContentSend_PD(HTTP_SNS_TEMP, "SCD30", temperature, TempUnit());
WSContentSend_PD(HTTP_SNS_HUM, "SCD30", humidity);
WSContentSend_THD("SCD30", t, h);
#endif // USE_WEBSERVER
}
}

View File

@ -441,9 +441,7 @@ void ChirpShow(bool json)
}
#ifdef USE_DOMOTICZ
if (0 == tele_period) {
char str_moisture[33];
dtostrfd(chirp_sensor[i].moisture, 0, str_moisture);
DomoticzTempHumSensor(str_temperature, str_moisture);
DomoticzTempHumPressureSensor(t_temperature, chirp_sensor[i].moisture);
DomoticzSensor(DZ_ILLUMINANCE,chirp_sensor[i].light); // this is not LUX!!
}
#endif // USE_DOMOTICZ

View File

@ -113,8 +113,8 @@ struct METER_DESC {
struct METER_DESC const meter_desc[METERS_USED]={
[0]={3,'o',0,SML_BAUDRATE,"OBIS",-1,1,0}};
const uint8_t meter[]=
"1,1-0:1.8.0*255(@1," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"1,1-0:2.8.0*255(@1," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"1,1-0:1.8.0*255(@1," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
"1,1-0:2.8.0*255(@1," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
"1,1-0:21.7.0*255(@1," D_TPWRCURR1 ",W," DJ_TPWRCURR1 ",0|"
"1,1-0:41.7.0*255(@1," D_TPWRCURR2 ",W," DJ_TPWRCURR2 ",0|"
"1,1-0:61.7.0*255(@1," D_TPWRCURR3 ",W," DJ_TPWRCURR3 ",0|"
@ -131,8 +131,8 @@ const uint8_t meter[]=
struct METER_DESC const meter_desc[METERS_USED]={
[0]={3,'o',0,SML_BAUDRATE,"OBIS",-1,1,0}};
const uint8_t meter[]=
"1,1-0:1.8.1*255(@1," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"1,1-0:2.8.1*255(@1," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"1,1-0:1.8.1*255(@1," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
"1,1-0:2.8.1*255(@1," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
"1,=d 2 10 @1," D_TPWRCURR ",W," DJ_TPWRCURR ",0|"
"1,1-0:0.0.0*255(@#)," D_METERNR ",," DJ_METERNR ",0";
#endif
@ -147,9 +147,9 @@ struct METER_DESC const meter_desc[METERS_USED]={
// 2 Richtungszähler EHZ SML 8 bit 9600 baud, binär
const uint8_t meter[]=
//0x77,0x07,0x01,0x00,0x01,0x08,0x00,0xff
"1,77070100010800ff@1000," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"1,77070100010800ff@1000," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
//0x77,0x07,0x01,0x00,0x02,0x08,0x00,0xff
"1,77070100020800ff@1000," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"1,77070100020800ff@1000," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
//0x77,0x07,0x01,0x00,0x10,0x07,0x00,0xff
"1,77070100100700ff@1," D_TPWRCURR ",W," DJ_TPWRCURR ",0|"
//0x77,0x07,0x01,0x00,0x00,0x00,0x09,0xff
@ -167,9 +167,9 @@ struct METER_DESC const meter_desc[METERS_USED]={
// verbrauch total
const uint8_t meter[]=
//0x77,0x07,0x01,0x00,0x01,0x08,0x00,0xff
"1,77070100010800ff@1000," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"1,77070100010800ff@1000," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
//0x77,0x07,0x01,0x00,0x01,0x08,0x01,0xff
"1,77070100020800ff@1000," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"1,77070100020800ff@1000," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
//0x77,0x07,0x01,0x00,0x0f,0x07,0x00,0xff
"1,770701000f0700ff@1," D_TPWRCURR ",W," DJ_TPWRCURR ",0";
#endif
@ -185,9 +185,9 @@ struct METER_DESC const meter_desc[METERS_USED]={
// verbrauch total
const uint8_t meter[]=
//0x77,0x07,0x01,0x00,0x01,0x08,0x00,0xff
"1,77070100010800ff@1000," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"1,77070100010800ff@1000," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
//0x77,0x07,0x01,0x00,0x01,0x08,0x01,0xff
"1,77070100020801ff@1000," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"1,77070100020801ff@1000," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
//0x77,0x07,0x01,0x00,0x0f,0x07,0x00,0xff
"1,770701000f0700ff@1," D_TPWRCURR ",W," DJ_TPWRCURR ",0";
#endif
@ -199,13 +199,13 @@ struct METER_DESC const meter_desc[METERS_USED]={
[0]={3,'s',0,SML_BAUDRATE,"strom",-1,1,0}};
const uint8_t meter[]=
//0x77,0x07,0x01,0x00,0x01,0x08,0x00,0xff
"1,77070100010800ff@1000," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"1,77070100010800ff@1000," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
// ..
"1,77070100020800ff@1000," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"1,77070100020800ff@1000," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
//0x77,0x07,0x01,0x00,0x01,0x08,0x01,0xff
"1,77070100010801ff@1000," D_TPWRCURR1 ",KWh," DJ_TPWRCURR1 ",4|"
"1,77070100010801ff@1000," D_TPWRCURR1 ",kWh," DJ_TPWRCURR1 ",4|"
//0x77,0x07,0x01,0x00,0x01,0x08,0x02,0xff
"1,77070100010802ff@1000," D_TPWRCURR2 ",KWh," DJ_TPWRCURR2 ",4|"
"1,77070100010802ff@1000," D_TPWRCURR2 ",kWh," DJ_TPWRCURR2 ",4|"
// 77 07 01 00 10 07 00 FF
"1,77070100100700ff@1," D_TPWRCURR ",W," DJ_TPWRCURR ",0|"
// ..
@ -222,9 +222,9 @@ struct METER_DESC const meter_desc[METERS_USED]={
[0]={3,'s',0,SML_BAUDRATE,"SML",-1,1,0}};
const uint8_t meter[]=
//0x77,0x07,0x01,0x00,0x01,0x08,0x01,0xff
"1,77070100010800ff@1000," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"1,77070100010800ff@1000," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
//0x77,0x07,0x01,0x00,0x02,0x08,0x01,0xff
"1,77070100020801ff@1000," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"1,77070100020801ff@1000," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
//0x77,0x07,0x01,0x00,0x01,0x07,0x00,0xff
"1,77070100010700ff@1," D_TPWRCURR ",W," DJ_TPWRCURR ",0";
#endif
@ -241,18 +241,18 @@ struct METER_DESC const meter_desc[METERS_USED]={
// 3 Zähler definiert
const uint8_t meter[]=
"1,1-0:1.8.0*255(@1," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"1,1-0:2.8.0*255(@1," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"1,1-0:1.8.0*255(@1," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
"1,1-0:2.8.0*255(@1," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
"1,1-0:21.7.0*255(@1," D_TPWRCURR1 ",W," DJ_TPWRCURR1 ",0|"
"1,1-0:41.7.0*255(@1," D_TPWRCURR2 ",W," DJ_TPWRCURR2 ",0|"
"1,1-0:61.7.0*255(@1," D_TPWRCURR3 ",W," DJ_TPWRCURR3 ",0|"
"1,=m 3+4+5 @1," D_TPWRCURR ",W," DJ_TPWRCURR ",0|"
"1,1-0:0.0.0*255(@#)," D_METERNR ",," DJ_METERNR ",0|"
"2,77070100010800ff@1000," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"2,77070100020800ff@1000," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"2,77070100010800ff@1000," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
"2,77070100020800ff@1000," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
"2,77070100100700ff@1," D_TPWRCURR ",W," DJ_TPWRCURR ",0|"
"3,1-0:1.8.1*255(@1," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"3,1-0:2.8.1*255(@1," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"3,1-0:1.8.1*255(@1," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
"3,1-0:2.8.1*255(@1," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
"3,=d 2 10 @1," D_TPWRCURR ",W," DJ_TPWRCURR ",0|"
"3,1-0:0.0.0*255(@#)," D_METERNR ",," DJ_METERNR ",0";
@ -269,13 +269,13 @@ struct METER_DESC const meter_desc[METERS_USED]={
// 2 Zähler definiert
const uint8_t meter[]=
"1,1-0:1.8.1*255(@1," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"1,1-0:2.8.1*255(@1," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"1,1-0:1.8.1*255(@1," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
"1,1-0:2.8.1*255(@1," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
"1,=d 2 10 @1," D_TPWRCURR ",W," DJ_TPWRCURR ",0|"
"1,1-0:0.0.0*255(@#)," D_METERNR ",," DJ_METERNR ",0|"
"2,1-0:1.8.1*255(@1," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"2,1-0:2.8.1*255(@1," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"2,1-0:1.8.1*255(@1," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
"2,1-0:2.8.1*255(@1," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
"2,=d 6 10 @1," D_TPWRCURR ",W," DJ_TPWRCURR ",0|"
"2,1-0:0.0.0*255(@#)," D_METERNR ",," DJ_METERNR ",0";
@ -293,18 +293,18 @@ struct METER_DESC const meter_desc[METERS_USED]={
// 3 Zähler definiert
const uint8_t meter[]=
"1,=h --- Zähler Nr 1 ---|"
"1,1-0:1.8.1*255(@1," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"1,1-0:2.8.1*255(@1," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"1,1-0:1.8.1*255(@1," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
"1,1-0:2.8.1*255(@1," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
"1,=d 2 10 @1," D_TPWRCURR ",W," DJ_TPWRCURR ",0|"
"1,1-0:0.0.0*255(@#)," D_METERNR ",," DJ_METERNR ",0|"
"2,=h --- Zähler Nr 2 ---|"
"2,1-0:1.8.1*255(@1," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"2,1-0:2.8.1*255(@1," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"2,1-0:1.8.1*255(@1," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
"2,1-0:2.8.1*255(@1," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
"2,=d 6 10 @1," D_TPWRCURR ",W," DJ_TPWRCURR ",0|"
"2,1-0:0.0.0*255(@#)," D_METERNR ",," DJ_METERNR ",0|"
"3,=h --- Zähler Nr 3 ---|"
"3,1-0:1.8.1*255(@1," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"3,1-0:2.8.1*255(@1," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"3,1-0:1.8.1*255(@1," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
"3,1-0:2.8.1*255(@1," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
"3,=d 10 10 @1," D_TPWRCURR ",W," DJ_TPWRCURR ",0|"
"3,1-0:0.0.0*255(@#)," D_METERNR ",," DJ_METERNR ",0";
@ -318,7 +318,7 @@ const uint8_t meter[]=
struct METER_DESC const meter_desc[METERS_USED]={
[0]={3,'o',0,SML_BAUDRATE,"OBIS",-1,1,0}};
const uint8_t meter[]=
"1,1-0:1.8.1*255(@1," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"1,1-0:1.8.1*255(@1," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
"1,=d 1 10 @1," D_TPWRCURR ",W," DJ_TPWRCURR ",0|"
"1,1-0:0.0.0*255(@#)," D_METERNR ",," DJ_METERNR ",0";
#endif
@ -333,13 +333,13 @@ struct METER_DESC const meter_desc[METERS_USED]={
// 2 direction meter EHZ SML 8 bit 9600 baud, binary
const uint8_t meter[]=
//0x77,0x07,0x01,0x00,0x01,0x08,0x00,0xff
"1,77070100010800ff@1000," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"1,77070100010800ff@1000," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
//0x77,0x07,0x01,0x00,0x02,0x08,0x00,0xff
"1,77070100020800ff@1000," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"1,77070100020800ff@1000," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
//0x77,0x07,0x01,0x00,0x01,0x08,0x01,0xff
"1,77070100010801ff@1000," D_TPWRCURR1 ",KWh," DJ_TPWRCURR1 ",4|"
"1,77070100010801ff@1000," D_TPWRCURR1 ",kWh," DJ_TPWRCURR1 ",4|"
//0x77,0x07,0x01,0x00,0x01,0x08,0x02,0xff
"1,77070100010802ff@1000," D_TPWRCURR2 ",KWh," DJ_TPWRCURR2 ",4|"
"1,77070100010802ff@1000," D_TPWRCURR2 ",kWh," DJ_TPWRCURR2 ",4|"
//0x77,0x07,0x01,0x00,0x10,0x07,0x00,0xff
"1,77070100100700ff@1," D_TPWRCURR ",W," DJ_TPWRCURR ",0|"
//0x77,0x07,0x01,0x00,0x00,0x00,0x09,0xff
@ -357,8 +357,8 @@ struct METER_DESC const meter_desc[METERS_USED]={
// 3 meters defined
const uint8_t meter[]=
"1,1-0:1.8.1*255(@1," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
"1,1-0:2.8.1*255(@1," D_TPWROUT ",KWh," DJ_TPWROUT ",4|"
"1,1-0:1.8.1*255(@1," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
"1,1-0:2.8.1*255(@1," D_TPWROUT ",kWh," DJ_TPWROUT ",4|"
"1,=d 2 10 @1," D_TPWRCURR ",W," DJ_TPWRCURR ",0|"
"1,1-0:0.0.0*255(@#)," D_METERNR ",," DJ_METERNR ",0|"
@ -389,7 +389,7 @@ const uint8_t meter[]=
//----------------------------Stromzähler-EHZ363W5--sensor53 d0----------------------------
"3,=h==================|"
//0x77,0x07,0x01,0x00,0x01,0x08,0x00,0xff
"3,77070100010800ff@1000," D_TPWRIN ",KWh," DJ_TPWRIN ",3|" // 3 Zählerstand Total
"3,77070100010800ff@1000," D_TPWRIN ",kWh," DJ_TPWRIN ",3|" // 3 Zählerstand Total
"3,=h==================|"
//0x77,0x07,0x01,0x00,0x10,0x07,0x00,0xff
"3,77070100100700ff@1," D_TPWRCURR ",W," DJ_TPWRCURR ",2|" // 4 Aktuelle Leistung
@ -1548,7 +1548,7 @@ nextsect:
}
}
//"1-0:1.8.0*255(@1," D_TPWRIN ",KWh," DJ_TPWRIN ",4|"
//"1-0:1.8.0*255(@1," D_TPWRIN ",kWh," DJ_TPWRIN ",4|"
void SML_Immediate_MQTT(const char *mp,uint8_t index,uint8_t mindex) {
char tpowstr[32];
char jname[24];

View File

@ -96,30 +96,7 @@ void Hih6EverySecond(void)
void Hih6Show(bool json)
{
if (Hih6.valid) {
char temperature[33];
dtostrfd(Hih6.temperature, Settings.flag2.temperature_resolution, temperature);
char humidity[33];
dtostrfd(Hih6.humidity, Settings.flag2.humidity_resolution, humidity);
if (json) {
ResponseAppend_P(JSON_SNS_TEMPHUM, Hih6.types, temperature, humidity);
#ifdef USE_DOMOTICZ
if (0 == tele_period) {
DomoticzTempHumSensor(temperature, humidity);
}
#endif // USE_DOMOTICZ
#ifdef USE_KNX
if (0 == tele_period) {
KnxSensor(KNX_TEMPERATURE, Hih6.temperature);
KnxSensor(KNX_HUMIDITY, Hih6.humidity);
}
#endif // USE_KNX
#ifdef USE_WEBSERVER
} else {
WSContentSend_PD(HTTP_SNS_TEMP, Hih6.types, temperature, TempUnit());
WSContentSend_PD(HTTP_SNS_HUM, Hih6.types, humidity);
#endif // USE_WEBSERVER
}
TempHumDewShow(json, (0 == tele_period), Hih6.types, Hih6.temperature, Hih6.humidity);
}
}

View File

@ -90,30 +90,7 @@ void Dht12EverySecond(void)
void Dht12Show(bool json)
{
if (Dht12.valid) {
char temperature[33];
dtostrfd(Dht12.temperature, Settings.flag2.temperature_resolution, temperature);
char humidity[33];
dtostrfd(Dht12.humidity, Settings.flag2.humidity_resolution, humidity);
if (json) {
ResponseAppend_P(JSON_SNS_TEMPHUM, Dht12.name, temperature, humidity);
#ifdef USE_DOMOTICZ
if ((0 == tele_period)) {
DomoticzTempHumSensor(temperature, humidity);
}
#endif // USE_DOMOTICZ
#ifdef USE_KNX
if (0 == tele_period) {
KnxSensor(KNX_TEMPERATURE, Dht12.temperature);
KnxSensor(KNX_HUMIDITY, Dht12.humidity);
}
#endif // USE_KNX
#ifdef USE_WEBSERVER
} else {
WSContentSend_PD(HTTP_SNS_TEMP, Dht12.name, temperature, TempUnit());
WSContentSend_PD(HTTP_SNS_HUM, Dht12.name, humidity);
#endif // USE_WEBSERVER
}
TempHumDewShow(json, (0 == tele_period), Dht12.name, Dht12.temperature, Dht12.humidity);
}
}

View File

@ -26,11 +26,11 @@
* I2C Address: 0x38
*
* Attention: this Sensor is incompatible with other I2C devices on I2C bus.
*
*
* The Datasheet write:
* "Only a single AHT10 can be connected to the I2C bus and no other I2C
* "Only a single AHT10 can be connected to the I2C bus and no other I2C
* devices can be connected".
*
*
* after lot of search and tests, now is confirmed that works only reliable with one sensor
* on I2C Bus
\*********************************************************************************************/
@ -38,129 +38,133 @@
#define XSNS_63 63
#define XI2C_43 43 // See I2CDEVICES.md
#define AHT10_ADDR 0x38
#define AHT1X_ADDR1 0x38
#define AHT1X_ADDR2 0x39
uint8_t eSensorCalibrateCmd[3] = {0xE1, 0x08, 0x00};
uint8_t eSensorMeasureCmd[3] = {0xAC, 0x33, 0x00};
uint8_t eSensorResetCmd = 0xBA;
#define AHT1X_MAX_SENSORS 2
struct AHT10 {
#define AHT_HUMIDITY_CONST 100
#define AHT_TEMPERATURE_CONST 200
#define AHT_TEMPERATURE_OFFSET 50
#define KILOBYTE_CONST 1048576.0f
#define AHT1X_CMD_DELAY 40
#define AHT1X_RST_DELAY 30
#define AHT1X_MEAS_DELAY 80 // over 75ms in datasheet
uint8_t AHTSetCalCmd[3] = {0xE1, 0x08, 00}; //load factory calibration coeff
uint8_t AHTSetCycleCmd[3] = {0xE1, 0x28, 00}; //enable cycle mode
uint8_t AHTMeasureCmd[3] = {0xAC, 0x33, 00}; //start measurment command
uint8_t AHTResetCmd = 0xBA; //soft reset command
const char ahtTypes[] PROGMEM = "AHT1X|AHT1X";
uint8_t aht1x_addresses[] = { AHT1X_ADDR1, AHT1X_ADDR2 };
uint8_t aht1x_count = 0;
uint8_t aht1x_Pcount = 0;
struct AHT1XSTRUCT
{
float humidity = NAN;
float temperature = NAN;
uint8_t valid = 0;
uint8_t count = 0;
char name[6] = "AHT1x";
} AHT10;
uint8_t address; // bus address
char types[6]; // Sensor type name and address -
} aht1x_sensors[AHT1X_MAX_SENSORS];
bool AHT10Read(void)
bool AHT1XWrite(uint8_t aht1x_idx)
{
if (AHT10.valid) { AHT10.valid--; }
Wire.beginTransmission(aht1x_sensors[aht1x_idx].address);
Wire.write(AHTMeasureCmd, 3);
if (Wire.endTransmission() != 0)
return false;
}
bool AHT1XRead(uint8_t aht1x_idx)
{
uint8_t data[6];
Wire.requestFrom(aht1x_sensors[aht1x_idx].address, (uint8_t) 6);
for(uint8_t i = 0; Wire.available() > 0; i++){
data[i] = Wire.read();
}
if ((data[0] & 0x80) == 0x80) return false; //device is busy
Wire.beginTransmission(AHT10_ADDR);
Wire.write(eSensorMeasureCmd, 3);
Wire.endTransmission();
delay(80);
aht1x_sensors[aht1x_idx].humidity = (((data[1] << 12)| (data[2] << 4) | data[3] >> 4) * AHT_HUMIDITY_CONST / KILOBYTE_CONST);
aht1x_sensors[aht1x_idx].temperature = ((AHT_TEMPERATURE_CONST * (((data[3] & 0x0F) << 16) | (data[4] << 8) | data[5]) / KILOBYTE_CONST) - AHT_TEMPERATURE_OFFSET);
Wire.requestFrom(AHT10_ADDR, 6);
for (uint32_t i = 0; Wire.available() > 0; i++) {
data[i] = Wire.read();
}
uint32_t result_h = ((data[1] << 16) | (data[2] << 8) | data[3]) >> 4;
uint32_t result_t = ((data[3] & 0x0F) << 16) | (data[4] << 8) | data[5];
float humidity = result_h * 100 / 1048576;
float temperature = ((200 * result_t) / 1048576) - 50;
if (isnan(temperature) || isnan(humidity)) { return false; }
AHT10.humidity = ConvertHumidity(humidity);
AHT10.temperature = ConvertTemp(temperature);
AHT10.valid = SENSOR_MAX_MISS;
return true;
return (!isnan(aht1x_sensors[aht1x_idx].temperature) && !isnan(aht1x_sensors[aht1x_idx].humidity) && (aht1x_sensors[aht1x_idx].humidity != 0));
}
/********************************************************************************************/
bool AHT10Init(void)
// Test for Polling the device without delays
// Incompatible with other devices on I2C bus
void AHT1XPoll(void) // We have 100ms for read. Sensor needs 80-95 ms
{
Wire.begin(AHT10_ADDR);
Wire.beginTransmission(AHT10_ADDR);
Wire.write(eSensorCalibrateCmd, 3); // init with internal temp coef.
Wire.endTransmission();
delay(40); // after tests, its ok
return (0x08 == (AHT10ReadStatus() & 0x68));
aht1x_Pcount++;
switch (aht1x_Pcount) {
case 10:
AHT1XWrite(0);
break;
case 11:
if (AHT1XRead(0)){
ConvertTemp(aht1x_sensors[0].temperature); // Set global temperature
ConvertHumidity(aht1x_sensors[0].humidity); // Set global humidity
}
aht1x_Pcount = 0;
break;
}
}
uint8_t AHT10ReadStatus(void)
unsigned char AHT1XReadStatus(uint8_t aht1x_address)
{
Wire.requestFrom(AHT10_ADDR, 1);
uint8_t result = Wire.read();
uint8_t result = 0;
Wire.requestFrom(aht1x_address, (uint8_t) 1);
result = Wire.read();
return result;
}
void AHT10Reset(void)
void AHT1XReset(uint8_t aht1x_address)
{
Wire.beginTransmission(AHT10_ADDR);
Wire.write(eSensorResetCmd);
Wire.beginTransmission(aht1x_address);
Wire.write(AHTResetCmd);
Wire.endTransmission();
delay(20);
delay(AHT1X_RST_DELAY);
}
/********************************************************************************************/
void AHT10Detect(void)
bool AHT1XInit(uint8_t aht1x_address)
{
if (I2cActive(AHT10_ADDR)) { return; }
if (AHT10Init()) {
I2cSetActiveFound(AHT10_ADDR, AHT10.name);
AHT10.count = 1;
}
Wire.beginTransmission(aht1x_address);
Wire.write(AHTSetCalCmd, 3);
if (Wire.endTransmission() != 0) return false;
delay(AHT1X_CMD_DELAY);
if((AHT1XReadStatus(aht1x_address) & 0x68) == 0x08) // Sensor calcoef aktiv
return true;
return false;
}
void AHT10EverySecond(void)
void AHT1XDetect(void)
{
if (uptime &1) {
// AHT10: 55mS
if (!AHT10Read()) {
AddLogMissed(AHT10.name, AHT10.valid);
for (uint8_t i = 0; i < AHT1X_MAX_SENSORS; i++) {
if (I2cActive(aht1x_addresses[i])) { continue; }
if (AHT1XInit(aht1x_addresses[i]))
{
aht1x_sensors[aht1x_count].address = aht1x_addresses[i];
GetTextIndexed(aht1x_sensors[aht1x_count].types, sizeof(aht1x_sensors[aht1x_count].types), i, ahtTypes);
I2cSetActiveFound(aht1x_sensors[aht1x_count].address, aht1x_sensors[aht1x_count].types);
aht1x_count = 1;
break; // Only one Sensor allowed at the moment (I2C Sensor-Bug)
}
}
}
void AHT10Show(bool json)
void AHT1XShow(bool json)
{
if (AHT10.valid) {
char temperature[33];
dtostrfd(AHT10.temperature, Settings.flag2.temperature_resolution, temperature);
char humidity[33];
dtostrfd(AHT10.humidity, Settings.flag2.humidity_resolution, humidity);
if (json) {
ResponseAppend_P(JSON_SNS_TEMPHUM, AHT10.name, temperature, humidity);
#ifdef USE_DOMOTICZ
if ((0 == tele_period)) {
DomoticzTempHumSensor(temperature, humidity);
}
#endif // USE_DOMOTICZ
#ifdef USE_KNX
if (0 == tele_period) {
KnxSensor(KNX_TEMPERATURE, AHT10.temperature);
KnxSensor(KNX_HUMIDITY, AHT10.humidity);
}
#endif // USE_KNX
#ifdef USE_WEBSERVER
} else {
WSContentSend_PD(HTTP_SNS_TEMP, AHT10.name, temperature, TempUnit());
WSContentSend_PD(HTTP_SNS_HUM, AHT10.name, humidity);
#endif // USE_WEBSERVER
}
for (uint32_t i = 0; i < aht1x_count; i++) {
float tem = ConvertTemp(aht1x_sensors[i].temperature);
float hum = ConvertHumidity(aht1x_sensors[i].humidity);
char types[11]; // AHT1X-0x38
snprintf_P(types, sizeof(types), PSTR("%s%c0x%02X"), aht1x_sensors[i].types, IndexSeparator(), aht1x_sensors[i].address); // "X-0xXX"
TempHumDewShow(json, ((0 == tele_period) && (0 == i)), types, tem, hum);
}
}
@ -171,29 +175,28 @@ void AHT10Show(bool json)
bool Xsns63(uint8_t function)
{
if (!I2cEnabled(XI2C_43)) { return false; }
bool result = false;
if (FUNC_INIT == function) {
AHT10Detect();
AHT1XDetect();
}
else if (AHT10.count) {
else if (aht1x_count){
switch (function) {
case FUNC_EVERY_SECOND:
AHT10EverySecond();
break;
case FUNC_JSON_APPEND:
AHT10Show(1);
break;
#ifdef USE_WEBSERVER
case FUNC_WEB_SENSOR:
AHT10Show(0);
break;
#endif // USE_WEBSERVER
case FUNC_EVERY_100_MSECOND:
AHT1XPoll();
break;
case FUNC_JSON_APPEND:
AHT1XShow(1);
break;
#ifdef USE_WEBSERVER
case FUNC_WEB_SENSOR:
AHT1XShow(0);
break;
#endif // USE_WEBSERVER
}
}
return result;
}
#endif // USE_AHT10
#endif // USE_I2C
#endif // USE_AHT1X
#endif // USE_I2C

View File

@ -274,31 +274,7 @@ void HdcEverySecond(void) {
*/
void HdcShow(bool json) {
if (hdc_valid) {
char temperature[33];
dtostrfd(hdc_temperature, Settings.flag2.temperature_resolution, temperature);
char humidity[33];
dtostrfd(hdc_humidity, Settings.flag2.humidity_resolution, humidity);
if (json) {
ResponseAppend_P(JSON_SNS_TEMPHUM, hdc_type_name, temperature, humidity);
#ifdef USE_DOMOTICZ
if (0 == tele_period) {
DomoticzTempHumSensor(temperature, humidity);
}
#endif // USE_DOMOTICZ
#ifdef USE_KNX
if (0 == tele_period) {
KnxSensor(KNX_TEMPERATURE, hdc_temperature);
KnxSensor(KNX_HUMIDITY, hdc_humidity);
}
#endif // USE_KNX
#ifdef USE_WEBSERVER
} else {
WSContentSend_PD(HTTP_SNS_TEMP, hdc_type_name, temperature, TempUnit());
WSContentSend_PD(HTTP_SNS_HUM, hdc_type_name, humidity);
#endif // USE_WEBSERVER
}
TempHumDewShow(json, (0 == tele_period), hdc_type_name, hdc_temperature, hdc_humidity);
}
}