Skip to content

Commit 8e66d61

Browse files
authored
Merge branch 'mega' into feature/MQTT_TLS
2 parents a182bdb + f2e1e2e commit 8e66d61

File tree

89 files changed

+3034
-1758
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+3034
-1758
lines changed

docs/source/Plugin/P033.rst

+83-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ You can use a special dummy device within ESP Easy to provide additional feature
2828

2929
The dummy device can be used like any other sensor to send it's data to a Controller. But this is not mandatory if you only want to use it within your own rules section.
3030

31-
The dummy device has it's own special command to set values from rules:
31+
Dummy tasks can be used like temporary variables to store data.
32+
One nice benefit is that these task values of Dummy tasks are also kept in RTC memory.
33+
So these may survive a reboot, as long as the ESP remains powered.
34+
35+
Storing Values
36+
--------------
37+
38+
Typically, one can only interact with a Dummy task via the ``TaskValueSet`` command:
3239

3340
.. code-block:: none
3441
@@ -54,6 +61,78 @@ So for a Dummy device named ``Dummy``, Output Data Type set to Temp / Hum, and V
5461

5562
Note: You can use multiple Dummy devices if needed!
5663

64+
Output Configuration
65+
--------------------
66+
67+
A Dummy can be configured to output a specific data type.
68+
Especially Domoticz controllers require some specific data type to properly handle specific devices which output several units of measure.
69+
70+
For example "Temp / Hum / Baro" are obviously intended to mimic the well known Bosch BME280 sensor.
71+
72+
Basic data types like "Single", "Dual", "Triple", "Quad" are intended to set resp. 1 ... 4 ``float`` values.
73+
74+
Extended Output Data Types
75+
^^^^^^^^^^^^^^^^^^^^^^^^^^
76+
77+
Added: 2023/04/15
78+
79+
Storing data in ``float`` values may result in loss of decimals.
80+
A float can only store upto 22 bit if numerical information.
81+
82+
For example the "UnixTime" (number of seconds since 1970/01/01) cannot accurately be stored in a float.
83+
84+
To overcome these issues, a number of integer types are added:
85+
86+
* Int32 - Integer value ranging from ``-2147483648`` ... ``2147483647`` (-1 * 2^31 ... (2^31 - 1))
87+
* UInt32 - Integer value ranging from ``0`` ... ``4294967295`` (2^32 - 1)
88+
* Int64 - Integer value ranging from -1 * 2^63 ... (2^63 - 1)
89+
* UInt64 - Integer value ranging from 0 ... (2^64 - 1)
90+
* Double - "Double" Floating point value capable of storing 52 bit of numerical information.
91+
92+
The offered selection also shows the number of task values being configured.
93+
For example ``Int32 (3x)`` implies 3 task values of type ``Int32``.
94+
95+
Since 64 bit ints and double need 8 bytes, where the other types only require 4 bytes.
96+
Therefore the maximum number of those task values possible is half that of the other types.
97+
98+
Storing data in 64 bit ints may not allow to store the full range as one may expect to store based on the integer types.
99+
The ``TaskValueSet`` command internally processes data as ``double``, thus limiting the maximum range of these integer values to -9007199254740992 ... 9007199254740991.
100+
101+
One can store larger values in these 64 bit int types, but this will result in loss of bits.
102+
103+
For example:
104+
105+
* ``9007199254740993`` cannot be stored in such a data type as it will be rounded back to ``9007199254740992`` when used.
106+
* ``1234567890123456789`` will be read back as ``1234567890123456768``, which may seem correct at first sight, but the last few digits are wrong.
107+
108+
Storing large values in other integer types, like ``UInt32``, will be clipped to the maximum value that can be handled by that type.
109+
110+
For example:
111+
112+
* ``1234567890123456789`` stored in an ``UInt32`` will be read back as ``4294967295``
113+
* ``-1`` stored in an ``UInt32`` will be read back as ``4294967295``
114+
* ``1234567890123456789`` stored in an ``Int32`` will be read back as ``2147483647``
115+
* ``-1`` stored in an ``Int32`` will be read back as ``-2147483648``
116+
117+
118+
119+
Data Acquisition
120+
----------------
121+
122+
In ESPEasy, a task can be triggered to yield some new sample data.
123+
For other plugins, this means the sensor is read and when successful there is some new data to process.
124+
125+
However, since the Dummy device doesn't interact with a device, it will always be "successful" on a task run.
126+
127+
One may set the "Interval" to periodically trigger a new task run, or trigger a task run via the command ``TaskRun``.
128+
129+
.. note:: The command ``TaskValueSetAndRun`` is a combination of ``TaskValueSet`` and ``TaskRun``.
130+
131+
On a task run, there will be one or more events fired (depending on whether or not "Single event with all values" is checked).
132+
And all connected controllers of that task will be handed over the values present in the task values.
133+
134+
Especially Domoticz controllers are very specific to the output data type.
135+
57136

58137
.. Supported hardware
59138
.. ------------------
@@ -76,6 +155,9 @@ Change log
76155
.. versionchanged:: 2.0
77156
...
78157

158+
|improved|
159+
2023-04-15 Add more types of task values, like (u)int32, (u)int64 and double.
160+
79161
|improved|
80162
2021-08-18 Make Interval optional, so no interval (0) can be used.
81163

docs/source/Plugin/P151.rst

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
.. include:: ../Plugin/_plugin_substitutions_p15x.repl
2+
.. _P151_page:
3+
4+
|P151_typename|
5+
==================================================
6+
7+
|P151_shortinfo|
8+
9+
Plugin details
10+
--------------
11+
12+
Type: |P151_type|
13+
14+
Name: |P151_name|
15+
16+
Status: |P151_status|
17+
18+
GitHub: |P151_github|_
19+
20+
Maintainer: |P151_maintainer|
21+
22+
Used libraries: |P151_usedlibraries|
23+
24+
Description
25+
-----------
26+
27+
The Honeywell TruStability™ HSC Series are calibrated pressure sensors with internal temperature compensation.
28+
This series has a lot of versions of pressure sensors ranging in form factor, pressure range, etc.
29+
30+
31+
Hardware
32+
--------
33+
34+
See the `datasheet <https://prod-edam.honeywell.com/content/dam/honeywell-edam/sps/siot/en-us/products/sensors/pressure-sensors/board-mount-pressure-sensors/trustability-hsc-series/documents/sps-siot-trustability-hsc-series-high-accuracy-board-mount-pressure-sensors-50099148-a-en-ciid-151133.pdf?download=false>`_ for all versions.
35+
36+
* Page 13 is a must to help decode the nomenclature of the model numbers.
37+
* Pages 17 - 29 are about the various form factors of these sensors.
38+
39+
The digital versions of these sensors typically output a 14 bit value ranging from ``0`` ... ``16383``.
40+
41+
The usable (and compensated) range is typically 10% - 90% of the full range.
42+
These 10% and 90% points are also the specified range of the sensor.
43+
44+
For example, a differential sensor ranging -1 ... 1 bar, will output:
45+
46+
* ``1638`` = -1 bar
47+
* ``14746`` = 1 bar
48+
49+
In practice, the sensor can measure from 2.5% upto 97.5% of the full range before it will start clipping.
50+
51+
52+
Configuration
53+
-------------
54+
55+
* **Name**: Required by ESPEasy, must be unique among the list of available devices/tasks.
56+
57+
* **Enabled**: The device can be disabled or enabled. When not enabled the device should not use any resources.
58+
59+
60+
Device Settings
61+
^^^^^^^^^^^^^^^
62+
63+
Sensor Output Min and Max must be set to resp. 10% and 90% of the digital count range.
64+
65+
* ``Sensor Output Min`` Default to 1638 (10% of 2^14)
66+
* ``Sensor Output Max`` Default to 14745 (90% of 2^14)
67+
* ``Pressure Min`` Minimal stated pressure for the given sensor.
68+
* ``Pressure Max`` Maximal stated pressure for the given sensor.
69+
70+
For example, given the ``HCSMANV001BA2A3`` sensor:
71+
72+
* ``M`` SMT
73+
* ``AN`` Single Axial barbed port
74+
* ``V`` Liquid Media port 1, diagnostics on
75+
* ``001BA`` 0 bar to 1 bar
76+
* ``2`` I2C address 0x28
77+
* ``A`` 10% to 90% 2^14 digital
78+
* ``3`` 3V3
79+
80+
The measurement range for this sensor is 0 ... 1 bar.
81+
This means the ``Pressure Min`` and ``Pressure Max`` should be set to resp. 0 and 1.
82+
However, if the pressure in some container needs to be compared to some outside pressure, measured by for example a Bosch BMP280, it might be useful to directly output to mbar.
83+
Thus for this purpose the ``Pressure Max`` should be set to ``1000``.
84+
85+
86+
.. image:: P151_DeviceSettingsScreenshot.png
87+
:alt: Device configuration
88+
89+
90+
91+
92+
Change log
93+
----------
94+
95+
.. versionchanged:: 2.0
96+
...
97+
98+
|added|
99+
2023-04-12 Initial release version.
100+
101+
102+
103+
104+
Loading

docs/source/Plugin/_Plugin.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ There are different released versions of ESP Easy:
368368
":ref:`P143_page`","|P143_status|","P143"
369369
":ref:`P145_page`","|P145_status|","P145"
370370
":ref:`P148_page`","|P148_status|","P148"
371+
":ref:`P151_page`","|P151_status|","P151"
371372

372373

373374
Internal GPIO handling
@@ -427,7 +428,7 @@ Environment
427428

428429
Plugins: |Plugin_Environment|
429430

430-
Hardware: |P004_usedby|, |P005_usedby|, |P006_usedby|, |P024_usedby|, |P028_usedby|
431+
Hardware: |P004_usedby|, |P005_usedby|, |P006_usedby|, |P024_usedby|, |P028_usedby|, |P151_usedby|
431432

432433
Extra IO
433434
--------

docs/source/Plugin/_plugin_categories.repl

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
.. |Plugin_Energy_AC| replace:: :ref:`P076_page`, :ref:`P077_page`, :ref:`P078_page`, :ref:`P102_page`, :ref:`P108_page`
88
.. |Plugin_Energy_DC| replace:: :ref:`P027_page`, :ref:`P085_page`, :ref:`P115_page`, :ref:`P132_page`
99
.. |Plugin_Energy_Heat| replace:: :ref:`P088_page`, :ref:`P093_page`
10-
.. |Plugin_Environment| replace:: :ref:`P004_page`, :ref:`P005_page`, :ref:`P006_page`, :ref:`P014_page`, :ref:`P024_page`, :ref:`P028_page`, :ref:`P030_page`, :ref:`P031_page`, :ref:`P032_page`, :ref:`P034_page`, :ref:`P039_page`, :ref:`P047_page`, :ref:`P051_page`, :ref:`P068_page`, :ref:`P069_page`, :ref:`P072_page`, :ref:`P103_page`, :ref:`P105_page`, :ref:`P106_page`
10+
.. |Plugin_Environment| replace:: :ref:`P004_page`, :ref:`P005_page`, :ref:`P006_page`, :ref:`P014_page`, :ref:`P024_page`, :ref:`P028_page`, :ref:`P030_page`, :ref:`P031_page`, :ref:`P032_page`, :ref:`P034_page`, :ref:`P039_page`, :ref:`P047_page`, :ref:`P051_page`, :ref:`P068_page`, :ref:`P069_page`, :ref:`P072_page`, :ref:`P103_page`, :ref:`P105_page`, :ref:`P106_page`, :ref:`P151_page`
1111
.. |Plugin_Extra_IO| replace:: :ref:`P011_page`, :ref:`P022_page`
1212
.. |Plugin_Gases| replace:: :ref:`P049_page`, :ref:`P052_page`, :ref:`P083_page`, :ref:`P090_page`, :ref:`P117_page`, :ref:`P127_page`, :ref:`P135_page`, :ref:`P145_page`
1313
.. |Plugin_Generic| replace:: :ref:`P003_page`, :ref:`P026_page`, :ref:`P033_page`, :ref:`P037_page`, :ref:`P081_page`, :ref:`P100_page`

docs/source/Plugin/_plugin_substitutions.repl

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
.. include:: ../Plugin/_plugin_substitutions_p12x.repl
1414
.. include:: ../Plugin/_plugin_substitutions_p13x.repl
1515
.. include:: ../Plugin/_plugin_substitutions_p14x.repl
16+
.. include:: ../Plugin/_plugin_substitutions_p15x.repl
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.. |P151_name| replace:: :cyan:`I2C Honeywell Pressure`
2+
.. |P151_type| replace:: :cyan:`Environment`
3+
.. |P151_typename| replace:: :cyan:`Environment - I2C Honeywell Pressure`
4+
.. |P151_porttype| replace:: `.`
5+
.. |P151_status| replace:: :yellow:`COLLECTION F` :yellow:`CLIMATE`
6+
.. |P151_github| replace:: P151_Honeywell_pressure.ino
7+
.. _P151_github: https://github.com/letscontrolit/ESPEasy/blob/mega/src/_P151_Honeywell_pressure.ino
8+
.. |P151_usedby| replace:: `.`
9+
.. |P151_shortinfo| replace:: `I2C Honeywell Pressure`
10+
.. |P151_maintainer| replace:: `TD-er`
11+
.. |P151_compileinfo| replace:: `.`
12+
.. |P151_usedlibraries| replace:: `.`

lib/ESPEasySerial/ESPEasySerialType.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#endif // ifndef ESP32_SER2_RX
2323

2424

25-
2625
bool ESPeasySerialType::getSerialTypePins(ESPEasySerialPort serType, int& rxPin, int& txPin) {
2726
rxPin = -1;
2827
txPin = -1;
@@ -31,7 +30,9 @@ bool ESPeasySerialType::getSerialTypePins(ESPEasySerialPort serType, int& rxPin,
3130
#ifdef ESP32
3231
case ESPEasySerialPort::serial0: rxPin = ESP32_SER0_RX; txPin = ESP32_SER0_TX; return true;
3332
case ESPEasySerialPort::serial1: rxPin = ESP32_SER1_RX; txPin = ESP32_SER1_TX; return true;
33+
# ifndef ESP32S2
3434
case ESPEasySerialPort::serial2: rxPin = ESP32_SER2_RX; txPin = ESP32_SER2_TX; return true;
35+
# endif // ifndef ESP32S2
3536
#endif // ifdef ESP32
3637
#ifdef ESP8266
3738
case ESPEasySerialPort::serial0: rxPin = 3; txPin = 1; return true;
@@ -66,10 +67,12 @@ ESPEasySerialPort ESPeasySerialType::getSerialType(ESPEasySerialPort typeHint, i
6667
if ((receivePin == ESP32_SER1_RX) && (transmitPin == ESP32_SER1_TX)) {
6768
return ESPEasySerialPort::serial1; // UART1
6869
}
70+
# ifndef ESP32S2
6971

7072
if ((receivePin == ESP32_SER2_RX) && (transmitPin == ESP32_SER2_TX)) {
7173
return ESPEasySerialPort::serial2; // UART2
7274
}
75+
# endif // ifndef ESP32S2
7376

7477
if ((receivePin >= 0x48) && (receivePin <= 0x57)) {
7578
return ESPEasySerialPort::sc16is752; // I2C address range of SC16IS752

0 commit comments

Comments
 (0)