mirror of https://github.com/arendst/Tasmota.git
Merge pull request #9760 from tichris0/development
Add support for EZO PMP
This commit is contained in:
commit
961db9fa36
|
@ -88,3 +88,4 @@ Index | Define | Driver | Device | Address(es) | Description
|
|||
55 | USE_EZOFLO | xsns_78 | EZOFLO | 0x61 - 0x70 | Flow meter sensor
|
||||
55 | USE_EZODO | xsns_78 | EZODO | 0x61 - 0x70 | Disolved Oxygen sensor
|
||||
55 | USE_EZORGB | xsns_78 | EZORGB | 0x61 - 0x70 | Color sensor
|
||||
55 | USE_EZOPMP | xsns_78 | EZOPMP | 0x61 - 0x70 | Peristaltic Pump
|
||||
|
|
|
@ -135,6 +135,7 @@
|
|||
#define D_JSON_PROGRAMSIZE "ProgramSize"
|
||||
#define D_JSON_PSRMAXMEMORY "PsrMax"
|
||||
#define D_JSON_PSRFREEMEMORY "PsrFree"
|
||||
#define D_JSON_PUMP "Pumped"
|
||||
#define D_JSON_RED "Red"
|
||||
#define D_JSON_REFERENCETEMPERATURE "ReferenceTemperature"
|
||||
#define D_JSON_REMAINING "Remaining"
|
||||
|
@ -794,6 +795,7 @@ const char HTTP_SNS_DO[] PROGMEM = "{s}%s " D_DO "{
|
|||
const char HTTP_SNS_COLOR_RED[] PROGMEM = "{s}%s " D_COLOR_RED "{m}%u " "{e}";
|
||||
const char HTTP_SNS_COLOR_GREEN[] PROGMEM = "{s}%s " D_COLOR_GREEN "{m}%u " "{e}";
|
||||
const char HTTP_SNS_COLOR_BLUE[] PROGMEM = "{s}%s " D_COLOR_BLUE "{m}%u " "{e}";
|
||||
const char HTTP_SNS_MILLILITERS[] PROGMEM = "{s}%s " D_VOLUME "{m}%s " D_UNIT_MILLILITERS "{e}";
|
||||
#endif // USE_WEBSERVER
|
||||
|
||||
const uint32_t MARKER_START = 0x5AA55AA5;
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -751,6 +751,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "마이크로초"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "밀리초"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "мкс"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "мА"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "мм рт.ст."
|
||||
#define D_UNIT_MILLISECOND "мс"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µС"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "мА"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "мм"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "ммHg"
|
||||
#define D_UNIT_MILLISECOND "мС"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "µs"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "mA"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "ms"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "微秒"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "毫安"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "毫米"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "毫米汞柱"
|
||||
#define D_UNIT_MILLISECOND "毫秒"
|
||||
|
|
|
@ -755,6 +755,7 @@
|
|||
#define D_UNIT_MICROSECOND "微秒"
|
||||
#define D_UNIT_MICROSIEMENS_PER_CM "µS/cm"
|
||||
#define D_UNIT_MILLIAMPERE "毫安培"
|
||||
#define D_UNIT_MILLILITERS "ml"
|
||||
#define D_UNIT_MILLIMETER "mm"
|
||||
#define D_UNIT_MILLIMETER_MERCURY "mmHg"
|
||||
#define D_UNIT_MILLISECOND "毫秒"
|
||||
|
|
|
@ -573,6 +573,7 @@
|
|||
// #define USE_EZOFLO // [I2cDriver55] Enable support for EZO's FLO sensor (+0k4 code) - Shared EZO code required for any EZO device (+1k2 code)
|
||||
// #define USE_EZODO // [I2cDriver55] Enable support for EZO's DO sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code)
|
||||
// #define USE_EZORGB // [I2cDriver55] Enable support for EZO's RGB sensor (+0k5 code) - Shared EZO code required for any EZO device (+1k2 code)
|
||||
// #define USE_EZOPMP // [I2cDriver55] Enable support for EZO's PMP sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code)
|
||||
|
||||
// #define USE_DISPLAY // Add I2C Display Support (+2k code)
|
||||
#define USE_DISPLAY_MODES1TO5 // Enable display mode 1 to 5 in addition to mode 0
|
||||
|
|
|
@ -136,8 +136,9 @@
|
|||
//#define USE_EZOO2 // [I2cDriver55] Enable support for EZO's O2 sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code)
|
||||
//#define USE_EZOPRS // [I2cDriver55] Enable support for EZO's PRS sensor (+0k7 code) - Shared EZO code required for any EZO device (+1k2 code)
|
||||
//#define USE_EZOFLO // [I2cDriver55] Enable support for EZO's FLO sensor (+0k4 code) - Shared EZO code required for any EZO device (+1k2 code)
|
||||
// #define USE_EZODO // [I2cDriver55] Enable support for EZO's DO sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code)
|
||||
// #define USE_EZORGB // [I2cDriver55] Enable support for EZO's RGB sensor (+0k5 code) - Shared EZO code required for any EZO device (+1k2 code)
|
||||
//#define USE_EZODO // [I2cDriver55] Enable support for EZO's DO sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code)
|
||||
//#define USE_EZORGB // [I2cDriver55] Enable support for EZO's RGB sensor (+0k5 code) - Shared EZO code required for any EZO device (+1k2 code)
|
||||
//#define USE_EZOPMP // [I2cDriver55] Enable support for EZO's PMP sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code)
|
||||
|
||||
#define USE_MHZ19 // Add support for MH-Z19 CO2 sensor (+2k code)
|
||||
#define USE_SENSEAIR // Add support for SenseAir K30, K70 and S8 CO2 sensor (+2k3 code)
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
#ifdef USE_I2C
|
||||
|
||||
#if defined(USE_EZOPH) || defined(USE_EZOORP) || defined(USE_EZORTD) || defined(USE_EZOHUM) || defined(USE_EZOEC) || defined(USE_EZOCO2) || defined(USE_EZOO2) || defined(USE_EZOPRS) || defined(USE_EZOFLO) || defined(USE_EZODO) || defined(USE_EZORGB)
|
||||
#if defined(USE_EZOPH) || defined(USE_EZOORP) || defined(USE_EZORTD) || defined(USE_EZOHUM) || defined(USE_EZOEC) || defined(USE_EZOCO2) || defined(USE_EZOO2) || defined(USE_EZOPRS) || defined(USE_EZOFLO) || defined(USE_EZODO) || defined(USE_EZORGB) || defined(USE_EZOPMP)
|
||||
#define USE_EZO
|
||||
#endif
|
||||
#if defined(USE_EZO)
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
xsns_78_ezopmp.ino - EZO PMP I2C PMP sensor support for Tasmota
|
||||
|
||||
Copyright (C) 2020 Christopher Tremblay
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef USE_I2C
|
||||
#ifdef USE_EZOPMP
|
||||
|
||||
#define EZO_PMP_READ_LATENCY 300
|
||||
|
||||
struct EZOPMP : public EZOStruct {
|
||||
EZOPMP(uint32_t addr) : EZOStruct(addr), volume(NAN) {}
|
||||
|
||||
virtual void ProcessMeasurement(void)
|
||||
{
|
||||
char data[D_EZO_MAX_BUF];
|
||||
|
||||
EZOStruct::ProcessMeasurement(data, sizeof(data), EZO_PMP_READ_LATENCY);
|
||||
|
||||
volume = CharToFloat(data);
|
||||
}
|
||||
|
||||
virtual void Show(bool json, const char *name)
|
||||
{
|
||||
char str[FLOATSZ];
|
||||
|
||||
dtostrfd(volume, 1, str);
|
||||
|
||||
if (json) {
|
||||
ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_PUMP "\":%s"), name, str);
|
||||
ResponseJsonEnd();
|
||||
|
||||
#ifdef USE_WEBSERVER
|
||||
} else {
|
||||
WSContentSend_PD(HTTP_SNS_MILLILITERS, name, str);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static const char id[] PROGMEM;
|
||||
|
||||
private:
|
||||
float volume;
|
||||
};
|
||||
|
||||
const char EZOPMP::id[] PROGMEM = "PMP";
|
||||
|
||||
#endif // USE_EZOPMP
|
||||
#endif // USE_I2C
|
|
@ -77,7 +77,11 @@ const char *const EZOSupport[EZO_ADDR_n] PROGMEM = {
|
|||
#else
|
||||
EZOStruct::id,
|
||||
#endif
|
||||
EZOStruct::id, // "PMP"
|
||||
#ifdef USE_EZOPMP
|
||||
EZOPMP::id,
|
||||
#else
|
||||
EZOStruct::id,
|
||||
#endif
|
||||
#ifdef USE_EZOFLO
|
||||
EZOFLO::id,
|
||||
#else
|
||||
|
@ -257,6 +261,9 @@ private:
|
|||
#ifdef USE_EZORTD
|
||||
CREATE_EZO_CLASS(RTD)
|
||||
#endif
|
||||
#ifdef USE_EZOPMP
|
||||
CREATE_EZO_CLASS(PMP)
|
||||
#endif
|
||||
#ifdef USE_EZOFLO
|
||||
CREATE_EZO_CLASS(FLO)
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue